@shgysk8zer0/polyfills 0.1.2 → 0.2.1
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/CHANGELOG.md +12 -0
- package/all.min.js +1 -1
- package/all.min.js.map +1 -1
- package/assets/sanitizerUtils.js +1 -1
- package/package.json +18 -8
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [v0.2.1] - 2023-07-05
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- `el.setHTML()` now replaces rather than appends
|
|
13
|
+
|
|
14
|
+
## [v0.2.0] - 2023-07-03
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Update to node 20
|
|
18
|
+
- Update GH Action for npm publish
|
|
19
|
+
- Update npm scripts for versioning and locks
|
|
20
|
+
|
|
9
21
|
## [v0.1.2] - 2023-06-19
|
|
10
22
|
|
|
11
23
|
### Fixed
|
package/all.min.js
CHANGED
|
@@ -36,7 +36,7 @@ const H=Object.keys(Object.getOwnPropertyDescriptors(HTMLElement.prototype)).fil
|
|
|
36
36
|
* @copyright 2023 Chris Zuber <admin@kernvalley.us>
|
|
37
37
|
* @see https://wicg.github.io/sanitizer-api/#default-configuration-dictionary
|
|
38
38
|
*/
|
|
39
|
-
const oe=JSON.parse('{\n "allowCustomElements": false,\n "allowUnknownMarkup": false,\n "allowElements": [\n "a",\n "abbr",\n "acronym",\n "address",\n "area",\n "article",\n "aside",\n "audio",\n "b",\n "bdi",\n "bdo",\n "bgsound",\n "big",\n "blockquote",\n "body",\n "br",\n "button",\n "canvas",\n "caption",\n "center",\n "cite",\n "code",\n "col",\n "colgroup",\n "datalist",\n "dd",\n "del",\n "details",\n "dfn",\n "dialog",\n "dir",\n "div",\n "dl",\n "dt",\n "em",\n "fieldset",\n "figcaption",\n "figure",\n "font",\n "footer",\n "form",\n "h1",\n "h2",\n "h3",\n "h4",\n "h5",\n "h6",\n "head",\n "header",\n "hgroup",\n "hr",\n "html",\n "i",\n "img",\n "input",\n "ins",\n "kbd",\n "keygen",\n "label",\n "layer",\n "legend",\n "li",\n "link",\n "listing",\n "main",\n "map",\n "mark",\n "marquee",\n "menu",\n "meta",\n "meter",\n "nav",\n "nobr",\n "ol",\n "optgroup",\n "option",\n "output",\n "p",\n "picture",\n "popup",\n "pre",\n "progress",\n "q",\n "rb",\n "rp",\n "rt",\n "rtc",\n "ruby",\n "s",\n "samp",\n "section",\n "select",\n "selectmenu",\n "small",\n "source",\n "span",\n "strike",\n "strong",\n "style",\n "sub",\n "summary",\n "sup",\n "table",\n "tbody",\n "td",\n "tfoot",\n "th",\n "thead",\n "time",\n "tr",\n "track",\n "tt",\n "u",\n "ul",\n "var",\n "video",\n "wbr"\n ],\n "allowAttributes": {\n "abbr": [\n "*"\n ],\n "accept": [\n "*"\n ],\n "accept-charset": [\n "*"\n ],\n "accesskey": [\n "*"\n ],\n "action": [\n "*"\n ],\n "align": [\n "*"\n ],\n "alink": [\n "*"\n ],\n "allow": [\n "*"\n ],\n "allowfullscreen": [\n "*"\n ],\n "alt": [\n "*"\n ],\n "anchor": [\n "*"\n ],\n "archive": [\n "*"\n ],\n "as": [\n "*"\n ],\n "async": [\n "*"\n ],\n "autocapitalize": [\n "*"\n ],\n "autocomplete": [\n "*"\n ],\n "autocorrect": [\n "*"\n ],\n "autofocus": [\n "*"\n ],\n "autopictureinpicture": [\n "*"\n ],\n "autoplay": [\n "*"\n ],\n "axis": [\n "*"\n ],\n "background": [\n "*"\n ],\n "behavior": [\n "*"\n ],\n "bgcolor": [\n "*"\n ],\n "border": [\n "*"\n ],\n "bordercolor": [\n "*"\n ],\n "capture": [\n "*"\n ],\n "cellpadding": [\n "*"\n ],\n "cellspacing": [\n "*"\n ],\n "challenge": [\n "*"\n ],\n "char": [\n "*"\n ],\n "charoff": [\n "*"\n ],\n "charset": [\n "*"\n ],\n "checked": [\n "*"\n ],\n "cite": [\n "*"\n ],\n "class": [\n "*"\n ],\n "classid": [\n "*"\n ],\n "clear": [\n "*"\n ],\n "code": [\n "*"\n ],\n "codebase": [\n "*"\n ],\n "codetype": [\n "*"\n ],\n "color": [\n "*"\n ],\n "cols": [\n "*"\n ],\n "colspan": [\n "*"\n ],\n "compact": [\n "*"\n ],\n "content": [\n "*"\n ],\n "contenteditable": [\n "*"\n ],\n "controls": [\n "*"\n ],\n "controlslist": [\n "*"\n ],\n "conversiondestination": [\n "*"\n ],\n "coords": [\n "*"\n ],\n "crossorigin": [\n "*"\n ],\n "csp": [\n "*"\n ],\n "data": [\n "*"\n ],\n "datetime": [\n "*"\n ],\n "declare": [\n "*"\n ],\n "decoding": [\n "*"\n ],\n "default": [\n "*"\n ],\n "defer": [\n "*"\n ],\n "dir": [\n "*"\n ],\n "direction": [\n "*"\n ],\n "dirname": [\n "*"\n ],\n "disabled": [\n "*"\n ],\n "disablepictureinpicture": [\n "*"\n ],\n "disableremoteplayback": [\n "*"\n ],\n "disallowdocumentaccess": [\n "*"\n ],\n "download": [\n "*"\n ],\n "draggable": [\n "*"\n ],\n "elementtiming": [\n "*"\n ],\n "enctype": [\n "*"\n ],\n "end": [\n "*"\n ],\n "enterkeyhint": [\n "*"\n ],\n "event": [\n "*"\n ],\n "exportparts": [\n "*"\n ],\n "face": [\n "*"\n ],\n "for": [\n "*"\n ],\n "form": [\n "*"\n ],\n "formaction": [\n "*"\n ],\n "formenctype": [\n "*"\n ],\n "formmethod": [\n "*"\n ],\n "formnovalidate": [\n "*"\n ],\n "formtarget": [\n "*"\n ],\n "frame": [\n "*"\n ],\n "frameborder": [\n "*"\n ],\n "headers": [\n "*"\n ],\n "height": [\n "*"\n ],\n "hidden": [\n "*"\n ],\n "high": [\n "*"\n ],\n "href": [\n "*"\n ],\n "hreflang": [\n "*"\n ],\n "hreftranslate": [\n "*"\n ],\n "hspace": [\n "*"\n ],\n "http-equiv": [\n "*"\n ],\n "id": [\n "*"\n ],\n "imagesizes": [\n "*"\n ],\n "imagesrcset": [\n "*"\n ],\n "importance": [\n "*"\n ],\n "impressiondata": [\n "*"\n ],\n "impressionexpiry": [\n "*"\n ],\n "incremental": [\n "*"\n ],\n "inert": [\n "*"\n ],\n "inputmode": [\n "*"\n ],\n "integrity": [\n "*"\n ],\n "invisible": [\n "*"\n ],\n "is": [\n "*"\n ],\n "ismap": [\n "*"\n ],\n "keytype": [\n "*"\n ],\n "kind": [\n "*"\n ],\n "label": [\n "*"\n ],\n "lang": [\n "*"\n ],\n "language": [\n "*"\n ],\n "latencyhint": [\n "*"\n ],\n "leftmargin": [\n "*"\n ],\n "link": [\n "*"\n ],\n "list": [\n "*"\n ],\n "loading": [\n "*"\n ],\n "longdesc": [\n "*"\n ],\n "loop": [\n "*"\n ],\n "low": [\n "*"\n ],\n "lowsrc": [\n "*"\n ],\n "manifest": [\n "*"\n ],\n "marginheight": [\n "*"\n ],\n "marginwidth": [\n "*"\n ],\n "max": [\n "*"\n ],\n "maxlength": [\n "*"\n ],\n "mayscript": [\n "*"\n ],\n "media": [\n "*"\n ],\n "method": [\n "*"\n ],\n "min": [\n "*"\n ],\n "minlength": [\n "*"\n ],\n "multiple": [\n "*"\n ],\n "muted": [\n "*"\n ],\n "name": [\n "*"\n ],\n "nohref": [\n "*"\n ],\n "nomodule": [\n "*"\n ],\n "nonce": [\n "*"\n ],\n "noresize": [\n "*"\n ],\n "noshade": [\n "*"\n ],\n "novalidate": [\n "*"\n ],\n "nowrap": [\n "*"\n ],\n "object": [\n "*"\n ],\n "open": [\n "*"\n ],\n "optimum": [\n "*"\n ],\n "part": [\n "*"\n ],\n "pattern": [\n "*"\n ],\n "ping": [\n "*"\n ],\n "placeholder": [\n "*"\n ],\n "playsinline": [\n "*"\n ],\n "policy": [\n "*"\n ],\n "poster": [\n "*"\n ],\n "preload": [\n "*"\n ],\n "pseudo": [\n "*"\n ],\n "readonly": [\n "*"\n ],\n "referrerpolicy": [\n "*"\n ],\n "rel": [\n "*"\n ],\n "reportingorigin": [\n "*"\n ],\n "required": [\n "*"\n ],\n "resources": [\n "*"\n ],\n "rev": [\n "*"\n ],\n "reversed": [\n "*"\n ],\n "role": [\n "*"\n ],\n "rows": [\n "*"\n ],\n "rowspan": [\n "*"\n ],\n "rules": [\n "*"\n ],\n "sandbox": [\n "*"\n ],\n "scheme": [\n "*"\n ],\n "scope": [\n "*"\n ],\n "scopes": [\n "*"\n ],\n "scrollamount": [\n "*"\n ],\n "scrolldelay": [\n "*"\n ],\n "scrolling": [\n "*"\n ],\n "select": [\n "*"\n ],\n "selected": [\n "*"\n ],\n "shadowroot": [\n "*"\n ],\n "shadowrootdelegatesfocus": [\n "*"\n ],\n "shape": [\n "*"\n ],\n "size": [\n "*"\n ],\n "sizes": [\n "*"\n ],\n "slot": [\n "*"\n ],\n "span": [\n "*"\n ],\n "spellcheck": [\n "*"\n ],\n "src": [\n "*"\n ],\n "srcdoc": [\n "*"\n ],\n "srclang": [\n "*"\n ],\n "srcset": [\n "*"\n ],\n "standby": [\n "*"\n ],\n "start": [\n "*"\n ],\n "step": [\n "*"\n ],\n "style": [\n "*"\n ],\n "summary": [\n "*"\n ],\n "tabindex": [\n "*"\n ],\n "target": [\n "*"\n ],\n "text": [\n "*"\n ],\n "title": [\n "*"\n ],\n "topmargin": [\n "*"\n ],\n "translate": [\n "*"\n ],\n "truespeed": [\n "*"\n ],\n "trusttoken": [\n "*"\n ],\n "type": [\n "*"\n ],\n "usemap": [\n "*"\n ],\n "valign": [\n "*"\n ],\n "value": [\n "*"\n ],\n "valuetype": [\n "*"\n ],\n "version": [\n "*"\n ],\n "virtualkeyboardpolicy": [\n "*"\n ],\n "vlink": [\n "*"\n ],\n "vspace": [\n "*"\n ],\n "webkitdirectory": [\n "*"\n ],\n "width": [\n "*"\n ],\n "wrap": [\n "*"\n ]\n }\n}'),re=function(e,t,n=oe){const o=ue(t,n);e.append(le(o))},ie=["https:"];ie.includes(location.protocol)||ie.push(location.protocol);const ae=s((()=>function(e,{createHTML:t=(()=>{throw new TypeError("This policy does not provide `createHTML()`")}),createScript:n=(()=>{throw new TypeError("This policy does not provide `createScript()`")}),createScriptURL:o=(()=>{throw new TypeError("This policy does not provide `createScriptURL()`")})}){return j()?trustedTypes.createPolicy(e,{createHTML:t,createScript:n,createScriptURL:o}):Object.freeze({name:e,createHTML:(e,...n)=>t(e.toString(),...n),createScript:(e,...t)=>n(e.toString(),...t),createScriptURL:(e,...t)=>o(e.toString(),...t)})}("sanitizer-raw#html",{createHTML:e=>e}))),se=e=>ae().createHTML(e);function le(e){const t=document.createDocumentFragment(),n=e.cloneNode(!0);return t.append(...n.head.childNodes,...n.body.childNodes),t}function ce({allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s,sanitizer:l}={},c){return l instanceof Sanitizer?ce(l.getConfiguration(),c):(void 0===e&&void 0===i&&(e=oe.allowAttributes),void 0===n&&void 0===a&&(n=oe.allowElements),{allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s})}function ue(e,t=oe){const n=(new DOMParser).parseFromString(se(e),"text/html");return Array.isArray(t.allowElements)&&!t.allowElements.includes("html")&&(t.allowElements=[...new Set([...t.allowElements,"html","head","body"])]),de(n,t)}function pe(e,t=oe){if(e instanceof Node){if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)return de(e,t);if(e.nodeType===Node.DOCUMENT_NODE)return de(le(e),t);throw new TypeError("sanitize requires a Document or DocumentFragment")}throw new TypeError("sanitize requires a Document or DocumentFragment")}function de(e,t=oe){try{if(!(e instanceof Node))throw new TypeError(`Expected a Node but got a ${a(e)}.`);if(!i(t))throw new TypeError(`Expected config to be an object but got ${a(t)}.`);const{allowElements:n,allowComments:o,allowAttributes:r,allowCustomElements:s,blockElements:l,dropAttributes:c,dropElements:u,allowUnknownMarkup:p}=ce(t),d=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let m=d.root.nodeType===Node.ELEMENT_NODE?d.root:d.nextNode();for(;m instanceof Node;){switch(m.nodeType){case Node.ELEMENT_NODE:{if(!p&&(!(m instanceof HTMLElement)||m instanceof HTMLUnknownElement)){m.remove();break}const e=m.tagName.toLowerCase();Array.isArray(u)&&u.includes(e)?m.remove():Array.isArray(l)&&l.includes(e)?m.hasChildNodes()?m.replaceWith(...m.childNodes):m.remove():e.includes("-")&&!s||Array.isArray(n)&&!n.includes(e)?m.remove():m.hasAttributes()&&m.getAttributeNames().forEach((t=>{const n=m.getAttributeNode(t),{value:o}=n;U.includes(t)&&!ie.includes(new URL(o,document.baseURI).protocol)?m.removeAttributeNode(n):i(c)?t in c&&["*",e].some((e=>c[t].includes(e)))&&m.removeAttributeNode(n):i(r)&&(t in r&&["*",e].some((e=>r[t].includes(e)))||m.removeAttributeNode(n))}));break}case Node.COMMENT_NODE:o||m.remove()}"template"===m.localName&&de(m.content,t),m=d.nextNode()}return e}catch(t){console.error(t),e.parentElement.removeChild(e)}}
|
|
39
|
+
const oe=JSON.parse('{\n "allowCustomElements": false,\n "allowUnknownMarkup": false,\n "allowElements": [\n "a",\n "abbr",\n "acronym",\n "address",\n "area",\n "article",\n "aside",\n "audio",\n "b",\n "bdi",\n "bdo",\n "bgsound",\n "big",\n "blockquote",\n "body",\n "br",\n "button",\n "canvas",\n "caption",\n "center",\n "cite",\n "code",\n "col",\n "colgroup",\n "datalist",\n "dd",\n "del",\n "details",\n "dfn",\n "dialog",\n "dir",\n "div",\n "dl",\n "dt",\n "em",\n "fieldset",\n "figcaption",\n "figure",\n "font",\n "footer",\n "form",\n "h1",\n "h2",\n "h3",\n "h4",\n "h5",\n "h6",\n "head",\n "header",\n "hgroup",\n "hr",\n "html",\n "i",\n "img",\n "input",\n "ins",\n "kbd",\n "keygen",\n "label",\n "layer",\n "legend",\n "li",\n "link",\n "listing",\n "main",\n "map",\n "mark",\n "marquee",\n "menu",\n "meta",\n "meter",\n "nav",\n "nobr",\n "ol",\n "optgroup",\n "option",\n "output",\n "p",\n "picture",\n "popup",\n "pre",\n "progress",\n "q",\n "rb",\n "rp",\n "rt",\n "rtc",\n "ruby",\n "s",\n "samp",\n "section",\n "select",\n "selectmenu",\n "small",\n "source",\n "span",\n "strike",\n "strong",\n "style",\n "sub",\n "summary",\n "sup",\n "table",\n "tbody",\n "td",\n "tfoot",\n "th",\n "thead",\n "time",\n "tr",\n "track",\n "tt",\n "u",\n "ul",\n "var",\n "video",\n "wbr"\n ],\n "allowAttributes": {\n "abbr": [\n "*"\n ],\n "accept": [\n "*"\n ],\n "accept-charset": [\n "*"\n ],\n "accesskey": [\n "*"\n ],\n "action": [\n "*"\n ],\n "align": [\n "*"\n ],\n "alink": [\n "*"\n ],\n "allow": [\n "*"\n ],\n "allowfullscreen": [\n "*"\n ],\n "alt": [\n "*"\n ],\n "anchor": [\n "*"\n ],\n "archive": [\n "*"\n ],\n "as": [\n "*"\n ],\n "async": [\n "*"\n ],\n "autocapitalize": [\n "*"\n ],\n "autocomplete": [\n "*"\n ],\n "autocorrect": [\n "*"\n ],\n "autofocus": [\n "*"\n ],\n "autopictureinpicture": [\n "*"\n ],\n "autoplay": [\n "*"\n ],\n "axis": [\n "*"\n ],\n "background": [\n "*"\n ],\n "behavior": [\n "*"\n ],\n "bgcolor": [\n "*"\n ],\n "border": [\n "*"\n ],\n "bordercolor": [\n "*"\n ],\n "capture": [\n "*"\n ],\n "cellpadding": [\n "*"\n ],\n "cellspacing": [\n "*"\n ],\n "challenge": [\n "*"\n ],\n "char": [\n "*"\n ],\n "charoff": [\n "*"\n ],\n "charset": [\n "*"\n ],\n "checked": [\n "*"\n ],\n "cite": [\n "*"\n ],\n "class": [\n "*"\n ],\n "classid": [\n "*"\n ],\n "clear": [\n "*"\n ],\n "code": [\n "*"\n ],\n "codebase": [\n "*"\n ],\n "codetype": [\n "*"\n ],\n "color": [\n "*"\n ],\n "cols": [\n "*"\n ],\n "colspan": [\n "*"\n ],\n "compact": [\n "*"\n ],\n "content": [\n "*"\n ],\n "contenteditable": [\n "*"\n ],\n "controls": [\n "*"\n ],\n "controlslist": [\n "*"\n ],\n "conversiondestination": [\n "*"\n ],\n "coords": [\n "*"\n ],\n "crossorigin": [\n "*"\n ],\n "csp": [\n "*"\n ],\n "data": [\n "*"\n ],\n "datetime": [\n "*"\n ],\n "declare": [\n "*"\n ],\n "decoding": [\n "*"\n ],\n "default": [\n "*"\n ],\n "defer": [\n "*"\n ],\n "dir": [\n "*"\n ],\n "direction": [\n "*"\n ],\n "dirname": [\n "*"\n ],\n "disabled": [\n "*"\n ],\n "disablepictureinpicture": [\n "*"\n ],\n "disableremoteplayback": [\n "*"\n ],\n "disallowdocumentaccess": [\n "*"\n ],\n "download": [\n "*"\n ],\n "draggable": [\n "*"\n ],\n "elementtiming": [\n "*"\n ],\n "enctype": [\n "*"\n ],\n "end": [\n "*"\n ],\n "enterkeyhint": [\n "*"\n ],\n "event": [\n "*"\n ],\n "exportparts": [\n "*"\n ],\n "face": [\n "*"\n ],\n "for": [\n "*"\n ],\n "form": [\n "*"\n ],\n "formaction": [\n "*"\n ],\n "formenctype": [\n "*"\n ],\n "formmethod": [\n "*"\n ],\n "formnovalidate": [\n "*"\n ],\n "formtarget": [\n "*"\n ],\n "frame": [\n "*"\n ],\n "frameborder": [\n "*"\n ],\n "headers": [\n "*"\n ],\n "height": [\n "*"\n ],\n "hidden": [\n "*"\n ],\n "high": [\n "*"\n ],\n "href": [\n "*"\n ],\n "hreflang": [\n "*"\n ],\n "hreftranslate": [\n "*"\n ],\n "hspace": [\n "*"\n ],\n "http-equiv": [\n "*"\n ],\n "id": [\n "*"\n ],\n "imagesizes": [\n "*"\n ],\n "imagesrcset": [\n "*"\n ],\n "importance": [\n "*"\n ],\n "impressiondata": [\n "*"\n ],\n "impressionexpiry": [\n "*"\n ],\n "incremental": [\n "*"\n ],\n "inert": [\n "*"\n ],\n "inputmode": [\n "*"\n ],\n "integrity": [\n "*"\n ],\n "invisible": [\n "*"\n ],\n "is": [\n "*"\n ],\n "ismap": [\n "*"\n ],\n "keytype": [\n "*"\n ],\n "kind": [\n "*"\n ],\n "label": [\n "*"\n ],\n "lang": [\n "*"\n ],\n "language": [\n "*"\n ],\n "latencyhint": [\n "*"\n ],\n "leftmargin": [\n "*"\n ],\n "link": [\n "*"\n ],\n "list": [\n "*"\n ],\n "loading": [\n "*"\n ],\n "longdesc": [\n "*"\n ],\n "loop": [\n "*"\n ],\n "low": [\n "*"\n ],\n "lowsrc": [\n "*"\n ],\n "manifest": [\n "*"\n ],\n "marginheight": [\n "*"\n ],\n "marginwidth": [\n "*"\n ],\n "max": [\n "*"\n ],\n "maxlength": [\n "*"\n ],\n "mayscript": [\n "*"\n ],\n "media": [\n "*"\n ],\n "method": [\n "*"\n ],\n "min": [\n "*"\n ],\n "minlength": [\n "*"\n ],\n "multiple": [\n "*"\n ],\n "muted": [\n "*"\n ],\n "name": [\n "*"\n ],\n "nohref": [\n "*"\n ],\n "nomodule": [\n "*"\n ],\n "nonce": [\n "*"\n ],\n "noresize": [\n "*"\n ],\n "noshade": [\n "*"\n ],\n "novalidate": [\n "*"\n ],\n "nowrap": [\n "*"\n ],\n "object": [\n "*"\n ],\n "open": [\n "*"\n ],\n "optimum": [\n "*"\n ],\n "part": [\n "*"\n ],\n "pattern": [\n "*"\n ],\n "ping": [\n "*"\n ],\n "placeholder": [\n "*"\n ],\n "playsinline": [\n "*"\n ],\n "policy": [\n "*"\n ],\n "poster": [\n "*"\n ],\n "preload": [\n "*"\n ],\n "pseudo": [\n "*"\n ],\n "readonly": [\n "*"\n ],\n "referrerpolicy": [\n "*"\n ],\n "rel": [\n "*"\n ],\n "reportingorigin": [\n "*"\n ],\n "required": [\n "*"\n ],\n "resources": [\n "*"\n ],\n "rev": [\n "*"\n ],\n "reversed": [\n "*"\n ],\n "role": [\n "*"\n ],\n "rows": [\n "*"\n ],\n "rowspan": [\n "*"\n ],\n "rules": [\n "*"\n ],\n "sandbox": [\n "*"\n ],\n "scheme": [\n "*"\n ],\n "scope": [\n "*"\n ],\n "scopes": [\n "*"\n ],\n "scrollamount": [\n "*"\n ],\n "scrolldelay": [\n "*"\n ],\n "scrolling": [\n "*"\n ],\n "select": [\n "*"\n ],\n "selected": [\n "*"\n ],\n "shadowroot": [\n "*"\n ],\n "shadowrootdelegatesfocus": [\n "*"\n ],\n "shape": [\n "*"\n ],\n "size": [\n "*"\n ],\n "sizes": [\n "*"\n ],\n "slot": [\n "*"\n ],\n "span": [\n "*"\n ],\n "spellcheck": [\n "*"\n ],\n "src": [\n "*"\n ],\n "srcdoc": [\n "*"\n ],\n "srclang": [\n "*"\n ],\n "srcset": [\n "*"\n ],\n "standby": [\n "*"\n ],\n "start": [\n "*"\n ],\n "step": [\n "*"\n ],\n "style": [\n "*"\n ],\n "summary": [\n "*"\n ],\n "tabindex": [\n "*"\n ],\n "target": [\n "*"\n ],\n "text": [\n "*"\n ],\n "title": [\n "*"\n ],\n "topmargin": [\n "*"\n ],\n "translate": [\n "*"\n ],\n "truespeed": [\n "*"\n ],\n "trusttoken": [\n "*"\n ],\n "type": [\n "*"\n ],\n "usemap": [\n "*"\n ],\n "valign": [\n "*"\n ],\n "value": [\n "*"\n ],\n "valuetype": [\n "*"\n ],\n "version": [\n "*"\n ],\n "virtualkeyboardpolicy": [\n "*"\n ],\n "vlink": [\n "*"\n ],\n "vspace": [\n "*"\n ],\n "webkitdirectory": [\n "*"\n ],\n "width": [\n "*"\n ],\n "wrap": [\n "*"\n ]\n }\n}'),re=function(e,t,n=oe){const o=ue(t,n);e.replaceChildren(le(o))},ie=["https:"];ie.includes(location.protocol)||ie.push(location.protocol);const ae=s((()=>function(e,{createHTML:t=(()=>{throw new TypeError("This policy does not provide `createHTML()`")}),createScript:n=(()=>{throw new TypeError("This policy does not provide `createScript()`")}),createScriptURL:o=(()=>{throw new TypeError("This policy does not provide `createScriptURL()`")})}){return j()?trustedTypes.createPolicy(e,{createHTML:t,createScript:n,createScriptURL:o}):Object.freeze({name:e,createHTML:(e,...n)=>t(e.toString(),...n),createScript:(e,...t)=>n(e.toString(),...t),createScriptURL:(e,...t)=>o(e.toString(),...t)})}("sanitizer-raw#html",{createHTML:e=>e}))),se=e=>ae().createHTML(e);function le(e){const t=document.createDocumentFragment(),n=e.cloneNode(!0);return t.append(...n.head.childNodes,...n.body.childNodes),t}function ce({allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s,sanitizer:l}={},c){return l instanceof Sanitizer?ce(l.getConfiguration(),c):(void 0===e&&void 0===i&&(e=oe.allowAttributes),void 0===n&&void 0===a&&(n=oe.allowElements),{allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s})}function ue(e,t=oe){const n=(new DOMParser).parseFromString(se(e),"text/html");return Array.isArray(t.allowElements)&&!t.allowElements.includes("html")&&(t.allowElements=[...new Set([...t.allowElements,"html","head","body"])]),de(n,t)}function pe(e,t=oe){if(e instanceof Node){if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)return de(e,t);if(e.nodeType===Node.DOCUMENT_NODE)return de(le(e),t);throw new TypeError("sanitize requires a Document or DocumentFragment")}throw new TypeError("sanitize requires a Document or DocumentFragment")}function de(e,t=oe){try{if(!(e instanceof Node))throw new TypeError(`Expected a Node but got a ${a(e)}.`);if(!i(t))throw new TypeError(`Expected config to be an object but got ${a(t)}.`);const{allowElements:n,allowComments:o,allowAttributes:r,allowCustomElements:s,blockElements:l,dropAttributes:c,dropElements:u,allowUnknownMarkup:p}=ce(t),d=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let m=d.root.nodeType===Node.ELEMENT_NODE?d.root:d.nextNode();for(;m instanceof Node;){switch(m.nodeType){case Node.ELEMENT_NODE:{if(!p&&(!(m instanceof HTMLElement)||m instanceof HTMLUnknownElement)){m.remove();break}const e=m.tagName.toLowerCase();Array.isArray(u)&&u.includes(e)?m.remove():Array.isArray(l)&&l.includes(e)?m.hasChildNodes()?m.replaceWith(...m.childNodes):m.remove():e.includes("-")&&!s||Array.isArray(n)&&!n.includes(e)?m.remove():m.hasAttributes()&&m.getAttributeNames().forEach((t=>{const n=m.getAttributeNode(t),{value:o}=n;U.includes(t)&&!ie.includes(new URL(o,document.baseURI).protocol)?m.removeAttributeNode(n):i(c)?t in c&&["*",e].some((e=>c[t].includes(e)))&&m.removeAttributeNode(n):i(r)&&(t in r&&["*",e].some((e=>r[t].includes(e)))||m.removeAttributeNode(n))}));break}case Node.COMMENT_NODE:o||m.remove()}"template"===m.localName&&de(m.content,t),m=d.nextNode()}return e}catch(t){console.error(t),e.parentElement.removeChild(e)}}
|
|
40
40
|
/**
|
|
41
41
|
* @copyright 2022-2023 Chris Zuber <admin@kernvalley.us>
|
|
42
42
|
*/
|