How can I access chrome.history from a Web Worker?

前端 未结 1 1630
悲哀的现实
悲哀的现实 2021-01-22 05:43

Is there any way I can access the chrome.* apis (specifically chrome.history) from a Web Worker?

If I pass the chrome.history or chrome object in with

1条回答
  •  悲哀的现实
    2021-01-22 06:24

    Web Workers are meant to be light-weight, and do not inherit any permissions (not even host permissions) from the extension (besides, chrome is not even defined in a Web worker).

    If you're doing really heavy stuff with the results of the chrome.history API, then you could pass the result of a callback to a worker for processing (with Transferables, the overhead is minimal). Before doing that, make sure that you profile whether the performance impact is really that significant to warrant implementing anything like this.

    0 讨论(0)
提交回复
热议问题