single-file-core 1.5.56 → 1.5.57

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.
package/core/index.js CHANGED
@@ -893,7 +893,8 @@ class Processor {
893
893
  if (!this.options.saveFavicon) {
894
894
  this.doc.querySelectorAll("link[rel*=\"icon\"]").forEach(element => element.remove());
895
895
  }
896
- this.doc.querySelectorAll("a[ping]").forEach(element => element.removeAttribute("ping"));
896
+ this.doc.querySelectorAll("a[ping], area[ping]").forEach(element => element.removeAttribute("ping"));
897
+ this.doc.querySelectorAll("a[attributionsrc], img[attributionsrc], script[attributionsrc]").forEach(element => element.removeAttribute("attributionsrc"));
897
898
  this.doc.querySelectorAll("link[rel=import][href]").forEach(element => element.remove());
898
899
  }
899
900
 
@@ -247,9 +247,9 @@ function getProcessorHelperClass(utilInstance) {
247
247
 
248
248
  async processFrame(frameElement, pageData, options, resources, frameWindowId, frameData) {
249
249
  const name = "frames/" + resources.frames.size + "/";
250
- let sandbox = "allow-popups allow-top-navigation-by-user-activation";
250
+ let sandbox = "allow-popups allow-top-navigation-by-user-activation allow-scripts";
251
251
  if (pageData.content.match(NOSCRIPT_TAG_FOUND) || pageData.content.match(CANVAS_TAG_FOUND) || pageData.content.match(SCRIPT_TAG_FOUND) || options.saveRawPage) {
252
- sandbox += " allow-scripts allow-modals allow-popups allow-downloads allow-pointer-lock allow-presentation";
252
+ sandbox += " allow-modals allow-popups allow-downloads allow-pointer-lock allow-presentation";
253
253
  }
254
254
  frameElement.setAttribute("sandbox", sandbox);
255
255
  if (frameElement.tagName.toUpperCase() == "OBJECT") {
@@ -217,7 +217,7 @@ function minifyRule(ruleData, cssRule, stylesheets, processingContext, removedRu
217
217
  }
218
218
  }
219
219
 
220
- function minifyImportRule(ruleData, cssRule, stylesheets, processingContext, removedRules, docContext) {
220
+ function minifyImportRule(ruleData, _cssRule, stylesheets, processingContext, _removedRules, docContext) {
221
221
  const urlNode = ruleData.prelude.children.head.data;
222
222
  const topConditionalStack = urlNode.importedMediaText ? [{ name: "media", prelude: urlNode.importedMediaText }] : [];
223
223
  if (urlNode.importedLayerName !== undefined) {
@@ -594,8 +594,8 @@ function compareDeclarations(declarationA, declarationB, docContext) {
594
594
  }
595
595
  if (declarationA.isInline && !declarationB.isInline) return 1;
596
596
  if (!declarationA.isInline && declarationB.isInline) return -1;
597
- let selectorDataA = declarationA.selector ? docContext.selectorData.get(declarationA.selector) : null;
598
- let selectorDataB = declarationB.selector ? docContext.selectorData.get(declarationB.selector) : null;
597
+ const selectorDataA = declarationA.selector ? docContext.selectorData.get(declarationA.selector) : null;
598
+ const selectorDataB = declarationB.selector ? docContext.selectorData.get(declarationB.selector) : null;
599
599
  if (selectorDataA && selectorDataB) {
600
600
  const layerComparison = compareLayers(selectorDataA.layerStack, selectorDataB.layerStack, docContext);
601
601
  if (layerComparison !== 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.5.56",
3
+ "version": "1.5.57",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -439,7 +439,7 @@ function getFrames(document) {
439
439
  document.querySelectorAll(ALL_ELEMENTS_CSS_SELECTOR).forEach(element => {
440
440
  const shadowRoot = helper.getShadowRoot(element);
441
441
  if (shadowRoot) {
442
- frames = frames.concat(...shadowRoot.querySelectorAll(FRAMES_CSS_SELECTOR));
442
+ frames = frames.concat(...getFrames(shadowRoot));
443
443
  }
444
444
  });
445
445
  return frames;
@@ -52,12 +52,16 @@
52
52
  const BOOTSTRAP_EVENT = "single-file-bootstrap";
53
53
  const FONT_STYLE_PROPERTIES = {
54
54
  family: "font-family",
55
- style: "font-style",
56
- weight: "font-weight",
55
+ ascentOverride: "ascent-override",
56
+ descentOverride: "descent-override",
57
+ display: "font-display",
58
+ featureSettings: "font-feature-settings",
59
+ lineGapOverride: "line-gap-override",
57
60
  stretch: "font-stretch",
61
+ style: "font-style",
58
62
  unicodeRange: "unicode-range",
59
- variant: "font-variant",
60
- featureSettings: "font-feature-settings"
63
+ variationSettings: "font-variation-settings",
64
+ weight: "font-weight"
61
65
  };
62
66
 
63
67
  const fetch = globalThis.fetch.bind(globalThis);