aboutsummaryrefslogtreecommitdiff
path: root/src/content/urls.js
blob: 8f8a1ac97aa4160bc3d1ef1c4b88c425da0d91c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 };