Created
September 7, 2011 17:27
-
-
Save SathyaBhat/1201185 to your computer and use it in GitHub Desktop.
This file contains 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
var pattern=/\bIWSS/ | |
// var mobilizr = "http://google.com/gwt/x?u=" | |
// var mobilizr = "http://www.instapaper.com/m?u=" | |
var mobilizr = "http://viewtext.org/article?url=" | |
var hnold = /news.ycombinator.com/ | |
var imgur = /imgur.com/ | |
var new_image = "http://sbhat.me/u/fetch_images.php?ImgUrl=" | |
var newurl | |
var mobi | |
if (pattern.test(window.document.title)) | |
{ | |
newurl = mobilizr + encodeURIComponent(window.location.href); | |
console.log(newurl) | |
if (window.location.href.match(hnold)) | |
{ | |
newurl = window.location.href.replace(hnold,"hackerne.ws"); | |
} | |
else if (window.location.href.match(imgur)) | |
{ | |
newurl = new_image + window.location.href; | |
} | |
// chrome.tabs.update(tabId, {"url":newurl}); | |
chrome.extension.sendRequest({redirect: newurl}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment