You need to enable dom.events.asyncClipboard.clipboardItem
for it to work, via about:config
.
Last active
December 12, 2023 10:55
-
-
Save chrisdone-artificial/43930036803245cf5f443229362f55a0 to your computer and use it in GitHub Desktop.
Copy tab title + url as rich text bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var e=document.createElement('a');e.href=window.location.href;e.innerText=window.document.title.split(/%C2%B7/)[0].replace(/- Google Docs$/,'');var d=document.createElement('div');d.style="z-index:9999999999;position:fixed;top:0;left:0;padding:20px;background:#eee;color:#2f4c8e;right:0;border-bottom:1pxsolid#ddd";d.innerText%20=%20'Copied:%20';d.appendChild(e);document.body.appendChild(d);const%20type="text/html",type2="text/plain",blob2='['+e.innerText.replace(/[()]/g,'')+']('+window.location.href+')',blob=new%20Blob([e.outerHTML],{type}),data=[new%20ClipboardItem({[type]:blob,[type2]:blob2})];navigator.clipboard.write(data);})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment