This is my first app so please pardon my lack of knowledge. As a demo app i would like to achieve the following things :
Stage 1 :
1 Read the contents of a page
2 Look for a regex match in the contents of that page
3 Replace them with something else
Stage 2 :
1 On submitting () text to a web page
2 Read the text that’s about to get submitted
3 Look for a regex and replace it .
Could some one point in the direction of a similar app or make a small guide ? Any help is appreciated .
first of all, you need to insert a Content Script, the only way to access the page’s content.
http://code.google.com/chrome/extensions/content_scripts.html
You can make a content script only extension to begin, but for more advanced extensions you should read about programmatic injection.
http://code.google.com/chrome/extensions/content_scripts.html#pi
From a content script you can access the page’s DOM, and add listener to events in the usual way. For example, you can use document.getElementById() or element.addListener() .
There are many ways to look for a regexp, it depends the way you want to search the page, for example yo can use
Rob W gave you a nice hint to intercept submitting text with
chrome.webRequest