content_script is required to run only on http://www.visitrs.com/client/ which 
is open as a tab where content_script manipulates a hidden input's value on 
request received from extension. 

well the scenario is:
 - if a window containing visitrs.com/client/ does not exist, create it
 - if it exists, send request {'roomname':'blah'} to tab it is in
 - content_script manipulates a hidden input in document
 - tab document eventlistener bound to hidden input calls the function to open 
the requested room 
upon input's value change

this way i can use the same chat window every time user wants to join another 
room from main browser
window. well i could.. the version i've uploaded to extensions was working this 
way, then i've updated 
chrome to 4.0.249.43 and it does not function since then.

focus event is just to see whether it works. i've also tried alert('blah') or 
changing innerHTML of a 
visible element. nothing works. i guess, judging from the replies, something in 
between content_script 
loading and page loading fails but there're no error logs in inspector or 
anywhere.

thanks


On Mon, 21 Dec 2009 13:50:46 -0800
Finnur Thorarinsson <[email protected]> wrote:

> 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.
> 
> 


-- 
Özgür Şefik Altunyurt <[email protected]>

--

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.


Reply via email to