php - how can I change the content when browsing a web page? -
i want write program change content when browsing web page, , suppose add following feature:
1) highlight keywords
2) change background of keywords
3) when mouse move on it, give message bubble
i have ideas, not sure 1 work:
- write addon firefox
- write extension chrome
- write proxy using php change content of web page being proxy-ed.
- inject javascript web page
- other solutions ... ?
which 1 can solve problem ? , 1 best?
thanks in advance.
it 1+4 or 2+4 (or 1+2+4), you'll have write script injected pages , can used firefox greasemonkey script or chorme extension.
unlike in firefox need greasemonkey make scripts work, simple script file can used directly chrome extension dragging extensions window. more official documentation on how organise extension can make complete chrome extension.
a sample script inject script when on stackoverflow:
script.user.js
if(document.url.indexof("http://stackoverflow.com")!=-1) { var d = document.createelement("div"); d.innerhtml = "hello world! first injected script"; d.classname = "red"; // supposing it's defined, wouldn't hurt anyways // otherwise d.style.color = "#f00"; document.body.appendchild(d); } save file , drag "extentions" window on chrome, reload stackoverflow.
Comments
Post a Comment