diff options
| author | Hsieh Chin Fan <typebrook@topo.tw> | 2023-02-04 09:03:29 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <typebrook@topo.tw> | 2023-02-04 09:03:29 +0800 |
| commit | 64ebcef8049fe0ed85594a35185089c8dd44fbcb (patch) | |
| tree | 8a5109bbf104048caf3c92885b368cde6ee923fc /web/bookmarklet/add-outline | |
| parent | 825c29b5e0740b27439003f21e1a1a74e563cfd5 (diff) | |
| parent | e63dea4ef9a346ee1912f03143dce123ce3ebe07 (diff) | |
Merge remote-tracking branch 'origin/dev' into dev
Diffstat (limited to 'web/bookmarklet/add-outline')
| -rw-r--r-- | web/bookmarklet/add-outline | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/web/bookmarklet/add-outline b/web/bookmarklet/add-outline new file mode 100644 index 0000000..880e9ff --- /dev/null +++ b/web/bookmarklet/add-outline | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | javascript: (function() { | ||
| 2 | let domStyle = document.getElementById('domStylee'); | ||
| 3 | if (domStyle) { | ||
| 4 | document.body.removeChild(domStyle); | ||
| 5 | return; | ||
| 6 | } | ||
| 7 | domStyle = document.createElement("style"); | ||
| 8 | domStyle.setAttribute('id', 'domStylee'); | ||
| 9 | color = Math.random() * (1<<24); | ||
| 10 | color = Math.floor(color).toString(16); | ||
| 11 | domStyle.append( | ||
| 12 | [`* { outline: 1px solid #${color}; outlineOffsset: -1px }`] | ||
| 13 | ); | ||
| 14 | document.body.appendChild(domStyle); | ||
| 15 | })(); | ||