Web Browser Invert Colors Bookmarklet

Search This thread

tmuka

Senior Member
Oct 25, 2008
388
44
Grand Rapids, MI
I was looking for a solution to invert browser colors on my Epic4G. I look forward to a day when Cyanogenmod runs on the epic so I can use the modded browser with "invert colors". Dolphin HD's "Reader" addon was close, but it added padding to the browser on my Epic.

So... i decided maybe a javascript bookmarklet could do what i wanted. turns out, it did.

This has only been tested in the Android 2.3.4 stock browser. To use it, copy the code from the page linked to below into the clipboard and add a new bookmark, pasting the code into the URL box. Give it a name like "Invert Color". Then when you're viewing a page you want to invert, open the bookmarks menu, and click the bookmark.

http://tonymuka.com/js/

You still have to click the link for every page you browse to for now, but perhaps somebody knows a better way. I did try to contact Dolphin for info on writing Addons, but it doesn't seem very open. I haven't used firefox mobile too much yet, but maybe there is potential there...

I wasn't sure exactly where to post this, and since it might work on any device with a browser that supports bookmarklets, i put it in general. mods should feel free to move it with my thanks!

Enjoy!
 
  • Like
Reactions: claimui

tmuka

Senior Member
Oct 25, 2008
388
44
Grand Rapids, MI
does this work on wp7??

It should work in any modern HTML compliant browser that supports javascript in bookmarks. You'll probably have to copy and paste the javascript into the bookmark and give it a try. Please let us know if it does :) I tried this weekend in Dolphin HD on Android, and in Mobile Safari on Apple's iPad2 and it works there too.
 

Magpir

Senior Member
Jul 4, 2011
4,169
416
It should work in any modern HTML compliant browser that supports javascript in bookmarks. You'll probably have to copy and paste the javascript into the bookmark and give it a try. Please let us know if it does :) I tried this weekend in Dolphin HD on Android, and in Mobile Safari on Apple's iPad2 and it works there too.

i tried it works on windowsphone IE 9 in mango

But not all webpages invert colour

and also each time u need to press the bookmarklet

is there a permanent solution?
 

tmuka

Senior Member
Oct 25, 2008
388
44
Grand Rapids, MI
i tried it works on windowsphone IE 9 in mango
But not all webpages invert colour
and also each time u need to press the bookmarklet
is there a permanent solution?

Glad to hear it works in mango!

Unfortunately i don't know a way to make it permanent, i think the browser would have to allow such plugins to run automatically every time a page loads. (like a greasemonkey script, etc)

If you send a link to a page that wont invert I'll check it out and see if i can fix it. If it has a background image or flash there's not much i can do without removing background images altogether...
 

Magpir

Senior Member
Jul 4, 2011
4,169
416
Glad to hear it works in mango!

Unfortunately i don't know a way to make it permanent, i think the browser would have to allow such plugins to run automatically every time a page loads. (like a greasemonkey script, etc)

If you send a link to a page that wont invert I'll check it out and see if i can fix it. If it has a background image or flash there's not much i can do without removing background images altogether...

just try to make it permanent...like a cookie ect,,

or make an entire new browser and upload to marketplace for free
 
Last edited:

claimui

Senior Member
Sep 11, 2011
173
105
Taipei
Tony, thanks for this. It inspired me to think about a more permanent solution using a web filtering proxy. I have proof that it would work, but I don't have the skills to develop this further. Would be great if you could take a look at this and see if you have any thoughts: http://xdaforums.com/showthread.php?p=17960461
 
Last edited:

yareally

Senior Member
Feb 19, 2011
1,444
229
codingcreation.com
Browsers that support web storage could probably do it.

Also the one browser I know wont have a problem making it permanent would be Opera Mobile, because it supports user javascript and css like the desktop browser does.
 

tmuka

Senior Member
Oct 25, 2008
388
44
Grand Rapids, MI
claimui, great idea, i'll check it out!

