Forked from oradwell/gmail_remove_image_proxy.user.js
Last active
August 29, 2015 14:25
-
-
Save hilyjiang/1d6729c3db0c8fe1bb99 to your computer and use it in GitHub Desktop.
Revisions
-
hilyjiang revised this gist
Jul 23, 2015 . 1 changed file with 1 addition and 1 deletion.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 @@ -49,4 +49,4 @@ setTimeout(function() { hideAnchor.innerHTML = '×'; divElem.appendChild(hideAnchor); document.getElementsByTagName('body')[0].appendChild(divElem); }, 5000); -
hilyjiang revised this gist
Jul 23, 2015 . 1 changed file with 2 additions and 2 deletions.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 @@ -24,13 +24,13 @@ setTimeout(function() { anchorElem.addEventListener('click', function () { var img, elem, src; // img src while (img = document.evaluate('//img[contains(@src, \'googleusercontent.com\') and contains(@src, \'#http\')]', document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue) { src = img.attributes.src.value; src = src.substr(src.indexOf('#') + 1); img.attributes.src.value = src; } // CSS background url etc while (elem = document.evaluate('//*[contains(@style,\'googleusercontent.com\') and contains(@src, \'#http\')]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue) { style = elem.attributes.style.value; style = style.replace(/url\(([^\)#]*)#([^\)]*)\)/, "url($2)"); elem.attributes.style.value = style; -
oradwell revised this gist
Mar 3, 2015 . 1 changed file with 2 additions and 2 deletions.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 @@ -1,8 +1,8 @@ // ==UserScript== // @name Gmail remove gstatic // @namespace ockcyp/gmail-remove-gstatic // @version 0.1 // @description Remove gstatic from external image URLs (useful when URLs contain internal domains) // @author ockcyp // @grant none // ==/UserScript== -
oradwell revised this gist
Oct 31, 2014 . 1 changed file with 8 additions and 1 deletion.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 @@ -22,12 +22,19 @@ setTimeout(function() { var anchorElem = document.createElement('a'); anchorElem.setAttribute('href', '#'); anchorElem.addEventListener('click', function () { var img, elem, src; // img src while (img = document.evaluate('//img[contains(@src, \'googleusercontent.com\')]', document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue) { src = img.attributes.src.value; src = src.substr(src.indexOf('#') + 1); img.attributes.src.value = src; } // CSS background url etc while (elem = document.evaluate('//*[contains(@style,\'googleusercontent.com\')]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue) { style = elem.attributes.style.value; style = style.replace(/url\(([^\)#]*)#([^\)]*)\)/, "url($2)"); elem.attributes.style.value = style; } return false; }); anchorElem.setAttribute('style', 'text-decoration:none;color:black;margin-right:5px'); -
oradwell created this gist
Oct 31, 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,45 @@ // ==UserScript== // @name Gmail remove gstatic // @namespace https://mail.google.com/mail/u/*/* // @version 0.1 // @description enter something useful // @author ockcyp // @grant none // ==/UserScript== setTimeout(function() { // Page is loaded and the div is not already created if (document.title.match(/@/) === null || document.getElementById('remove_img_proxy_div')) { return; } var textNode = document.createTextNode("Don't use Image Proxy"); // The div containing the links var divElem = document.createElement('div'); divElem.setAttribute('style', 'position:absolute;bottom:15px;' + 'font-size:12px;background-color:#EFF;padding:10px;margin:auto'); divElem.setAttribute('id', 'remove_img_proxy_div'); // Link to disable proxy var anchorElem = document.createElement('a'); anchorElem.setAttribute('href', '#'); anchorElem.addEventListener('click', function () { var img, src; while (img = document.evaluate('//img[contains(@src, \'googleusercontent.com\')]', document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue) { src = img.attributes.src.value; src = src.substr(src.indexOf('#') + 1); img.attributes.src.value = src; } return false; }); anchorElem.setAttribute('style', 'text-decoration:none;color:black;margin-right:5px'); anchorElem.appendChild(textNode); divElem.appendChild(anchorElem); // Link to hide the button var hideAnchor = document.createElement('a'); hideAnchor.setAttribute('href', '#'); hideAnchor.setAttribute('style', 'text-decoration:none;color:black;font-size:14px'); hideAnchor.setAttribute('onclick', "document.getElementsByTagName('body')[0].removeChild(document.getElementById('remove_img_proxy_div'))"); hideAnchor.innerHTML = '×'; divElem.appendChild(hideAnchor); document.getElementsByTagName('body')[0].appendChild(divElem); }, 2000);