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

@locker/shared-dom

Package Overview
Dependencies
Maintainers
6
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@locker/shared-dom - npm Package Compare versions

Comparing version 0.12.12 to 0.12.13

134

dist/index.cjs.js

@@ -12,5 +12,5 @@ /**

const DocumentGetElementById = shared.unapply(Document.prototype.getElementById);
const DocumentHeadGetter = shared.ReflectGetOwnPropertyDescriptor(Document.prototype, 'head').get;
const DocumentHeadGetter = shared.ObjectLookupOwnGetter(Document.prototype, 'head');
const DocumentHeadGetterUtil = shared.unapply(DocumentHeadGetter);
const DocumentBodyGetter = shared.ReflectGetOwnPropertyDescriptor(Document.prototype, 'body').get;
const DocumentBodyGetter = shared.ObjectLookupOwnGetter(Document.prototype, 'body');
const DocumentBodyGetterUtil = shared.unapply(DocumentBodyGetter);

@@ -23,27 +23,23 @@ const { get: DocumentCookieGetter, set: DocumentCookieSetter } = shared.ReflectGetOwnPropertyDescriptor(Document.prototype, 'cookie');

const NodeAppendChild = shared.unapply(Node.prototype.appendChild);
const NodeNodeNameGetter = shared.ReflectGetOwnPropertyDescriptor(Node.prototype, 'nodeName').get;
const NodeChildNodesGetter = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(Node.prototype, 'childNodes').get);
const NodeNodeNameGetter = shared.ObjectLookupOwnGetter(Node.prototype, 'nodeName');
const NodeChildNodesGetter = shared.unapply(shared.ObjectLookupOwnGetter(Node.prototype, 'childNodes'));
const NodeIsEqualNode = shared.unapply(Node.prototype.isEqualNode);
const NodeTextContentSetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(Node.prototype, 'textContent').set);
const NodeTextContentSetterUtil = shared.unapply(shared.ObjectLookupOwnSetter(Node.prototype, 'textContent'));
const ElementSetAttribute = shared.ReflectGetOwnPropertyDescriptor(Element.prototype, 'setAttribute').value;
const ElementSetAttributeUtil = shared.unapply(Element.prototype.setAttribute);
const ElementSetAttributeNS = shared.ReflectGetOwnPropertyDescriptor(Element.prototype, 'setAttributeNS').value;
const ElementSetAttributeNSUtil = shared.unapply(Element.prototype.setAttributeNS);
const ElementQuerySelectorUtil = shared.unapply(Element.prototype.querySelector);
const ElementSetAttributeNodeNS = shared.ReflectGetOwnPropertyDescriptor(Element.prototype, 'setAttributeNode').value;
const ElementSetAttributeNodeNSUtil = shared.unapply(Element.prototype.setAttributeNodeNS);
const ElementSetAttributeNode = shared.ReflectGetOwnPropertyDescriptor(Element.prototype, 'setAttributeNode').value;
const ElementSetAttributeNodeUtil = shared.unapply(Element.prototype.setAttributeNode);
const ElementRemoveAttributeNodeUtil = shared.unapply(Element.prototype.removeAttributeNode);
const { attachShadow: ElementAttachShadow, setAttribute: ElementSetAttribute, setAttributeNS: ElementSetAttributeNS, setAttributeNodeNS: ElementSetAttributeNodeNS, setAttributeNode: ElementSetAttributeNode, } = Element.prototype;
const ElementAttachShadowUtil = shared.unapply(ElementAttachShadow);
const ElementAttributesGetterUtil = shared.unapply(shared.ObjectLookupOwnGetter(Element.prototype, 'attributes'));
const ElementGetAttributeNodeUtil = shared.unapply(Element.prototype.getAttributeNode);
const ElementGetAttributeNodeNSUtil = shared.unapply(Element.prototype.getAttributeNodeNS);
const ElementInnerHtmlSetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(Element.prototype, 'innerHTML').set);
const ElementAttachShadow = shared.ReflectGetOwnPropertyDescriptor(Element.prototype, 'attachShadow').value;
const ElementAttachShadowUtil = shared.unapply(Element.prototype.attachShadow);
const ElementAttributesGetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(Element.prototype, 'attributes').get);
const ElementInnerHtmlSetterUtil = shared.unapply(shared.ObjectLookupOwnSetter(Element.prototype, 'innerHTML'));
const ElementInsertAdjacentHTMLUtil = shared.unapply(Element.prototype.insertAdjacentHTML);
const ElementOuterHTMLSetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(Element.prototype, 'outerHTML').set);
const ElementOuterHTMLSetterUtil = shared.unapply(shared.ObjectLookupOwnSetter(Element.prototype, 'outerHTML'));
const ElementQuerySelectorUtil = shared.unapply(Element.prototype.querySelector);
const ElementRemoveAttributeNodeUtil = shared.unapply(Element.prototype.removeAttributeNode);
const ElementSetAttributeUtil = shared.unapply(ElementSetAttribute);
const ElementSetAttributeNodeUtil = shared.unapply(ElementSetAttributeNode);
const ElementSetAttributeNodeNSUtil = shared.unapply(ElementSetAttributeNodeNS);
const ElementSetAttributeNSUtil = shared.unapply(ElementSetAttributeNS);
const TemplateContentGetter = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(HTMLTemplateElement.prototype, 'content').get);
const TemplateContentGetter = shared.unapply(shared.ObjectLookupOwnGetter(HTMLTemplateElement.prototype, 'content'));

@@ -85,21 +81,20 @@ const { document } = window;

const AttrValueSetterUtil = shared.unapply(AttrValueSetter);
const AttrNameGetter = shared.ReflectGetOwnPropertyDescriptor(Attr.prototype, 'name').get;
const AttrNameGetter = shared.ObjectLookupOwnGetter(Attr.prototype, 'name');
const AttrNameGetterUtil = shared.unapply(AttrNameGetter);
const AttrOwnerElementGetter = shared.ReflectGetOwnPropertyDescriptor(Attr.prototype, 'ownerElement').get;
const AttrOwnerElementGetter = shared.ObjectLookupOwnGetter(Attr.prototype, 'ownerElement');
const AttrOwnerElementGetterUtil = shared.unapply(AttrOwnerElementGetter);
const AttrNamespaceURIGetter = shared.ReflectGetOwnPropertyDescriptor(Attr.prototype, 'namespaceURI').get;
const AttrNamespaceURIGetter = shared.ObjectLookupOwnGetter(Attr.prototype, 'namespaceURI');
const AttrNamespaceURIGetterUtil = shared.unapply(AttrNamespaceURIGetter);
const BlobCreate = shared.unconstruct(Blob);
const BlobTypeGetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(Blob.prototype, 'type').get);
const BlobSizeGetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(Blob.prototype, 'size').get);
const BlobSliceValueUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(Blob.prototype, 'slice').value);
const BlobCtor = Blob;
const BlobSizeGetterUtil = shared.unapply(shared.ObjectLookupOwnGetter(Blob.prototype, 'size'));
const BlobSliceValueUtil = shared.unapply(Blob.prototype.slice);
const BlobTypeGetterUtil = shared.unapply(shared.ObjectLookupOwnGetter(Blob.prototype, 'type'));
const CustomElementRegistryDefineValue = shared.ReflectGetOwnPropertyDescriptor(CustomElementRegistry.prototype, 'define').value;
const CustomElementRegistryGet = shared.ReflectGetOwnPropertyDescriptor(CustomElementRegistry.prototype, 'get').value;
const { define: CustomElementRegistryDefineValue, get: CustomElementRegistryGet, } = CustomElementRegistry.prototype;
const DocumentFragmentGetElementById = shared.unapply(DocumentFragment.prototype.getElementById);
const datasetGetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(HTMLElement.prototype, 'dataset').get);
const HTMLElementStyleGetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(HTMLElement.prototype, 'style').get);
const datasetGetterUtil = shared.unapply(shared.ObjectLookupOwnGetter(HTMLElement.prototype, 'dataset'));
const HTMLElementStyleGetterUtil = shared.unapply(shared.ObjectLookupOwnGetter(HTMLElement.prototype, 'style'));

@@ -109,12 +104,11 @@ const { get: hrefGetter, set: hrefSetter } = shared.ReflectGetOwnPropertyDescriptor(HTMLAnchorElement.prototype, 'href');

const HTMLAnchorElementHrefGetterUtil = shared.unapply(hrefGetter);
const HTMLAnchorElementHostnameGetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(HTMLAnchorElement.prototype, 'hostname').get);
const HTMLAnchorElementHostnameGetterUtil = shared.unapply(shared.ObjectLookupOwnGetter(HTMLAnchorElement.prototype, 'hostname'));
const HTMLFrameElementContentWindowGetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(HTMLFrameElement.prototype, 'contentWindow').get);
const HTMLFrameElementContentWindowGetterUtil = shared.unapply(shared.ObjectLookupOwnGetter(HTMLFrameElement.prototype, 'contentWindow'));
const HTMLIframeElementContentWindowGetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(HTMLIFrameElement.prototype, 'contentWindow').get);
const HTMLIframeElementContentWindowGetterUtil = shared.unapply(shared.ObjectLookupOwnGetter(HTMLIFrameElement.prototype, 'contentWindow'));
const HTMLLinkElementRelListSetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(HTMLLinkElement.prototype, 'relList').set);
const HTMLLinkElementRelListSetterUtil = shared.unapply(shared.ObjectLookupOwnSetter(HTMLLinkElement.prototype, 'relList'));
var _a;
const contentWindowGetter = (_a = shared.ReflectGetOwnPropertyDescriptor(HTMLObjectElement.prototype, 'contentWindow')) === null || _a === void 0 ? void 0 : _a.get;
const contentWindowGetter = shared.ObjectLookupOwnGetter(HTMLObjectElement.prototype, 'contentWindow');
const HTMLObjectElementContentWindowGetterUtil = contentWindowGetter

@@ -124,22 +118,18 @@ ? shared.unapply(contentWindowGetter)

const MessageEventSourceGetterUtil = shared.unapply(shared.ReflectGetOwnPropertyDescriptor(MessageEvent.prototype, 'source').get);
const MessageEventSourceGetterUtil = shared.unapply(shared.ObjectLookupOwnGetter(MessageEvent.prototype, 'source'));
const NamedNodeMapSetNamedItem = shared.ReflectGetOwnPropertyDescriptor(NamedNodeMap.prototype, 'setNamedItem').value;
const { setNamedItem: NamedNodeMapSetNamedItem } = NamedNodeMap.prototype;
const NamedNodeMapSetNamedItemUtil = shared.unapply(NamedNodeMapSetNamedItem);
const RangeCreateContextualFragment = shared.ReflectGetOwnPropertyDescriptor(Range.prototype, 'createContextualFragment').value;
const RangeCreateContextualFragmentUtil = shared.unapply(Range.prototype.createContextualFragment);
const { createContextualFragment: RangeCreateContextualFragment } = Range.prototype;
const RangeCreateContextualFragmentUtil = shared.unapply(RangeCreateContextualFragment);
const requestURLGetter = shared.ReflectGetOwnPropertyDescriptor(Request.prototype, 'url').get;
const requestURLGetter = shared.ObjectLookupOwnGetter(Request.prototype, 'url');
const requestURLGetterUtil = shared.unapply(requestURLGetter);
const StorageKey = shared.ReflectGetOwnPropertyDescriptor(Storage.prototype, 'key').value;
const StorageKeyUtil = shared.unapply(Storage.prototype.key);
const StorageGetItem = shared.ReflectGetOwnPropertyDescriptor(Storage.prototype, 'getItem').value;
const StorageGetItemUtil = shared.unapply(Storage.prototype.getItem);
const StorageSetItem = shared.ReflectGetOwnPropertyDescriptor(Storage.prototype, 'setItem').value;
const StorageSetItemUtil = shared.unapply(Storage.prototype.setItem);
const StorageRemoveItem = shared.ReflectGetOwnPropertyDescriptor(Storage.prototype, 'removeItem')
.value;
const StorageRemoveItemUtil = shared.unapply(Storage.prototype.removeItem);
const { key: StorageKey, getItem: StorageGetItem, removeItem: StorageRemoveItem, setItem: StorageSetItem, } = Storage.prototype;
const StorageKeyUtil = shared.unapply(StorageKey);
const StorageGetItemUtil = shared.unapply(StorageGetItem);
const StorageSetItemUtil = shared.unapply(StorageSetItem);
const StorageRemoveItemUtil = shared.unapply(StorageRemoveItem);

@@ -154,3 +144,3 @@ const { createObjectURL: URLCreateObjectURL, revokeObjectURL: URLRevokeObjectURL } = URL;

const allowlist = ['close', 'closed', 'focus', 'postMessage', 'opener', 'parent'];
const createPatchedWindow = function (rawWindow) {
const createPatchedWindow = (rawWindow) => {
const patchedWindow = {};

@@ -180,19 +170,18 @@ for (let i = 0; i < allowlist.length; i += 1) {

// prototype https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope
const { fetch: WindowFetch, open: WindowOpen } = window;
const WindowSetIntervalUtil = shared.unapply(window.setInterval);
const WindowClearIntervalUtil = shared.unapply(window.clearInterval);
const WindowFetch = shared.ReflectGetOwnPropertyDescriptor(window, 'fetch').value;
const WindowFetchUtil = shared.unapply(window.fetch);
const WindowOpenUtil = shared.unapply(window.open);
const WindowOpen = shared.ReflectGetOwnPropertyDescriptor(window, 'open').value;
const WindowFetchUtil = shared.unapply(WindowFetch);
const WindowOpenUtil = shared.unapply(WindowOpen);
const XhrCreateUtil = shared.unconstruct(XMLHttpRequest);
const XhrOpen = shared.ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'open').value;
const XhrOpenUtil = shared.unapply(XMLHttpRequest.prototype.open);
const XhrOnReadyStateChangeSetter = shared.ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'onreadystatechange').set;
const XhrReadyStateGetter = shared.ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'readyState').get;
const XhrResponseTextGetter = shared.ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'responseText').get;
const XhrSendUtil = shared.unapply(XMLHttpRequest.prototype.send);
const XhrStatusGetter = shared.ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'status')
.get;
const XhrWithCredentialsSetter = shared.ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'withCredentials').set;
const XhrCtor = XMLHttpRequest;
const XhrProto = XhrCtor.prototype;
const { open: XhrProtoOpen, send: XhrProtoSend } = XhrProto;
const XhrOpen = (xhr, requestMethod, url, async = true) => shared.ReflectApply(XhrProtoOpen, xhr, [requestMethod, url, async]);
const XhrOnReadyStateChangeSetter = shared.ObjectLookupOwnSetter(XhrProto, 'onreadystatechange');
const XhrReadyStateGetter = shared.ObjectLookupOwnGetter(XhrProto, 'readyState');
const XhrResponseTextGetter = shared.ObjectLookupOwnGetter(XhrProto, 'responseText');
const XhrSend = (xhr) => shared.ReflectApply(XhrProtoSend, xhr, shared.emptyArray);
const XhrStatusGetter = shared.ObjectLookupOwnGetter(XhrProto, 'status');
const XhrWithCredentialsSetter = shared.ObjectLookupOwnSetter(XhrProto, 'withCredentials');

@@ -209,3 +198,3 @@ exports.AttrNameGetter = AttrNameGetter;

exports.AttrValueSetterUtil = AttrValueSetterUtil;
exports.BlobCreate = BlobCreate;
exports.BlobCtor = BlobCtor;
exports.BlobSizeGetterUtil = BlobSizeGetterUtil;

@@ -278,9 +267,10 @@ exports.BlobSliceValueUtil = BlobSliceValueUtil;

exports.WindowSetIntervalUtil = WindowSetIntervalUtil;
exports.XhrCreateUtil = XhrCreateUtil;
exports.XhrCtor = XhrCtor;
exports.XhrOnReadyStateChangeSetter = XhrOnReadyStateChangeSetter;
exports.XhrOpen = XhrOpen;
exports.XhrOpenUtil = XhrOpenUtil;
exports.XhrProtoOpen = XhrProtoOpen;
exports.XhrProtoSend = XhrProtoSend;
exports.XhrReadyStateGetter = XhrReadyStateGetter;
exports.XhrResponseTextGetter = XhrResponseTextGetter;
exports.XhrSendUtil = XhrSendUtil;
exports.XhrSend = XhrSend;
exports.XhrStatusGetter = XhrStatusGetter;

@@ -293,2 +283,2 @@ exports.XhrWithCredentialsSetter = XhrWithCredentialsSetter;

exports.requestURLGetterUtil = requestURLGetterUtil;
/** version: 0.12.12 */
/** version: 0.12.13 */
/**
* Copyright (C) 2019 salesforce.com, inc.
*/
import { unapply, ReflectGetOwnPropertyDescriptor, unconstruct, ReflectSetPrototypeOf, ReflectDefineProperty, FunctionBind } from '@locker/shared';
import { unapply, ObjectLookupOwnGetter, ReflectGetOwnPropertyDescriptor, ObjectLookupOwnSetter, ReflectSetPrototypeOf, ReflectDefineProperty, FunctionBind, ReflectApply, emptyArray } from '@locker/shared';
const DocumentCreateElement = unapply(Document.prototype.createElement);
const DocumentGetElementById = unapply(Document.prototype.getElementById);
const DocumentHeadGetter = ReflectGetOwnPropertyDescriptor(Document.prototype, 'head').get;
const DocumentHeadGetter = ObjectLookupOwnGetter(Document.prototype, 'head');
const DocumentHeadGetterUtil = unapply(DocumentHeadGetter);
const DocumentBodyGetter = ReflectGetOwnPropertyDescriptor(Document.prototype, 'body').get;
const DocumentBodyGetter = ObjectLookupOwnGetter(Document.prototype, 'body');
const DocumentBodyGetterUtil = unapply(DocumentBodyGetter);

@@ -18,27 +18,23 @@ const { get: DocumentCookieGetter, set: DocumentCookieSetter } = ReflectGetOwnPropertyDescriptor(Document.prototype, 'cookie');

const NodeAppendChild = unapply(Node.prototype.appendChild);
const NodeNodeNameGetter = ReflectGetOwnPropertyDescriptor(Node.prototype, 'nodeName').get;
const NodeChildNodesGetter = unapply(ReflectGetOwnPropertyDescriptor(Node.prototype, 'childNodes').get);
const NodeNodeNameGetter = ObjectLookupOwnGetter(Node.prototype, 'nodeName');
const NodeChildNodesGetter = unapply(ObjectLookupOwnGetter(Node.prototype, 'childNodes'));
const NodeIsEqualNode = unapply(Node.prototype.isEqualNode);
const NodeTextContentSetterUtil = unapply(ReflectGetOwnPropertyDescriptor(Node.prototype, 'textContent').set);
const NodeTextContentSetterUtil = unapply(ObjectLookupOwnSetter(Node.prototype, 'textContent'));
const ElementSetAttribute = ReflectGetOwnPropertyDescriptor(Element.prototype, 'setAttribute').value;
const ElementSetAttributeUtil = unapply(Element.prototype.setAttribute);
const ElementSetAttributeNS = ReflectGetOwnPropertyDescriptor(Element.prototype, 'setAttributeNS').value;
const ElementSetAttributeNSUtil = unapply(Element.prototype.setAttributeNS);
const ElementQuerySelectorUtil = unapply(Element.prototype.querySelector);
const ElementSetAttributeNodeNS = ReflectGetOwnPropertyDescriptor(Element.prototype, 'setAttributeNode').value;
const ElementSetAttributeNodeNSUtil = unapply(Element.prototype.setAttributeNodeNS);
const ElementSetAttributeNode = ReflectGetOwnPropertyDescriptor(Element.prototype, 'setAttributeNode').value;
const ElementSetAttributeNodeUtil = unapply(Element.prototype.setAttributeNode);
const ElementRemoveAttributeNodeUtil = unapply(Element.prototype.removeAttributeNode);
const { attachShadow: ElementAttachShadow, setAttribute: ElementSetAttribute, setAttributeNS: ElementSetAttributeNS, setAttributeNodeNS: ElementSetAttributeNodeNS, setAttributeNode: ElementSetAttributeNode, } = Element.prototype;
const ElementAttachShadowUtil = unapply(ElementAttachShadow);
const ElementAttributesGetterUtil = unapply(ObjectLookupOwnGetter(Element.prototype, 'attributes'));
const ElementGetAttributeNodeUtil = unapply(Element.prototype.getAttributeNode);
const ElementGetAttributeNodeNSUtil = unapply(Element.prototype.getAttributeNodeNS);
const ElementInnerHtmlSetterUtil = unapply(ReflectGetOwnPropertyDescriptor(Element.prototype, 'innerHTML').set);
const ElementAttachShadow = ReflectGetOwnPropertyDescriptor(Element.prototype, 'attachShadow').value;
const ElementAttachShadowUtil = unapply(Element.prototype.attachShadow);
const ElementAttributesGetterUtil = unapply(ReflectGetOwnPropertyDescriptor(Element.prototype, 'attributes').get);
const ElementInnerHtmlSetterUtil = unapply(ObjectLookupOwnSetter(Element.prototype, 'innerHTML'));
const ElementInsertAdjacentHTMLUtil = unapply(Element.prototype.insertAdjacentHTML);
const ElementOuterHTMLSetterUtil = unapply(ReflectGetOwnPropertyDescriptor(Element.prototype, 'outerHTML').set);
const ElementOuterHTMLSetterUtil = unapply(ObjectLookupOwnSetter(Element.prototype, 'outerHTML'));
const ElementQuerySelectorUtil = unapply(Element.prototype.querySelector);
const ElementRemoveAttributeNodeUtil = unapply(Element.prototype.removeAttributeNode);
const ElementSetAttributeUtil = unapply(ElementSetAttribute);
const ElementSetAttributeNodeUtil = unapply(ElementSetAttributeNode);
const ElementSetAttributeNodeNSUtil = unapply(ElementSetAttributeNodeNS);
const ElementSetAttributeNSUtil = unapply(ElementSetAttributeNS);
const TemplateContentGetter = unapply(ReflectGetOwnPropertyDescriptor(HTMLTemplateElement.prototype, 'content').get);
const TemplateContentGetter = unapply(ObjectLookupOwnGetter(HTMLTemplateElement.prototype, 'content'));

