我有一个webworkers的数组,名为workers。我在一个叫做activate的函数中启动它们。问题是,我想让activate返回由worker发布的值。我希望它能够回复某种承诺,或等到它们全部完成。 因此,代码可能是: // the web workers add stuff in this array with onmessage()
var globalArray = [];
fu
我有一个网络工作者,我添加了'notificationclick'事件。 我想导航到相同选项卡中的网址,而不是打开新选项卡。 任何线索如何做到这一点? self.addEventListener('notificationclick', function (event) {
const id = event.notification.data.id;
let path = 'h