You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/web-worker-offloading/readme.txt
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,4 +13,15 @@ Offload JavaScript execution to a Web Worker.
13
13
14
14
This plugin offloads JavaScript execution to a Web Worker, improving performance by freeing up the main thread.
15
15
16
-
In order to opt-in a script to be loaded in a worker, simply add the `web-worker-offloading` script as a dependency.
16
+
In order to opt-in a script to be loaded in a worker, simply add `worker` script data to a registered script. For example,
17
+
if you have a script registered with the handle of `foo`, opt-in to offload it to a web worker by doing:
18
+
19
+
`
20
+
wp_script_add_data( 'foo', 'worker', true );
21
+
`
22
+
23
+
== Frequently Asked Questions ==
24
+
25
+
= Why are my offloaded scripts not working and I see a 404 error in the console for `partytown-sandbox-sw.html`? =
26
+
27
+
If you find that your offloaded scripts aren't working while also seeing a 404 error in the console for a file at `/wp-content/plugins/web-worker-offloading/build/partytown-sandbox-sw.html?1727389399791` then it's likely you have Chrome DevTools open with the "Bypass for Network" toggle enabled in the Application panel.
0 commit comments