Switch to using `<link>` elements for stylesheets in shadow DOM
When Shadow DOM was first considered for use in the client `<link rel="stylesheet">` was not widely supported as a way to load external styles into shadow roots. This was resolved in the spec in https://github.com/whatwg/html/pull/1572 and has now long been supported by all browsers. Using `<link>` simplifies the code and also avoids a possible problem with sites that have a strict CSP policy that disallows inline styles. In the browser extension context a `<link>` can still work in that scenario as long as the stylesheet is loaded from a `chrome-extension://` URL.
Showing
Please register or sign in to comment