mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
add script cloning
This commit is contained in:
parent
efa30f6d84
commit
759ebd747e
4 changed files with 42 additions and 2 deletions
|
@ -44,6 +44,10 @@ Object.keys(attribs).forEach((attrib: string) => {
|
|||
},
|
||||
|
||||
set(value) {
|
||||
if (this.dataset["scramjet"]) {
|
||||
return;
|
||||
}
|
||||
console.log(value);
|
||||
this.dataset[`${attrib}`] = value;
|
||||
if (/nonce|integrity|csp/.test(attrib)) {
|
||||
this.removeAttribute(attrib);
|
||||
|
@ -84,6 +88,10 @@ Element.prototype.getAttribute = new Proxy(Element.prototype.getAttribute, {
|
|||
|
||||
Element.prototype.setAttribute = new Proxy(Element.prototype.setAttribute, {
|
||||
apply(target, thisArg, argArray) {
|
||||
if (thisArg.dataset["scramjet"]) {
|
||||
return;
|
||||
}
|
||||
console.log(argArray[1])
|
||||
if (Object.keys(attribs).includes(argArray[0])) {
|
||||
thisArg.dataset[`${argArray[0]}`] = argArray[1];
|
||||
if (/nonce|integrity|csp/.test(argArray[0])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue