yank a URL

This commit is contained in:
Shin'ya Ueoka 2017-10-08 16:37:26 +09:00
parent bbf90e77e9
commit f6996a2274
4 changed files with 23 additions and 1 deletions

15
src/content/urls.js Normal file
View 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 };