Hi Arne,
I have the following simple web worker.
[code file="web_worker.js"]
postMessage("Hello World!");
[/code]
I am running the following code in both my content script and
background page. I can see the Hello World message in the background
page only.
[code]
var workerURL = chrome.extension.getURL("web_worker.js");
var worker = new Worker(workerURL);
worker.onmessage = function(event) {
console.log('Web worker says: ' + event.data);
};
worker.onerror = function(event) {
console.error('Web worker says: ' + event.data);
};
[/code]
If that helps, when I debug the code above in my content script the
execution stops just after the line "var worker = new
Worker(workerURL);", while it goes through the rest in the background
page.
I have Chrome 8.0.552.215 beta on installed on Fedora.
Dogan
On Dec 6, 8:34 pm, Arne Roomann-Kurrik <
kur...@chromium.org> wrote:
> What exactly is the issue you're seeing?
>
> ~Arne
>
>
>
>
>
>
>
> On Sat, Dec 4, 2010 at 8:06 AM, Dogan Narinc <
dogan.nar...@gmail.com> wrote:
> > Hi all,
>
> > I have been trying to create Web Workers from within Content Scripts
> > but was unsuccessful. Does anyone know if this is as expected?
>
> > If as expected the obvious alternative would be to delegate that to
> > the Background Page, which comes at the cost of adding a message-
> > passing layer... Any thoughts on other ways to achieve this?
>
> > Cheers,
>
> > Dogan
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to
chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> >
chromium-extensions+unsubscr...@chromium.org<
chromium-extensions%2Bunsubscr...@chromium.org>
> > .