A Pen by uli schaeffler on CodePen.
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:(()=>{const selectedText=window.getSelection().toString().trim();if(!selectedText){alert("You need to select some text!");return;}const url=new URL(window.location);url.hash=`:~:text=${encodeURIComponent(selectedText)}`;navigator.clipboard.writeText(url.toString()).then(()=>{alert("Copied to clipboard:\n"+url.toString());}).catch(()=>{alert("Error: Could not copy to clipboard.\n"+url.toString());});})(); |
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
| accordion-group { | |
| background-color: #f7f7f7; | |
| border-radius: 0.25em; | |
| display: block; | |
| margin-block-end: 1.5em; | |
| padding: 0.5em 1em; | |
| width: 100%; | |
| } | |
| accordion-group [accordion-trigger] { |
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
| <h2 class="main-heading" id="specific-heading">Dies ist eine Überschrift</h2> |
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
| <div class="main-content"> | |
| <h2>Hauptinhalts-Titel</h2> | |
| <p>Das ist der erste Absatz.</p> | |
| <div class="sidebar"> | |
| <h2>Sidebar Titel</h2> | |
| <p>Inhalt der Sidebar.</p> | |
| </div> | |
| <p>Das ist der zweite Absatz im Hauptinhalt.</p> | |
| </div> |
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
| # ---------------------------------------------------------------------- | |
| # | Compression | | |
| # ---------------------------------------------------------------------- | |
| <IfModule mod_deflate.c> | |
| # Force compression for mangled `Accept-Encoding` request headers | |
| # https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html | |
| <IfModule mod_setenvif.c> |
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
| Der Fehler "Failed to execute `readText` on `Clipboard`: Document is not focused" tritt auf, wenn das Bookmarklet versucht, auf die Zwischenablage zuzugreifen, während das Dokument (d.h. die Browser-Seite) nicht im Vordergrund ist. Diese Sicherheitsvorkehrung stellt sicher, dass ein Skript nur dann auf die Zwischenablage zugreifen kann, wenn der Nutzer mit der Seite interagiert. | |
| Um das Bookmarklet erfolgreich zu verwenden, müssen wir sicherstellen, dass der Browser im Vordergrund ist, und wir können eine alternative Eingabemethode als Fallback einbauen, falls der Zugriff auf die Zwischenablage nicht erlaubt ist. | |
| Hier ist die aktualisierte Version des Bookmarklets, die den Nutzer auffordert, den Text manuell einzugeben, wenn der direkte Zugriff auf die Zwischenablage fehlschlägt: | |
| ```javascript | |
| javascript:(async()=>{const githubToken='DEIN_GITHUB_TOKEN_HIER';const gistDescription='Gist erstellt über Bookmarklet';try{let clipboardText='';try{clipboardText=await navigator.clipboard.readText();}catch(e){clipboa |
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
| [ | |
| { | |
| "name": "Alice", | |
| "message": "Congratulations on your retirement! Wishing you a journey of happiness and adventure in the years ahead." | |
| }, | |
| { | |
| "name": "Bob", | |
| "message": "Happy Retirement! It's time to enjoy your life to the fullest. Thank you for your years of hard work and dedication." | |
| }, | |
| { |
NewerOlder