yareally, i'm an old opera fan, but haven't fallen in love with the mobile version despite several attempts... gotta love the user js and css though- didn't know you could use them on mobile too!
 

yareally

Senior Member
Feb 19, 2011
1,444
229
codingcreation.com
claimui, great idea, i'll check it out!

yareally, i'm an old opera fan, but haven't fallen in love with the mobile version despite several attempts... gotta love the user js and css though- didn't know you could use them on mobile too!

Yeah, it's not quite as friendly to do as the desktop browser, but you can set the userjs/usercss locations and such in opera.ini and mod whatever you like.

I semi wrote an informal tutorial on it in a thread for opera mobile in the forum area http://my.opera.com/community/forums/findpost.pl?id=9373312
 

ino-xda

Member
Feb 25, 2011
26
9
tmuka said:
I was looking for a solution to invert browser colors on my Epic4G. I look forward to a day when Cyanogenmod runs on the epic so I can use the modded browser with "invert colors". Dolphin HD's "Reader" addon was close, but it added padding to the browser on my Epic.

So... i decided maybe a javascript bookmarklet could do what i wanted. turns out, it did.

Pardon me, but this is rediculous! How do you justify accessing your private site for a "bookmarklet" over 90 kb in size running and incorporating parts of several versions of jQuery??

I put it to you that this is spyware! Swapping foreground and background colors is a oneliner in any version of this bookmarklet, doesn't need any external sites, runs much faster and doesn't have privacy issues like this garbage!
 

tmuka

Senior Member
Oct 25, 2008
388
44
Grand Rapids, MI
Pardon me, but this is rediculous! How do you justify accessing your private site for a "bookmarklet" over 90 kb in size running and incorporating parts of several versions of jQuery??

I put it to you that this is spyware! Swapping foreground and background colors is a oneliner in any version of this bookmarklet, doesn't need any external sites, runs much faster and doesn't have privacy issues like this garbage!

I assure you this is not any kind of spyware, read the source, it's all there in plain text... Feel free to provide the one liner bookmarklet you refer to if you are really trying to be helpful, otherwise, move along...
 

radoxme

New member
Jun 21, 2012
1
1
Hi Tony M

Just to repeat it here:

Put the javascript in a gesture activated bookmark in dolphin hd for ease of use.

I also found this gem on css sheets with opera mobile.

androidforums dot com/samsung-captivate/195082-high-contrast-browsing.html

I used to have an app that let you pass pages between browsers with intents. Lost it and can't remember the name!

Found it. It is called choose browser.
Pluck the best from each browser.
 
Last edited:
  • Like
Reactions: tmuka

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I was looking for a solution to invert browser colors on my Epic4G. I look forward to a day when Cyanogenmod runs on the epic so I can use the modded browser with "invert colors". Dolphin HD's "Reader" addon was close, but it added padding to the browser on my Epic.

    So... i decided maybe a javascript bookmarklet could do what i wanted. turns out, it did.

    This has only been tested in the Android 2.3.4 stock browser. To use it, copy the code from the page linked to below into the clipboard and add a new bookmark, pasting the code into the URL box. Give it a name like "Invert Color". Then when you're viewing a page you want to invert, open the bookmarks menu, and click the bookmark.

    http://tonymuka.com/js/

    You still have to click the link for every page you browse to for now, but perhaps somebody knows a better way. I did try to contact Dolphin for info on writing Addons, but it doesn't seem very open. I haven't used firefox mobile too much yet, but maybe there is potential there...

    I wasn't sure exactly where to post this, and since it might work on any device with a browser that supports bookmarklets, i put it in general. mods should feel free to move it with my thanks!

    Enjoy!
    1
    Hi Tony M

    Just to repeat it here:

    Put the javascript in a gesture activated bookmark in dolphin hd for ease of use.

    I also found this gem on css sheets with opera mobile.

    androidforums dot com/samsung-captivate/195082-high-contrast-browsing.html

    I used to have an app that let you pass pages between browsers with intents. Lost it and can't remember the name!

    Found it. It is called choose browser.
    Pluck the best from each browser.