@@ -80,21 +76,20 @@ const { document } = window;

const AttrValueSetterUtil = unapply(AttrValueSetter);
const AttrNameGetter = ReflectGetOwnPropertyDescriptor(Attr.prototype, 'name').get;
const AttrNameGetter = ObjectLookupOwnGetter(Attr.prototype, 'name');
const AttrNameGetterUtil = unapply(AttrNameGetter);
const AttrOwnerElementGetter = ReflectGetOwnPropertyDescriptor(Attr.prototype, 'ownerElement').get;
const AttrOwnerElementGetter = ObjectLookupOwnGetter(Attr.prototype, 'ownerElement');
const AttrOwnerElementGetterUtil = unapply(AttrOwnerElementGetter);
const AttrNamespaceURIGetter = ReflectGetOwnPropertyDescriptor(Attr.prototype, 'namespaceURI').get;
const AttrNamespaceURIGetter = ObjectLookupOwnGetter(Attr.prototype, 'namespaceURI');
const AttrNamespaceURIGetterUtil = unapply(AttrNamespaceURIGetter);
const BlobCreate = unconstruct(Blob);
const BlobTypeGetterUtil = unapply(ReflectGetOwnPropertyDescriptor(Blob.prototype, 'type').get);
const BlobSizeGetterUtil = unapply(ReflectGetOwnPropertyDescriptor(Blob.prototype, 'size').get);
const BlobSliceValueUtil = unapply(ReflectGetOwnPropertyDescriptor(Blob.prototype, 'slice').value);
const BlobCtor = Blob;
const BlobSizeGetterUtil = unapply(ObjectLookupOwnGetter(Blob.prototype, 'size'));
const BlobSliceValueUtil = unapply(Blob.prototype.slice);
const BlobTypeGetterUtil = unapply(ObjectLookupOwnGetter(Blob.prototype, 'type'));
const CustomElementRegistryDefineValue = ReflectGetOwnPropertyDescriptor(CustomElementRegistry.prototype, 'define').value;
const CustomElementRegistryGet = ReflectGetOwnPropertyDescriptor(CustomElementRegistry.prototype, 'get').value;
const { define: CustomElementRegistryDefineValue, get: CustomElementRegistryGet, } = CustomElementRegistry.prototype;
const DocumentFragmentGetElementById = unapply(DocumentFragment.prototype.getElementById);
const datasetGetterUtil = unapply(ReflectGetOwnPropertyDescriptor(HTMLElement.prototype, 'dataset').get);
const HTMLElementStyleGetterUtil = unapply(ReflectGetOwnPropertyDescriptor(HTMLElement.prototype, 'style').get);
const datasetGetterUtil = unapply(ObjectLookupOwnGetter(HTMLElement.prototype, 'dataset'));
const HTMLElementStyleGetterUtil = unapply(ObjectLookupOwnGetter(HTMLElement.prototype, 'style'));

@@ -104,12 +99,11 @@ const { get: hrefGetter, set: hrefSetter } = ReflectGetOwnPropertyDescriptor(HTMLAnchorElement.prototype, 'href');

const HTMLAnchorElementHrefGetterUtil = unapply(hrefGetter);
const HTMLAnchorElementHostnameGetterUtil = unapply(ReflectGetOwnPropertyDescriptor(HTMLAnchorElement.prototype, 'hostname').get);
const HTMLAnchorElementHostnameGetterUtil = unapply(ObjectLookupOwnGetter(HTMLAnchorElement.prototype, 'hostname'));
const HTMLFrameElementContentWindowGetterUtil = unapply(ReflectGetOwnPropertyDescriptor(HTMLFrameElement.prototype, 'contentWindow').get);
const HTMLFrameElementContentWindowGetterUtil = unapply(ObjectLookupOwnGetter(HTMLFrameElement.prototype, 'contentWindow'));
const HTMLIframeElementContentWindowGetterUtil = unapply(ReflectGetOwnPropertyDescriptor(HTMLIFrameElement.prototype, 'contentWindow').get);
const HTMLIframeElementContentWindowGetterUtil = unapply(ObjectLookupOwnGetter(HTMLIFrameElement.prototype, 'contentWindow'));
const HTMLLinkElementRelListSetterUtil = unapply(ReflectGetOwnPropertyDescriptor(HTMLLinkElement.prototype, 'relList').set);
const HTMLLinkElementRelListSetterUtil = unapply(ObjectLookupOwnSetter(HTMLLinkElement.prototype, 'relList'));
var _a;
const contentWindowGetter = (_a = ReflectGetOwnPropertyDescriptor(HTMLObjectElement.prototype, 'contentWindow')) === null || _a === void 0 ? void 0 : _a.get;
const contentWindowGetter = ObjectLookupOwnGetter(HTMLObjectElement.prototype, 'contentWindow');
const HTMLObjectElementContentWindowGetterUtil = contentWindowGetter

@@ -119,22 +113,18 @@ ? unapply(contentWindowGetter)

const MessageEventSourceGetterUtil = unapply(ReflectGetOwnPropertyDescriptor(MessageEvent.prototype, 'source').get);
const MessageEventSourceGetterUtil = unapply(ObjectLookupOwnGetter(MessageEvent.prototype, 'source'));
const NamedNodeMapSetNamedItem = ReflectGetOwnPropertyDescriptor(NamedNodeMap.prototype, 'setNamedItem').value;
const { setNamedItem: NamedNodeMapSetNamedItem } = NamedNodeMap.prototype;
const NamedNodeMapSetNamedItemUtil = unapply(NamedNodeMapSetNamedItem);
const RangeCreateContextualFragment = ReflectGetOwnPropertyDescriptor(Range.prototype, 'createContextualFragment').value;
const RangeCreateContextualFragmentUtil = unapply(Range.prototype.createContextualFragment);
const { createContextualFragment: RangeCreateContextualFragment } = Range.prototype;
const RangeCreateContextualFragmentUtil = unapply(RangeCreateContextualFragment);
const requestURLGetter = ReflectGetOwnPropertyDescriptor(Request.prototype, 'url').get;
const requestURLGetter = ObjectLookupOwnGetter(Request.prototype, 'url');
const requestURLGetterUtil = unapply(requestURLGetter);
const StorageKey = ReflectGetOwnPropertyDescriptor(Storage.prototype, 'key').value;
const StorageKeyUtil = unapply(Storage.prototype.key);
const StorageGetItem = ReflectGetOwnPropertyDescriptor(Storage.prototype, 'getItem').value;
const StorageGetItemUtil = unapply(Storage.prototype.getItem);
const StorageSetItem = ReflectGetOwnPropertyDescriptor(Storage.prototype, 'setItem').value;
const StorageSetItemUtil = unapply(Storage.prototype.setItem);
const StorageRemoveItem = ReflectGetOwnPropertyDescriptor(Storage.prototype, 'removeItem')
.value;
const StorageRemoveItemUtil = unapply(Storage.prototype.removeItem);
const { key: StorageKey, getItem: StorageGetItem, removeItem: StorageRemoveItem, setItem: StorageSetItem, } = Storage.prototype;
const StorageKeyUtil = unapply(StorageKey);
const StorageGetItemUtil = unapply(StorageGetItem);
const StorageSetItemUtil = unapply(StorageSetItem);
const StorageRemoveItemUtil = unapply(StorageRemoveItem);

@@ -149,3 +139,3 @@ const { createObjectURL: URLCreateObjectURL, revokeObjectURL: URLRevokeObjectURL } = URL;

const allowlist = ['close', 'closed', 'focus', 'postMessage', 'opener', 'parent'];
const createPatchedWindow = function (rawWindow) {
const createPatchedWindow = (rawWindow) => {
const patchedWindow = {};

@@ -175,21 +165,20 @@ for (let i = 0; i < allowlist.length; i += 1) {

// prototype https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope
const { fetch: WindowFetch, open: WindowOpen } = window;
const WindowSetIntervalUtil = unapply(window.setInterval);
const WindowClearIntervalUtil = unapply(window.clearInterval);
const WindowFetch = ReflectGetOwnPropertyDescriptor(window, 'fetch').value;
const WindowFetchUtil = unapply(window.fetch);
const WindowOpenUtil = unapply(window.open);
const WindowOpen = ReflectGetOwnPropertyDescriptor(window, 'open').value;
const WindowFetchUtil = unapply(WindowFetch);
const WindowOpenUtil = unapply(WindowOpen);
const XhrCreateUtil = unconstruct(XMLHttpRequest);
const XhrOpen = ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'open').value;
const XhrOpenUtil = unapply(XMLHttpRequest.prototype.open);
const XhrOnReadyStateChangeSetter = ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'onreadystatechange').set;
const XhrReadyStateGetter = ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'readyState').get;
const XhrResponseTextGetter = ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'responseText').get;
const XhrSendUtil = unapply(XMLHttpRequest.prototype.send);
const XhrStatusGetter = ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'status')
.get;
const XhrWithCredentialsSetter = ReflectGetOwnPropertyDescriptor(XMLHttpRequest.prototype, 'withCredentials').set;
const XhrCtor = XMLHttpRequest;
const XhrProto = XhrCtor.prototype;
const { open: XhrProtoOpen, send: XhrProtoSend } = XhrProto;
const XhrOpen = (xhr, requestMethod, url, async = true) => ReflectApply(XhrProtoOpen, xhr, [requestMethod, url, async]);
const XhrOnReadyStateChangeSetter = ObjectLookupOwnSetter(XhrProto, 'onreadystatechange');
const XhrReadyStateGetter = ObjectLookupOwnGetter(XhrProto, 'readyState');
const XhrResponseTextGetter = ObjectLookupOwnGetter(XhrProto, 'responseText');
const XhrSend = (xhr) => ReflectApply(XhrProtoSend, xhr, emptyArray);
const XhrStatusGetter = ObjectLookupOwnGetter(XhrProto, 'status');
const XhrWithCredentialsSetter = ObjectLookupOwnSetter(XhrProto, 'withCredentials');
export { AttrNameGetter, AttrNameGetterUtil, AttrNamespaceURIGetter, AttrNamespaceURIGetterUtil, AttrOwnerElementGetter, AttrOwnerElementGetterUtil, AttrValueGetter, AttrValueGetterUtil, AttrValueSetter, AttrValueSetterUtil, BlobCreate, BlobSizeGetterUtil, BlobSliceValueUtil, BlobTypeGetterUtil, CustomElementRegistryDefineValue, CustomElementRegistryGet, DocumentBodyGetter, DocumentBodyGetterUtil, DocumentCookieGetterUtil, DocumentCookieSetterUtil, DocumentCreateElement, DocumentExecCommandUtil, DocumentFragmentGetElementById, DocumentGetElementById, DocumentHeadGetter, DocumentHeadGetterUtil, ElementAttachShadow, ElementAttachShadowUtil, ElementAttributesGetterUtil, ElementGetAttributeNodeNSUtil, ElementGetAttributeNodeUtil, ElementInnerHtmlSetterUtil, ElementInsertAdjacentHTMLUtil, ElementOuterHTMLSetterUtil, ElementQuerySelectorUtil, ElementRemoveAttributeNodeUtil, ElementSetAttribute, ElementSetAttributeNS, ElementSetAttributeNSUtil, ElementSetAttributeNode, ElementSetAttributeNodeNS, ElementSetAttributeNodeNSUtil, ElementSetAttributeNodeUtil, ElementSetAttributeUtil, HTMLAnchorElementHostnameGetterUtil, HTMLAnchorElementHrefGetterUtil, HTMLAnchorElementHrefSetterUtil, HTMLElementStyleGetterUtil, HTMLFrameElementContentWindowGetterUtil, HTMLIframeElementContentWindowGetterUtil, HTMLLinkElementRelListSetterUtil, HTMLObjectElementContentWindowGetterUtil, MessageEventSourceGetterUtil, NamedNodeMapSetNamedItem, NamedNodeMapSetNamedItemUtil, NodeAppendChild, NodeChildNodesGetter, NodeIsEqualNode, NodeNodeNameGetter, NodeTextContentSetterUtil, RangeCreateContextualFragment, RangeCreateContextualFragmentUtil, StorageGetItem, StorageGetItemUtil, StorageKey, StorageKeyUtil, StorageRemoveItem, StorageRemoveItemUtil, StorageSetItem, StorageSetItemUtil, URLCreateObjectURL, URLRevokeObjectURL, WindowClearIntervalUtil, WindowFetch, WindowFetchUtil, WindowOpen, WindowOpenUtil, WindowSetIntervalUtil, XhrCreateUtil, XhrOnReadyStateChangeSetter, XhrOpen, XhrOpenUtil, XhrReadyStateGetter, XhrResponseTextGetter, XhrSendUtil, XhrStatusGetter, XhrWithCredentialsSetter, createPatchedWindow, datasetGetterUtil, isEqualDomString, isSharedElement, requestURLGetterUtil };
/** version: 0.12.12 */
export { AttrNameGetter, AttrNameGetterUtil, AttrNamespaceURIGetter, AttrNamespaceURIGetterUtil, AttrOwnerElementGetter, AttrOwnerElementGetterUtil, AttrValueGetter, AttrValueGetterUtil, AttrValueSetter, AttrValueSetterUtil, BlobCtor, BlobSizeGetterUtil, BlobSliceValueUtil, BlobTypeGetterUtil, CustomElementRegistryDefineValue, CustomElementRegistryGet, DocumentBodyGetter, DocumentBodyGetterUtil, DocumentCookieGetterUtil, DocumentCookieSetterUtil, DocumentCreateElement, DocumentExecCommandUtil, DocumentFragmentGetElementById, DocumentGetElementById, DocumentHeadGetter, DocumentHeadGetterUtil, ElementAttachShadow, ElementAttachShadowUtil, ElementAttributesGetterUtil, ElementGetAttributeNodeNSUtil, ElementGetAttributeNodeUtil, ElementInnerHtmlSetterUtil, ElementInsertAdjacentHTMLUtil, ElementOuterHTMLSetterUtil, ElementQuerySelectorUtil, ElementRemoveAttributeNodeUtil, ElementSetAttribute, ElementSetAttributeNS, ElementSetAttributeNSUtil, ElementSetAttributeNode, ElementSetAttributeNodeNS, ElementSetAttributeNodeNSUtil, ElementSetAttributeNodeUtil, ElementSetAttributeUtil, HTMLAnchorElementHostnameGetterUtil, HTMLAnchorElementHrefGetterUtil, HTMLAnchorElementHrefSetterUtil, HTMLElementStyleGetterUtil, HTMLFrameElementContentWindowGetterUtil, HTMLIframeElementContentWindowGetterUtil, HTMLLinkElementRelListSetterUtil, HTMLObjectElementContentWindowGetterUtil, MessageEventSourceGetterUtil, NamedNodeMapSetNamedItem, NamedNodeMapSetNamedItemUtil, NodeAppendChild, NodeChildNodesGetter, NodeIsEqualNode, NodeNodeNameGetter, NodeTextContentSetterUtil, RangeCreateContextualFragment, RangeCreateContextualFragmentUtil, StorageGetItem, StorageGetItemUtil, StorageKey, StorageKeyUtil, StorageRemoveItem, StorageRemoveItemUtil, StorageSetItem, StorageSetItemUtil, URLCreateObjectURL, URLRevokeObjectURL, WindowClearIntervalUtil, WindowFetch, WindowFetchUtil, WindowOpen, WindowOpenUtil, WindowSetIntervalUtil, XhrCtor, XhrOnReadyStateChangeSetter, XhrOpen, XhrProtoOpen, XhrProtoSend, XhrReadyStateGetter, XhrResponseTextGetter, XhrSend, XhrStatusGetter, XhrWithCredentialsSetter, createPatchedWindow, datasetGetterUtil, isEqualDomString, isSharedElement, requestURLGetterUtil };
/** version: 0.12.13 */
{
"name": "@locker/shared-dom",
"version": "0.12.12",
"version": "0.12.13",
"license": "Salesforce Developer Agreement",

@@ -22,5 +22,5 @@ "author": "Salesforce UI Security Team",

"dependencies": {
"@locker/shared": "0.12.12"
"@locker/shared": "0.12.13"
},
"gitHead": "70462b15cdef106c1a55b77e5c48d3a023004f0b"
"gitHead": "773c88ecf9df8aae0fb438aba23605f10950dff0"
}

