Judging by the description for your extension, it looks like you want this content script to run on all web pages. However, your 'matches' clause only specifies http://www.visitrs.com/client/* so your content script will only run there. If you want your content script to run on all websites, you need http://*/* and potentially https://*/*.
Maybe this is why you are not seeing the focus event hit? On Mon, Dec 21, 2009 at 09:07, Mohamed Mansour <[email protected]> wrote: > This is a good tutorial regarding debugging: > http://code.google.com/chrome/extensions/tut_debugging.html > <http://code.google.com/chrome/extensions/tut_debugging.html> > -Mohamed Mansour > > > > On Mon, Dec 21, 2009 at 11:48 AM, Max <[email protected]> wrote: > >> Alerting, logging and editing the DOM all work fine. If it doesn't, >> chances are your extension is erroring out (Ctrl+Shift+J to open the >> console and check for errors) or the match is not triggering. >> >> On Dec 20, 11:38 pm, altunyurt <[email protected]> wrote: >> > Hi, >> > >> > my manifest.json is as given below: >> > >> > { >> > "name": "Visitrs", >> > "version": "0.1", >> > >> > "description": "Chat with other visitors of your favorite sites", >> > "icons": { >> > "16": "vclogo16.png", >> > "32": "vclogo32.png", >> > "48": "vclogo48.png", >> > "128": "vclogo128.png" >> > }, >> > >> > "browser_action": { >> > "default_icon":"vclogo48.png", >> > "default_title": "Visitrs - Reclaim your communities" >> > }, >> > >> > "background_page": "background.html", >> > "content_scripts": [{ >> > "matches": ["http://www.visitrs.com/client/*"], >> > "js": ["vs.js"], >> > "all_frames":true >> > }], >> > "permissions": ["tabs", "http://www.visitrs.com/"] >> > } >> > >> > and my content_script, vs.js: >> > >> > // just a debug code to see if it works >> > window.addEventListener('focus', function(){ >> > (document.getElementsByTagName('button')[0]).textContent = 'hede'; >> > >> > }); >> > >> > and nothing happens on focus. as stated in documentation, >> > content_scripts are outside of both extension and the page's context >> > so alerting, logging and stuff does not work. >> > >> > so is there any way of debugging content_scripts? it's just annoying >> > not knowing what goes wrong.. >> > >> > thanks >> > özgür >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> "Chromium-extensions" group. >> To post to this group, send email to [email protected] >> . >> To unsubscribe from this group, send email to >> [email protected]<chromium-extensions%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/chromium-extensions?hl=en. >> >> >> > -- > You received this message because you are subscribed to the Google Groups > "Chromium-extensions" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<chromium-extensions%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/chromium-extensions?hl=en. > -- You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.
