web-worker

EXC_BAD_ACCESS (SIGSEGV) in WebCore::UserGestureIndicator::processingUserGesture

佐手、 提交于 2019-12-05 12:46:59
问题 I have an iOS application built using a UIWebView and HTML5 websockets. The app experiences seemingly random crashes. It has occurred while a user is interacting with it and during longevity tests where no interaction between user and app occurs. The crash logs all have the following: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000 and the thread logs contain: Thread XX name: WebCore: Worker Thread XX Crashed: 0 WebCore 0x36c8c7a0 WebCore:

Is there an easy way to run Firebase in a web worker?

我是研究僧i 提交于 2019-12-05 12:38:57
I have a single page React application which consists of many files, bundled with gulp/browserify. Firebase javascript is embedded in this bundle. I'd like to know if there is an easy way to run certain Firebase operations on another worker thread ? What I have tried : Setting up a worker and sending the Firebase object, or instance, via worker.postMessage(xxx) . In both cases, it throws an error which says the object cannot be cloned . Example bellow with the Firebase object. var blobURL = URL.createObjectURL(new Blob([ '(', (function() { var onmessage = function(event) { var FB = new event

How can I customize a permission request popup for push notifications in a browser?

五迷三道 提交于 2019-12-05 12:04:05
I see that some websites have a fancy push notification permission request popups like this one whereas official API documentation doesn't provide any clue how to customize permission requests; and the only request I can generate looks like that How can I create a less ugly popup? Click the Allow button on the House of Bots site and you'll see exactly how they do it--they don't. The pop-up you see is just plain html, nothing special. When you click allow, it opens a new window that asks for permission, and then you get the typical browser window just like in your second image. 来源: https:/

Using webworker and IndexedDB for loader of Three js

╄→гoц情女王★ 提交于 2019-12-05 11:27:58
I want to use dracoLoader of threeJS in multi-threads, then I selected Webworker and IndexedDB. I have gotten the correct Geometry in webworker, however, when I pass data to main thread using IndexedDB, the geometry will be changed to a normal JS object instead of a ThreeJS Geometry. The geometry lost its functions and some information. webworker.js self.saveDrcToIndexedDB = function (drcfinal) { var db; var request = indexedDB.open("drcDB"); drcfinal.indexName = self.randomStr(); request.onupgradeneeded = function(event) { console.log('successfully upgraded db'); db = event.target.result; var

WebWorkers and WebSockets with Firefox

旧时模样 提交于 2019-12-05 09:41:31
I'm trying to implement a working WebSocket connection within a WebWorker. That should be simple and it is if I use Chrome as b rowser. However, since this experiment should further become part of a production I need it to work on all the great Browsers, namely also Firefox. My problem is that I can't get it working with Firefox. At first Firefox wasn't able to create a WebWorker. That was a Bug and is fixed with version 9. But now it seems that it wouldn't be able to create a WebSocket within the Worker. I tried the following line of code: var ws = new WebSocket(url); which fails with:

Recent documentation about Dart Isolates

橙三吉。 提交于 2019-12-05 08:29:19
I recently started with Dart ( www.dartlang.org ) and really like it so far. A very promising feature are isolates, but I am not sure on how to start. The documentation I found so far is from before a breaking change ( BREAKING CHANGE: dart:isolate ) in October 2013. The information in this "Breaking change" email is quite complicated and it looks like the new api is more complicated than the old. I've got some questions: Is the dart:isolate api stable? Is there any up-to-date documentation? Are there any working examples? Thanks for any help, Hendrik Jan I tried this example and it works

XMLHttpRequest to webservice not working in web worker

核能气质少年 提交于 2019-12-05 07:24:08
问题 The code below runs perfectly if called from main javascript, but it does not run in the web worker. function getSpecData(detailLvl, startWeek, endWeek, mkt) { var params = { "detailLvl": detailLvl, "startWeek": startWeek, "endWeek": endWeek, "mkt": mkt }; var xhr; var url = "WebServices/wsSProgress.asmx/GetSpecProgressTable"; try { xhr = new XMLHttpRequest(); xhr.open('POST', url, false); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onreadystatechange = function () { if (xhr

How to pass custom class instances through Web-Workers?

半世苍凉 提交于 2019-12-05 05:58:01
Since Web-Worker JSON serialize data between threads, something like this doesn't work: worker.js function Animal() {} Animal.prototype.foobar = function() {} self.onmessage = function(e) { self.postMessage({animal: new Animal()}) } main.js let worker = new Worker('worker.js') worker.onmessage = function(e) { console.log(e.data) } worker.postMessage('go!') The outcome would be a simple object with the loss of the foobar prototype method. Is it possible to transfer the custom object back to the main thread without losing its prototype methods? Like, would this be possible with ArrayBuffer ? I'm

Debugging and profiling web workers

我的未来我决定 提交于 2019-12-05 04:04:08
I am running computations e.g. path-finding in web workers. This can take several seconds and I want to optimise it. Chrome seems to be about 3x faster for my current code, but where the time is spent or why I have no insight into. Generally, how can you debug web workers? How can you profile web workers? (Firefox and Chrome) In Chrome you may open web worker source in Sources > Workers and get full interface to prifile. Profiling in Firefox - no idea. And http://www.nczonline.net/blog/2009/08/25/web-workers-errors-and-debugging/ 来源: https://stackoverflow.com/questions/16326495/debugging-and

Web Workers: SetInterval and SetTimeout reliability

你说的曾经没有我的故事 提交于 2019-12-05 03:39:04
In a browser environment, setTimeout and setInterval aren't reliable for accuracy - where time sensitivity is an issue. Recently, we've been given requestAnimationFrame , which allows us to do a little better (in terms of performance.now() and its timestamps). Long story short - I decided to build a metronome in Javascript, and while it works, it's fairly inaccurate above a certain tempo. While compensating for late frames allows the tempo not to desync over time, the individual beats are slightly off, which doesn't work for a metronome. (This is not a problem for animation, as it by nature