Created
November 15, 2018 00:42
-
-
Save gapurov/24f258bae1aabb570be34ac6fe5d463a to your computer and use it in GitHub Desktop.
refresh css v2 bookmarklet by Lea Verou
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
{ | |
let $$ = (selector, root = document) => Array.from(root.querySelectorAll(selector)); | |
let refresh = (document) => { | |
for (let link of $$("link[rel=stylesheet][href]", document)) { | |
let href = new URL(link.href); | |
href.searchParams.set("forceReload", Date.now()); | |
link.href = href; | |
} | |
for (let iframe of $$("iframe", document)) { | |
iframe.contentDocument && refresh(iframe.contentDocument); | |
} | |
} | |
refresh(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment