New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@qualweb/qw-element

Package Overview
Dependencies
Maintainers
3
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qualweb/qw-element - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

1

dist/index.js

@@ -151,2 +151,3 @@ 'use strict';

selector += ' > ' + this.getSelfLocationInParent(this.element);
this.selector = selector;
return selector;

@@ -153,0 +154,0 @@ }

2

package.json
{
"name": "@qualweb/qw-element",
"version": "0.1.9",
"version": "0.1.10",
"description": "Utilities module for qualweb",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -7,3 +7,3 @@ 'use strict';

private readonly elementsCSSRules?: Map<Element, any>;
private selector:string;
private selector: string;

@@ -17,4 +17,4 @@ constructor(element: Element, elementsCSSRules?: Map<Element, any>) {

private addCSSRulesPropertyToElement(element: Element | null): void {
if (element && this.elementsCSSRules?.has(element)) {
element.setAttribute('_cssRules', JSON.stringify(this.elementsCSSRules?.get(element)));
if (element && this.elementsCSSRules ?.has(element)) {
element.setAttribute('_cssRules', JSON.stringify(this.elementsCSSRules ?.get(element)));
}

@@ -97,3 +97,3 @@ }

const clonedElem = <Element>this.element.cloneNode(true);
clonedElem.removeAttribute( "_cssRules");
clonedElem.removeAttribute("_cssRules");
if (fullElement) {

@@ -158,26 +158,27 @@ return clonedElem.outerHTML;

if(this.selector === ""){
if (this.selector === "") {
if (this.element.tagName.toLowerCase() === 'html') {
return 'html';
} else if (this.element.tagName.toLowerCase() === 'head') {
return 'html > head';
} else if (this.element.tagName.toLowerCase() === 'body') {
return 'html > body';
}
if (this.element.tagName.toLowerCase() === 'html') {
return 'html';
} else if (this.element.tagName.toLowerCase() === 'head') {
return 'html > head';
} else if (this.element.tagName.toLowerCase() === 'body') {
return 'html > body';
}
let selector = 'html > ';
const parents = new Array<string>();
let parent = this.element.parentElement;
let selector = 'html > ';
const parents = new Array<string>();
let parent = this.element.parentElement;
while (parent && parent.tagName.toLowerCase() !== 'html') {
parents.unshift(this.getSelfLocationInParent(parent));
parent = parent['parentElement'];
while (parent && parent.tagName.toLowerCase() !== 'html') {
parents.unshift(this.getSelfLocationInParent(parent));
parent = parent['parentElement'];
}
selector += parents.join(' > ');
selector += ' > ' + this.getSelfLocationInParent(this.element);
this.selector = selector;
return selector;
}
selector += parents.join(' > ');
selector += ' > ' + this.getSelfLocationInParent(this.element);
return selector;}
else{
else {
return this.selector;

@@ -299,4 +300,4 @@ }

if(this.getElementTagName() === 'iframe'){
const element = <HTMLIFrameElement> this.element;
if (this.getElementTagName() === 'iframe') {
const element = <HTMLIFrameElement>this.element;
const contentWindow = element.contentWindow;

@@ -335,3 +336,3 @@

public focusElement(): void {
const htmlElement = <HTMLElement> this.element;
const htmlElement = <HTMLElement>this.element;
htmlElement.focus();

@@ -344,3 +345,3 @@ }

public getShadowElement(selector: string): QWElement|null {
public getShadowElement(selector: string): QWElement | null {
const shadowRoot = this.element.shadowRoot;

@@ -347,0 +348,0 @@ let element: Element | null = null;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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