Socket
Socket
Sign inDemoInstall

@percy/dom

Package Overview
Dependencies
Maintainers
1
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/dom - npm Package Compare versions

Comparing version 1.28.4-beta.1 to 1.28.4

45

dist/bundle.js

@@ -58,2 +58,3 @@ (function() {

function setBaseURI(dom) {
var _dom$querySelector;
/* istanbul ignore if: sanity check */

@@ -63,3 +64,3 @@ if (!new URL(dom.baseURI).hostname) return;

$base.href = dom.baseURI;
dom.querySelector('head').prepend($base);
(_dom$querySelector = dom.querySelector('head')) === null || _dom$querySelector === void 0 ? void 0 : _dom$querySelector.prepend($base);
}

@@ -504,41 +505,2 @@

// we inject declarative shadow dom polyfill to allow shadow dom to load in non chromium infrastructure browsers
// Since only chromium currently supports declarative shadow DOM - https://caniuse.com/declarative-shadow-dom
function injectDeclarativeShadowDOMPolyfill(ctx) {
let clone = ctx.clone;
let scriptEl = document.createElement('script');
scriptEl.setAttribute('id', '__percy_shadowdom_helper');
scriptEl.setAttribute('data-percy-injected', true);
scriptEl.innerHTML = `
function attachShadow(template, mode){
const shadowRoot = template.parentNode.attachShadow({ mode });
shadowRoot.appendChild(template.content);
template.remove();
}
function reversePolyFill(root=document){
root.querySelectorAll('template[shadowroot]').forEach(template => {
const mode = template.getAttribute('shadowroot');
attachShadow(template, mode);
});
root.querySelectorAll('template[shadowrootmode]').forEach(template => {
const mode = template.getAttribute('shadowrootmode');
attachShadow(template, mode);
});
root.querySelectorAll('[data-percy-shadow-host]').forEach(shadowHost => reversePolyFill(shadowHost.shadowRoot));
}
if (["interactive", "complete"].includes(document.readyState)) {
reversePolyFill();
} else {
document.addEventListener("DOMContentLoaded", () => reversePolyFill());
}
`.replace(/(\n|\s{2}|\t)/g, '');
// run polyfill as first thing post dom content is loaded
clone.head.prepend(scriptEl);
}
// Returns a copy or new doctype for a document.

@@ -628,5 +590,2 @@ function doctype(dom) {

}
if (!disableShadowDOM) {
injectDeclarativeShadowDOMPolyfill(ctx);
}
if (reshuffleInvalidTags) {

@@ -633,0 +592,0 @@ let clonedBody = ctx.clone.body;

6

package.json
{
"name": "@percy/dom",
"version": "1.28.4-beta.1",
"version": "1.28.4",
"license": "MIT",

@@ -12,3 +12,3 @@ "repository": {

"access": "public",
"tag": "beta"
"tag": "latest"
},

@@ -39,3 +39,3 @@ "main": "dist/bundle.js",

},
"gitHead": "6f2c2bdf17f844b1add5f0c675163573893d301e"
"gitHead": "00ab37414a739e50b28c054da4301f9a7718e880"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc