Last active
January 24, 2024 13:07
-
-
Save Tekl/45cf23f32089a6c0529489a5f6da3338 to your computer and use it in GitHub Desktop.
Bookmarklets für Safari
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
//bookmarklet_title: Text-Fragment-Link | |
//bookmarklet_about: Dieses Bookmarklet erzeugt einen Link, der den ausgewählten Text als Text-Fragment hinter die URL der aktuellen Seite hängt. Besucht man einen solchen Link mit Safari oder Google Chrome, springt der Browser automatisch zur zuvor markierten Textstelle. Ziehen Sie uur Installation des Bookmarklets den unteren Button in die Favoritenleiste. Falls sie nicht sichtbar ist, einfach ⇧⌘B drücken. | |
var u = window.location.href + "#:~:text=" + encodeURIComponent(window.getSelection().toString()); | |
navigator.clipboard.writeText(u); | |
if (confirm("URL mit Text-Fragment in Zwischenablage kopiert. Im neuen Tab öffnen?")) { | |
window.open(u,"_blank") | |
}; | |
void(0); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment