single-file-core 1.5.27 → 1.5.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,6 +129,9 @@ function getProcessorHelperClass(utilInstance) {
129
129
  styleElement.textContent = this.generateStylesheetContent(stylesheetInfo.stylesheet, options);
130
130
  } else {
131
131
  const linkElement = linkElements.get(stylesheetRefIndex).cloneNode(true);
132
+ if (stylesheetInfo.mediaText) {
133
+ linkElement.media = stylesheetInfo.mediaText;
134
+ }
132
135
  styleElement.replaceWith(linkElement);
133
136
  key.element = linkElement;
134
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.5.27",
3
+ "version": "1.5.28",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -151,8 +151,12 @@
151
151
  });
152
152
  document.addEventListener(GET_ADOPTED_STYLESHEETS_REQUEST_EVENT, getAdoptedStylesheetsListener);
153
153
  document.addEventListener(BOOTSTRAP_EVENT, event => {
154
- if (globalThis.bootstrap && event.detail.data) {
155
- globalThis.bootstrap(event.detail.data);
154
+ try {
155
+ if (globalThis.bootstrap && event.detail.data) {
156
+ globalThis.bootstrap(event.detail.data);
157
+ }
158
+ } catch (error) {
159
+ // ignored
156
160
  }
157
161
  });
158
162
  }