yank a URL
This commit is contained in:
parent
bbf90e77e9
commit
f6996a2274
4 changed files with 23 additions and 1 deletions
15
src/content/urls.js
Normal file
15
src/content/urls.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const yank = (win) => {
|
||||
let input = win.document.createElement('input');
|
||||
win.document.body.append(input);
|
||||
|
||||
input.style.position = 'fixed';
|
||||
input.style.top = '-100px';
|
||||
input.value = win.location.href;
|
||||
input.select();
|
||||
|
||||
win.document.execCommand('copy');
|
||||
|
||||
input.remove();
|
||||
};
|
||||
|
||||
export { yank };
|
Reference in a new issue