@@ -5,8 +5,8 @@ export declare const AttrValueGetter: () => any;

export declare const AttrValueSetterUtil: Function;
export declare const AttrNameGetter: () => any;
export declare const AttrNameGetter: Function;
export declare const AttrNameGetterUtil: Function;
export declare const AttrOwnerElementGetter: () => any;
export declare const AttrOwnerElementGetter: Function;
export declare const AttrOwnerElementGetterUtil: Function;
export declare const AttrNamespaceURIGetter: () => any;
export declare const AttrNamespaceURIGetter: Function;
export declare const AttrNamespaceURIGetterUtil: Function;
//# sourceMappingURL=Attr.d.ts.map

@@ -1,5 +0,8 @@

export declare const BlobCreate: Function;
export declare const BlobTypeGetterUtil: Function;
export declare const BlobCtor: {
new (blobParts?: BlobPart[] | undefined, options?: BlobPropertyBag | undefined): Blob;
prototype: Blob;
};
export declare const BlobSizeGetterUtil: Function;
export declare const BlobSliceValueUtil: Function;
export declare const BlobTypeGetterUtil: Function;
//# sourceMappingURL=Blob.d.ts.map

@@ -1,3 +0,2 @@

export declare const CustomElementRegistryDefineValue: any;
export declare const CustomElementRegistryGet: any;
export declare const CustomElementRegistryDefineValue: (name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions | undefined) => void, CustomElementRegistryGet: (name: string) => any;
//# sourceMappingURL=CustomElementRegistry.d.ts.map
export declare const DocumentCreateElement: Function;
export declare const DocumentGetElementById: Function;
export declare const DocumentHeadGetter: () => any;
export declare const DocumentHeadGetter: Function;
export declare const DocumentHeadGetterUtil: Function;
export declare const DocumentBodyGetter: () => any;
export declare const DocumentBodyGetter: Function;
export declare const DocumentBodyGetterUtil: Function;

