[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/API/Worklet/addModule [Back]  [Original]

Worklet.addModule() - Web API | MDN

MDN Web Docs

View in English Always switch to English

Worklet.addModule()

Baseline

20214

Experimental:

addModule() Worklet JavaScript Worklet

js
addModule(moduleURL);
addModule(moduleURL, options);

moduleURL

JavaScript URL

options

credentials

: Cookie HTTP Request.credentials "omit", "same-origin", "include" "same-origin" Request.credentials

URL Promise

addModule()

AbortError DOMException

SyntaxError DOMException

moduleURL

AudioWorklet

js
const audioCtx = new AudioContext();
const audioWorklet = audioCtx.audioWorklet;
audioWorklet.addModule("modules/bypassFilter.js", {
  credentials: "omit",
});

PaintWorklet

js
CSS.paintWorklet.addModule(
  "https://mdn.github.io/houdini-examples/cssPaint/intro/worklets/hilite.js",
);

paintWorklet CSS paint()

css
@supports (background-image: paint(id)) {
  h1 {
    background-image: paint(hollowHighlights, filled, 3px);
  }
}

HTML
# dom-worklet-addmodule-dev


Web Proxy Viewer  |  New URL  |  Original Page