Plugins: [a list of plugins you are using or 'none'] prism-line-numbers
Environment: [e.g. Browser, Node, Webpack] Brave browser inside Service Worker
Library throw error in service worker when it receives a message.
Example
I've found when running on my site that it throw exception in this code:
if (!_.disableWorkerMessageHandler) {
// In worker
_self.addEventListener('message', function (evt) {
var message = JSON.parse(evt.data);
var lang = message.language;
var code = message.code;
var immediateClose = message.immediateClose;
_self.postMessage(_.highlight(code, _.languages[lang], lang));
if (immediateClose) {
_self.close();
}
}, false);
}
What is the purpose of this code. You basically can't send a normal message to service worker because JSON.parse will always throw error.
Information:
Library throw error in service worker when it receives a message.
Example
I've found when running on my site that it throw exception in this code:
What is the purpose of this code. You basically can't send a normal message to service worker because JSON.parse will always throw error.
I've tried to set:
but it doesn't work.