I have found a javascript function that inverts colors on webpage:
String javascript = "javascript: (function (){var newSS, styles = '* { background-color: black ! important; color: green !important; }a:link, a:link * { color: green !important; text-style: underline; }a:visited, a:visited * { color: #7f0000 !important; }a:hover, a:hover * { color: red !important; }';var elemHead = document.getElementsByTagName(\"head\")[0];var elemCSS = document.getElementById(\"darkenCSS\");if (elemCSS){elemHead.removeChild(elemCSS);}else{newSS = document.createElement('link');newSS.rel = 'stylesheet';newSS.href = 'data:text/css,' + escape(styles);newSS.id = \"darkenCSS\";elemHead.appendChild(newSS);}})();";
Is it possible to run this automatically? By that I mean load www.google.co.uk and apply this javascript function.4
Hope that makes sense, I don't know much about javascript.
CLARIFICATION:
I want to know if this javascript function can be appended to a URL at all. Something like http://www.google.com/?Javascript_blah_blah_blah
FURTHER CLARIFICATION:
I am making a basic web browser in Android. I want to invert colours on the webpage. I have made a button, that executes this javascript on the page. This works. But needs the user to press the button each time.
I want to make a switch to make permanently inverted.
So I need to browse to the url input and have it invert the colours automatically.
Hope this helps