The-Printliminator icon indicating copy to clipboard operation
The-Printliminator copied to clipboard

Bookmarklet doesn't work on local files due to protocol-relative URL

Open vermeer opened this issue 1 year ago • 2 comments

The bookmarklet currently loads a script from //css-tricks.github.io/The-Printliminator.... This works when relative to an https:// URL and even when relative to an http:// URL, but when viewing, for example, HTML help files on your own machine from file:///C:/local%20content... it tries to load the script from file:///css-tricks.github.io instead of the CDN and fails.

That protocol-relative URL would be useful if this was originally deployed on an insecure page, and later github.io updated to serve it from an https:// domain, but it's 2024. Serving the script over HTTPS works when running the bookmarklet from another https site, from an http site, or from a file:// site, so there's no reason not to use it everywhere.

Please change the bookmarklet from:

loadScript('//css-tricks.github.io/The-Printliminator/printliminator.min.js'

to

loadScript('https://css-tricks.github.io/The-Printliminator/printliminator.min.js'

to make it work on local files.

vermeer avatar Oct 25 '24 13:10 vermeer

True, but bookmarklets with external scripts do not work on local files due to security policies anyway, or do they?

piknockyou avatar May 06 '25 12:05 piknockyou

The Printliminator.txt

You can use the attached bookmarklet of The Printliminator (self-contained).

piknockyou avatar May 14 '25 18:05 piknockyou