Skip to content

Instantly share code, notes, and snippets.

@kaezarrex
Last active September 26, 2022 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaezarrex/a7857459c6055fbf843dcc76a100fab5 to your computer and use it in GitHub Desktop.
Save kaezarrex/a7857459c6055fbf843dcc76a100fab5 to your computer and use it in GitHub Desktop.
data-id bookmarklet
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body { font: 20px monospace; margin: 20px; }
a { border-radius: 5px; background-color: #ddd; padding: 10px;}
</style>
</head>
<body>
<a href="javascript:(function(){ var style = document.createElement(%27style%27), styleContent = document.createTextNode(%27[data-id] { box-shadow: 0 0 2px red !important; } [data-id]:before { content: attr(data-id) !important; display: block !important; position: absolute !important; background-color: red !important; padding: 2px !important; color: white !important; z-index: 9000 !important; pointer-events: none !important; font: 800 12px monospace !important; opacity: 0.8 !important; }%27); style.appendChild(styleContent ); var caput = document.getElementsByTagName(%27head%27); caput[0].appendChild(style); })();">data-id</a>
<span>← drag to your bookmarks bar</span>
</body>
</html>
@mrlatios
Copy link

what does this do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment