You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you open an HTML file from your local machine, it'll have an address starting file://. However, the tota11y bookmarklet includes this code: tota11y.src='//khan.github.io/tota11y/tota11y/build/tota11y.min.js'
This results in an attempt to load file://khan.github.io/tota11y/tota11y/build/tota11y.min.js', which fails. So the bookmarklet can't be used on local files without modification.
This line could be changed so that it begins with https:// rather than just // and that would solve this problem.
The bookmarklet currently uses a protocol-independent URL to load the source, which means that pages viewed locally (`file:///`) will attempt to also load the library from the file tree, rather than the CDN. There is no compelling reason to load the asset on http vs https, even when viewing a plain-http page, and thus the protocol should be set to https explicitly.
Fixesjdan#130
If you open an HTML file from your local machine, it'll have an address starting
file://
. However, the tota11y bookmarklet includes this code:tota11y.src='//khan.github.io/tota11y/tota11y/build/tota11y.min.js'
This results in an attempt to load
file://khan.github.io/tota11y/tota11y/build/tota11y.min.js'
, which fails. So the bookmarklet can't be used on local files without modification.This line could be changed so that it begins with
https://
rather than just//
and that would solve this problem.(Note that Paul Irish also considers protocol-relative URLs an antipattern (see update at the top of https://www.paulirish.com/2010/the-protocol-relative-url/), so that might be another reason to no longer use them.)
Thanks for a great tool!
The text was updated successfully, but these errors were encountered: