Last active
October 7, 2022 17:55
-
-
Save magasine/e8b79b5924758e5b049608e7cfa0a588 to your computer and use it in GitHub Desktop.
! GistMarklet direct link (bookmarklet)
This file contains 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 : void(function () { | |
const parsedUrl = new URL(window.location.href); | |
const gistMarkletID = parsedUrl.pathname.split('/')[2]; | |
window.alert('GistMarklet ID capturated : ' + gistMarkletID); | |
const directUrl = `http://dschep.github.io/GistMarklets/#${gistMarkletID}`; | |
window.open(directUrl, "_blank"); | |
})(); | |
// Create GistMarklet direct link to bookmarklet | |
// How to use? In gists pages, launch the bookmarklet from the bookmarks bar and wait for the redirection of a new window with the bookmarklet link mounted! | |
// Default Url: http://dschep.github.io/GistMarklets/#ID | |
// Adapted from: https://gist.github.com/CebolaBros64/eb6ab65099fd4aaf4f6b988c694955f9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment