Created
April 3, 2014 13:42
-
-
Save fuzzyfox/9954583 to your computer and use it in GitHub Desktop.
Revisions
-
William Duyck created this gist
Apr 3, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ # Super Goggles Takes Webmakers [X-Ray Goggles](https://goggles.webmaker.org/) and adds a little spice so that you can goggle on published [Thimble](https://thimble.webmaker.org) projects. ## Install Compress the JS in `supergoggles.js` and add to your bookmarks toolbar. Then use in place of X-Ray Goggles. My personal favourite tool to do this easily is <http://userjs.up.seesaa.net/js/bookmarklet.html>. Simply copy the code in `supergoggles.js` and paste it into the tool. Name the bookmarklet and drag the link at the bottom of the page to your bookmarks toolbar. Done. 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ (function(window, document, undefined){ function injectGoggles(doc) { var doc = doc || window.document; var script = doc.createElement('script'); var lang = navigator.userLanguage || navigator.language || 'en-US'; script.src = 'https://goggles.webmaker.org/en-US/webxray.js'; script.className = 'webxray'; script.setAttribute('data-lang', lang); script.setAttribute('data-baseuri', 'https://goggles.webmaker.org/' + lang); doc.body.appendChild(script); } var url = document.createElement('a'); url.href = window.location.href; if(url.host.match(/makes\.org/) && url.pathname.match(/^\/thimble\//) && url.pathname.substr(url.pathname.length - 1) !== '_'){ var frame = document.querySelector('iframe.embed-iframe').contentWindow; injectGoggles(frame.document); } else { injectGoggles(); } })(this, this.document);