Last active
June 5, 2020 07:52
-
-
Save hanbzu/2a3496fa17719ba379fa9de78d1b0452 to your computer and use it in GitHub Desktop.
Small script to create a deep link for Chrome users. Copy the URL, copy the text and pass it to the script.
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
#!/usr/bin/env node | |
// Supported by Chrome and Edge (based on Chromium). See https://github.com/WICG/ScrollToTextFragment | |
const [scriptname, path, url, text] = process.argv; | |
if (url === undefined || text === undefined) | |
console.error(`Usage: ${scriptname} url "text to find"`); | |
else console.info(`${url}#:~:text=${encodeURIComponent(text)}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment