Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@argos-ci/browser

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@argos-ci/browser - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

5

dist/global.d.ts

@@ -0,4 +1,7 @@

type PrepareForScreenshotOptions = {
fullPage?: boolean;
};
declare const ArgosGlobal: {
waitForStability: () => boolean;
prepareForScreenshot: () => void;
prepareForScreenshot: (options?: PrepareForScreenshotOptions) => void;
getColorScheme: () => "dark" | "light";

@@ -5,0 +8,0 @@ getMediaType: () => "print" | "screen";

29

dist/global.js

@@ -46,3 +46,3 @@ (function () {

/**
*
* Inject global styles in the DOM.
*/ function injectGlobalStyles(document) {

@@ -53,7 +53,30 @@ const style = document.createElement("style");

}
const checkIsHTMLElement = (element)=>{
return "style" in element;
};
/**
* Stabilize sticky and fixed elements.
*/ function stabilizeElementPositions(document) {
const window = document.defaultView;
if (!window) return;
const elements = Array.from(document.querySelectorAll("*"));
elements.forEach((element)=>{
if (!checkIsHTMLElement(element)) return;
const style = window.getComputedStyle(element);
const position = style.position;
if (position === "fixed") {
element.style.position = "absolute";
} else if (position === "sticky") {
element.style.position = "relative";
}
});
}
/**
* Prepare the document for a screenshot.
*/ function prepareForScreenshot(document) {
*/ function prepareForScreenshot(document, { fullPage } = {}) {
injectGlobalStyles(document);
disableSpellCheck(document);
if (fullPage) {
stabilizeElementPositions(document);
}
}

@@ -110,3 +133,3 @@ /**

waitForStability: ()=>waitForStability(document),
prepareForScreenshot: ()=>prepareForScreenshot(document),
prepareForScreenshot: (options = {})=>prepareForScreenshot(document, options),
getColorScheme: ()=>getColorScheme(window),

@@ -113,0 +136,0 @@ getMediaType: ()=>getMediaType(window)

{
"name": "@argos-ci/browser",
"description": "Browser utilities to stabilize visual testing.",
"version": "1.0.0",
"version": "1.1.0",
"author": "Smooth Code",

@@ -48,3 +48,3 @@ "license": "MIT",

},
"gitHead": "f864cced9e48669efab2a35fde612570600b94a7"
"gitHead": "0cdfcea5b55b54a44228d03919168b25e5dec70f"
}
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