I'm trying to make a little extension that checks the google search results for wikipedia articles, and adds a little extra link afterwards. But am having a little trouble parsing the search results. Its very simple at present.
Manifest:
{
"name": "Test",
"version": "0.1",
"description": "Test Test",
"icons":{
"128":"icon_128.png"
},
"permissions": [
"tabs",
"http://www.google.com/*",
"https://www.google.com/*"
],
"content_scripts": [
{
"matches": ["http://www.google.com/*", "https://www.google.com/*"],
"css": ["style.css"],
"js": ["jquery-1.7.min.js", "injector.js"],
"run_at": "document_end"
}
],
"manifest_version": 2
}
And injector:
function findWikipediaLinks(){
console.log("here I am!");
console.log($('a'));
//.css({'background-color': 'yellow'});
}
findWikipediaLinks();
The problem seems to be that the code here runs before the actual search results are shown. (the results logged are the a's in the google header bar. Is there a way to time this propperly?