@@ -7,0 +7,0 @@ export declare const DocumentCookieGetterUtil: Function;

@@ -1,19 +0,15 @@

export declare const ElementSetAttribute: any;
export declare const ElementSetAttributeUtil: Function;
export declare const ElementSetAttributeNS: any;
export declare const ElementSetAttributeNSUtil: Function;
export declare const ElementQuerySelectorUtil: Function;
export declare const ElementSetAttributeNodeNS: any;
export declare const ElementSetAttributeNodeNSUtil: Function;
export declare const ElementSetAttributeNode: any;
export declare const ElementSetAttributeNodeUtil: Function;
export declare const ElementRemoveAttributeNodeUtil: Function;
export declare const ElementAttachShadow: (init: ShadowRootInit) => ShadowRoot, ElementSetAttribute: (qualifiedName: string, value: string) => void, ElementSetAttributeNS: (namespace: string | null, qualifiedName: string, value: string) => void, ElementSetAttributeNodeNS: (attr: Attr) => Attr | null, ElementSetAttributeNode: (attr: Attr) => Attr | null;
export declare const ElementAttachShadowUtil: Function;
export declare const ElementAttributesGetterUtil: Function;
export declare const ElementGetAttributeNodeUtil: Function;
export declare const ElementGetAttributeNodeNSUtil: Function;
export declare const ElementInnerHtmlSetterUtil: Function;
export declare const ElementAttachShadow: any;
export declare const ElementAttachShadowUtil: Function;
export declare const ElementAttributesGetterUtil: Function;
export declare const ElementInsertAdjacentHTMLUtil: Function;
export declare const ElementOuterHTMLSetterUtil: Function;
export declare const ElementQuerySelectorUtil: Function;
export declare const ElementRemoveAttributeNodeUtil: Function;
export declare const ElementSetAttributeUtil: Function;
export declare const ElementSetAttributeNodeUtil: Function;
export declare const ElementSetAttributeNodeNSUtil: Function;
export declare const ElementSetAttributeNSUtil: Function;
//# sourceMappingURL=Element.d.ts.map

@@ -1,3 +0,3 @@

export declare const NamedNodeMapSetNamedItem: any;
export declare const NamedNodeMapSetNamedItem: (attr: Attr) => Attr | null;
export declare const NamedNodeMapSetNamedItemUtil: Function;
//# sourceMappingURL=NamedNodeMap.d.ts.map
export declare const NodeAppendChild: Function;
export declare const NodeNodeNameGetter: () => any;
export declare const NodeNodeNameGetter: Function;
export declare const NodeChildNodesGetter: Function;

@@ -4,0 +4,0 @@ export declare const NodeIsEqualNode: Function;

@@ -1,3 +0,3 @@

export declare const RangeCreateContextualFragment: any;
export declare const RangeCreateContextualFragment: (fragment: string) => DocumentFragment;
export declare const RangeCreateContextualFragmentUtil: Function;
//# sourceMappingURL=Range.d.ts.map

@@ -1,9 +0,6 @@

export declare const StorageKey: any;
export declare const StorageKey: (index: number) => string | null, StorageGetItem: (key: string) => string | null, StorageRemoveItem: (key: string) => void, StorageSetItem: (key: string, value: string) => void;
export declare const StorageKeyUtil: Function;
export declare const StorageGetItem: any;
export declare const StorageGetItemUtil: Function;
export declare const StorageSetItem: any;
export declare const StorageSetItemUtil: Function;
export declare const StorageRemoveItem: any;
export declare const StorageRemoveItemUtil: Function;
//# sourceMappingURL=Storage.d.ts.map
export declare const createPatchedWindow: (rawWindow: WindowProxy) => Window | null;
export declare const WindowFetch: ((input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>) & typeof fetch, WindowOpen: ((url?: string | undefined, target?: string | undefined, features?: string | undefined, replace?: boolean | undefined) => Window | null) & typeof open;
export declare const WindowSetIntervalUtil: Function;
export declare const WindowClearIntervalUtil: Function;
export declare const WindowFetch: any;
export declare const WindowFetchUtil: Function;
export declare const WindowOpenUtil: Function;
export declare const WindowOpen: any;
//# sourceMappingURL=Window.d.ts.map

@@ -1,10 +0,21 @@

export declare const XhrCreateUtil: Function;
export declare const XhrOpen: any;
export declare const XhrOpenUtil: Function;
export declare const XhrOnReadyStateChangeSetter: (v: any) => void;
export declare const XhrReadyStateGetter: () => any;
export declare const XhrResponseTextGetter: () => any;
export declare const XhrSendUtil: Function;
export declare const XhrStatusGetter: () => any;
export declare const XhrWithCredentialsSetter: (v: any) => void;
export declare const XhrCtor: {
new (): XMLHttpRequest;
prototype: XMLHttpRequest;
readonly DONE: number;
readonly HEADERS_RECEIVED: number;
readonly LOADING: number;
readonly OPENED: number;
readonly UNSENT: number;
};
export declare const XhrProtoOpen: {
(method: string, url: string): void;
(method: string, url: string, async: boolean, username?: string | null | undefined, password?: string | null | undefined): void;
}, XhrProtoSend: (body?: string | ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | ReadableStream<Uint8Array> | Document | null | undefined) => void;
export declare const XhrOpen: (xhr: XMLHttpRequest, requestMethod: string, url: string, async?: boolean) => any;
export declare const XhrOnReadyStateChangeSetter: Function;
export declare const XhrReadyStateGetter: Function;
export declare const XhrResponseTextGetter: Function;
export declare const XhrSend: (xhr: XMLHttpRequest) => any;
export declare const XhrStatusGetter: Function;
export declare const XhrWithCredentialsSetter: Function;
//# sourceMappingURL=XMLHttpRequest.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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