Mycc commited on
Commit
6c2a83f
·
1 Parent(s): d0f80cb

Update Invidious Redirect.user.js

Browse files
Files changed (1) hide show
  1. Invidious Redirect.user.js +12 -2
Invidious Redirect.user.js CHANGED
@@ -6,8 +6,8 @@
6
  // @match *://*.youtube.com/watch*
7
  // @match *://youtu.be/*
8
  // @run-at document-start
9
- // @grant none
10
- // @version 1.05
11
  // @author Mycc
12
  // ==/UserScript==
13
 
@@ -32,6 +32,16 @@ if (time) {
32
  redirectURL.searchParams.set("t", time);
33
  }
34
 
 
 
 
 
 
 
 
 
 
 
35
  // Check if the default instance is available
36
  fetch(invidiousInstance, { method: 'HEAD', mode: 'no-cors' })
37
  .then(response => {
 
6
  // @match *://*.youtube.com/watch*
7
  // @match *://youtu.be/*
8
  // @run-at document-start
9
+ // @grant GM_registerMenuCommand
10
+ // @version 1.06
11
  // @author Mycc
12
  // ==/UserScript==
13
 
 
32
  redirectURL.searchParams.set("t", time);
33
  }
34
 
35
+ // Register the menu command
36
+ GM_registerMenuCommand('Скопировать URL-адрес', function() {
37
+ // Copy the URL to the clipboard
38
+ navigator.clipboard.writeText(redirectURL.toString()).then(function() {
39
+ console.log('URL-адрес скопирован в буфер обмена');
40
+ }, function(err) {
41
+ console.error('Не удалось скопировать URL-адрес: ', err);
42
+ });
43
+ });
44
+
45
  // Check if the default instance is available
46
  fetch(invidiousInstance, { method: 'HEAD', mode: 'no-cors' })
47
  .then(response => {