According to this page https://msdn.microsoft.com/en-us/library/dn255005(v=vs.85).aspx it is possible to profile Web Worker code in Internet Explorer 11 (11.576.14393 in my case) Developer Tools (F12). But when I finish profiling, I can see only report from code running on main thread and threre is no Worker ID colum in the results as described on the mentioned page. Also, when I try to programatically start profiling from the Web Worker using Console.profile() method https://msdn.microsoft.com/en-us/library/jj152133(v=vs.85).aspx, I get error:
Object doesn't support property or method 'profile'
Do you have any clue what may be wrong? Do you please know how to profile Web Worker code in Internet Explorer?
PS: Same applies to Edge 38.14393.0.0. Rewriting the Web Worker code to run and profile it on main thread is not an option because it would take several months. The same code runs reasonably fast on Chrome and Firefox.
I tried to profile a simple web worker from the following demo
Web Worker Demo
It seems a bit weird but I was able to profile the worker only in the following scenario
I had started profiling the page and then started the worker and then stopped the worker and then stopped profiling.Exported the Data with Worker Id.
I had used IE11 in windows 7 environment.
Hope this helps :)
Related
I'm developping a website which is meant to be used on mobile devices using Google Chrome, the purpose is to list information such as time (hh:mm) and battery level.
I saw the Battery Web API but I'm experiencing a strange error:
click to see the chrome error
Here is the code I used in order to get the battery level:
navigator.getBattery().then(function (battery) {
console.log(Math.round(battery.level * 100))
});
I had the error yesterday, without changing any line of code, it is working today on my tablet (chrome version: 103), but I tested on another tablet (Samsung Galaxy TAB A7 LITE, Chrome version: 103) and I encounter the error, I restarted several times the devices, inspected pages using the devtools connected by cable to my laptop, but I can't solve this error.
I saw a topic having the same error but he was developing a web worker it is not the same context as I.
No matter when I'm calling the navigator.getBattery() if the error appeared in the beginning it will stay undefined later, so it is not a problem of timing to call it (I even bound it to the body.onload but it didn't work).
I thought it could be authorization issues on system information but there's nothing refering to the battery which is not authorized in the application settings of Chrome.
Any help is welcome :D
I found out where my error was coming from.
It is a problem of HTTPS, my testing environment is configured behind a NGINX HTTP Server, which serves HTTP and HTTPS version of my application in order to use a single certificate for every of my projects, Chrome on my laptop prefix URLs I'm accessing with https:// and it is hidden in the navbar, but it is not the case on Chrome tablet or mobile, I thought I was consulting the HTTPS version but it was HTTP, and Battery Web API isn't accessible on HTTP websites, it is required to have a secure connection using HTTPS and certificates. It has nothing to do with version number since Battery Web API is fully supported since Chrome version 38 according to MDN Documentation.
My goal is to send Gmail-style desktop notifications in Chrome or Firefox from a web app (let's call it X) that is NOT currently open in the browser, without requiring the user to install an app or extension. It's okay if the user needs to grant permission to receive notifications from X, and it's okay if the browser needs to be open for the notification to appear, as long as X doesn't need to be open in the browser. A solution that doesn't require any browser window to be open would also work.
I just spent the day digging into this, and so far I think I've learned:
Since OSX Mavericks, it has been possible to do this in Safari 7+ via Safari Push Notifications.
The Web Notifications API works in Chrome/Firefox, but requires the user's browser to be open to X.
Twitter sends similar web notifications without asking the user for permission first, but requires the user's browser to be open to Twitter.
There are lots of references to possible Growl implementations, but as far as I can tell, all of them require the user to install Growl and/or a Growl-enabled app to work.
I could be wrong about any of my statements above - I'd love to hear it! - and I'm open to any other solution too. Any ideas?
Thanks for reading.
You can send push notifications even when your web page is not active using Service Workers, the Notification API for service workers and the push API for server-initiated notifications (or scheduled notifications).
As of June 2016, Service Workers are supported in Chrome, Firefox and Opera. See the status at https://jakearchibald.github.io/isserviceworkerready/
See the following links for related discussions, status of implementation and specifications.
Service workers are enabled by default since Chrome 40, Firefox 33, and Opera 24. See the HTML5Rocks tutorial and MDN.
Push notifications: Chrome 42+, Firefox 44+
You can do exactly what you are looking for using the W3C Push API.
If you want to build everything from scratch I suggest to start reading this tutorial by Google. It is for Chrome, but Firefox works in a very similar way.
However it's a lot of work and the "standard" is still evolving: I suggest that you use a service like Pushpad (I am the founder).
I've got this JS application. All client side JS communicating with a third party stream server via web sockets. I have about 18 different web sockets open for one page. Firefox and Chrome handle this many open web sockets at once just fine. IE11 seems to have a limitation of 4 open web sockets at once. Once I open that 5th web socket, regardless of socket call to the third-party server, I get an error thrown by IE, which closes the socket and gives the general error "SecurityError" and expanding the proto section it gives me . Seems to be pretty generic errors from my searches. At first I thought there may be a trusted zone type issue with IE, but I've added the client site to my trusted zone as well as the server providing the data.
This post provides info on max number of websockets for Firefox & Chrome, but I don't see anything specific about IE. Are there any known limitations to IE and web sockets? Answered, see edit below.
This MDN site talks about increasing the max value, but again, I can't find anything about IE. Is there some IE setting to up the amount of open connections? Answered: see below edit.
EDIT: This site shows the max connections settings for IE. It looks like it's a registry setting in Windows that controls the amount of web socket connections. Interestingly enough, I don't have that registry Key anywhere, but there is still a limit for this. The page speaks of IE10, and I'm working with IE11 specifically. Does anyone know if there are registry settings for this in regards to IE11? Has anyone just added these feature web socket registry keys and solved this issue?
The MSDN documentation you referenced is clear on the default being 6 concurrent connections (which means if not specified in the registry, that's what you'll get); and, if the documentation doesn't specify differently, it's probably safe to assume newer versions of Internet Explorer act in the same way as version 10.
Try setting through group policy. It worked for me.
https://jwebsocket.org/documentation/reference-guide/internet-explorer-tips
This might seem like a very silly question, but how can i get the UI for the worker thread, containing the javascript like in chrome, you get a URL for the worker thread when debugging, for firefox ? I can't see this on firebug or the default debugging tool on firefix. I feel like i'm missing something obvious. Can someone please help me out here ?
There is now an option to enable debugging of workers in FireFox 43:
In Firefox 100 and probably later you should be able to debug live workers via debugging page:
about:debugging#/runtime/this-firefox
Just click on the "Inspect" button (beside the worker you want to debug). The button should open devtools for that worker.
Note that you might need to refresh the page you are trying to debug. Stopped workers will not be available there. As you can see on the screen below I can only debug (inspect) 2 of 3 workers.
A request to add inspect button in DevTools is here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1695114
BTW. If you do something like console.log('[sw.fetch]', 'cached and ok', response); you will not see this in main devtools. At least not in FF 101.0.
Using Chrome 17.0.963.46 m, I tried to create a new web worker from inside a web worker. But got a "Uncaught ReferenceError: Worker is not defined"
Any info. on this? (Google throw surprisingly few links on creating web worker inside webworkers)
That is the current state even on Chrome 19 - here is the bug:
http://code.google.com/p/chromium/issues/detail?id=31666
It's working on FF.
Creating workers within workers is not available in chrome. FF implemented this with the Example.
See the link for Example and Chroem bug.
https://developer.mozilla.org/en-US/docs/DOM/Worker/Functions_available_to_workers
https://developer.mozilla.org/en-US/docs/DOM/Using_web_workers?redirectlocale=en-US&redirectslug=Using_web_workers
Example specified by Mozilla Developer network.
https://developer.mozilla.org/samples/workers/fibonacci/
Chroem BUg
http://code.google.com/p/chromium/issues/detail?id=31666