ä½ãä»ããã£ã¦æãã§ããã»ã»ã ã±ã£ã¨æãåºããªãã¦èª¿ã¹ãã®ã§ãå¿ããªãããã«ã¡ã¢ã£ã¨ãã Browser â ServiceWorker ããã¯å²ã¨ç°¡åã§ã`navigator.serviceWorker.controller`ã«çãã¦ã`postMessage()`ã使ãã°ããã // Browser (async function main() { // ãã¡ããåãã£ã¦ç»é²ãã¦ãã㦠await navigator.serviceWorker.register('./sw.js'); const ctrl = navigator.serviceWorker.controller; ctrl.postMessage({ type: 'data', payload: { x: 1 }}); }()); ãããã£ã¦éã£ã¦ãåãåãå´ã¯ããã // ServiceWorker self.a
{{#tags}}- {{label}}
{{/tags}}