See also http://code.google.com/p/chromium/issues/detail?id=29071
On Mon, Dec 7, 2009 at 8:01 AM, PhistucK <[email protected]> wrote: > Your event is triggered within your content script context, not within the > web page context. Both of them can use the DOM of the page, but the contexts > are still isolated and the event is occurring in the content script context. > As far as I know. > > ☆PhistucK > > > On Mon, Dec 7, 2009 at 09:58, disya2 <[email protected]> wrote: >> >> Phistuck, >> Thanks for your response, however I'm still confused. >> >> 1. f() is defined on the web page. >> 2. onlick="f()" is hardcoded on the web page >> 3. e.dispatchEvent() is called from content script so only DOM event >> is sent. >> I'm not quite sure but think that there shouldn't be any js-code >> interaction between content script and the web page in this case. >> So I see no point why isolated worlds thing should matter here. >> If this is by design I'd like to know why and any workaround is hihgly >> welcome; and if this is a bug I'd like to know that clearly. >> >> >> On 7 дек, 13:42, PhistucK <[email protected]> wrote: >> > If f() is not defined within the content script, then it cannot be >> > accessed >> > (due to the isolated worlds thing). >> > >> > ☆PhistucK >> > >> > On Mon, Dec 7, 2009 at 09:30, disya2 <[email protected]> wrote: >> > > Hi, >> > >> > > In the extension I'm working on I need to simulate mouse clicks. >> > > Currently I use initMouseEvent/createEvent/dispatchEvent and the event >> > > sequence is mousedown/mouseup/click. The code runs in content script. >> > > This works pretty well for >> > > <a href="javascript:f()"></a> >> > > but fails for >> > > <div onclick="f()"/> >> > > with error message "f" is not defined. Function f() is defined on a >> > > web page. >> > > So I'm a bit confused why href="javascript:f()" works and onclick="f >> > > ()" doesn't. >> > >> > > Thanks, >> > > Denis >> > >> > > -- >> > >> > > 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. >> >> > > -- > > 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. > -- 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.
