@glitchr/transparent 1.0.58 → 1.0.59
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/README.md +1 -0
- package/package.json +1 -1
- package/src/js/transparent.js +5 -46
package/README.md
CHANGED
package/package.json
CHANGED
package/src/js/transparent.js
CHANGED
|
@@ -179,8 +179,7 @@ jQuery.event.special.mousewheel = { setup: function( _, ns, handle ) { this.addE
|
|
|
179
179
|
"smoothscroll_duration": "200ms",
|
|
180
180
|
"smoothscroll_speed" : 0,
|
|
181
181
|
"smoothscroll_easing" : "swing",
|
|
182
|
-
"exceptions": []
|
|
183
|
-
"headlock": [],
|
|
182
|
+
"exceptions": []
|
|
184
183
|
};
|
|
185
184
|
|
|
186
185
|
const State = Transparent.state = {
|
|
@@ -955,6 +954,7 @@ jQuery.event.special.mousewheel = { setup: function( _, ns, handle ) { this.addE
|
|
|
955
954
|
Transparent.evalScript($("body")[0]);
|
|
956
955
|
}
|
|
957
956
|
|
|
957
|
+
Transparent.scrollTo({top:0, left:0, duration:0});
|
|
958
958
|
Transparent.activeOut();
|
|
959
959
|
}
|
|
960
960
|
|
|
@@ -1224,59 +1224,17 @@ jQuery.event.special.mousewheel = { setup: function( _, ns, handle ) { this.addE
|
|
|
1224
1224
|
|
|
1225
1225
|
activeInRemainingTime = activeInRemainingTime - (Date.now() - activeInTime);
|
|
1226
1226
|
setTimeout(function() {
|
|
1227
|
-
|
|
1227
|
+
|
|
1228
1228
|
// Transfert attributes
|
|
1229
1229
|
Transparent.transferAttributes(dom);
|
|
1230
|
-
function isHeadLocked(el) {
|
|
1231
|
-
|
|
1232
|
-
// only for <script>, <link>, etc. that carry a URL
|
|
1233
|
-
const raw = (el.getAttribute("src") || el.getAttribute("href") || "").trim();
|
|
1234
|
-
if (!raw) return false;
|
|
1235
|
-
|
|
1236
|
-
// normalize to an absolute href string
|
|
1237
|
-
let href = raw;
|
|
1238
|
-
try { href = new URL(raw, location.href).href; } catch {}
|
|
1239
|
-
|
|
1240
|
-
return Settings.headlock.some((rule) => {
|
|
1241
|
-
if (rule instanceof RegExp) {
|
|
1242
|
-
return rule.test(href); // <= test against the string, not url.href
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
if (typeof rule === "string") {
|
|
1246
|
-
|
|
1247
|
-
if (rule.includes("*")) {
|
|
1248
|
-
const pattern = "^" + rule
|
|
1249
|
-
.replace(/[.+^${}()|[\]\\]/g, "\\$&")
|
|
1250
|
-
.replace(/\*/g, ".*") + "$";
|
|
1251
|
-
return new RegExp(pattern).test(href);
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
// No wildcard: treat as origin/prefix
|
|
1255
|
-
// If rule parses as a URL, compare origins; otherwise do simple prefix
|
|
1256
|
-
try {
|
|
1257
|
-
const r = new URL(rule, location.href);
|
|
1258
|
-
const u = new URL(href);
|
|
1259
|
-
// Match same origin, OR rule is a full URL prefix of href
|
|
1260
|
-
return (u.origin === r.origin) || href.startsWith(r.href);
|
|
1261
|
-
} catch {
|
|
1262
|
-
return href.startsWith(rule);
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
return false;
|
|
1267
|
-
});
|
|
1268
|
-
}
|
|
1269
1230
|
|
|
1270
1231
|
// Replace head..
|
|
1271
1232
|
var head = $(dom).find("head");
|
|
1272
1233
|
$("head").children().each(function() {
|
|
1273
1234
|
|
|
1274
1235
|
var el = this;
|
|
1275
|
-
if (isHeadLocked(el)) {
|
|
1276
|
-
return;
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
1236
|
var found = false;
|
|
1237
|
+
|
|
1280
1238
|
head.children().each(function() {
|
|
1281
1239
|
|
|
1282
1240
|
found = this.isEqualNode(el);
|
|
@@ -1294,6 +1252,7 @@ jQuery.event.special.mousewheel = { setup: function( _, ns, handle ) { this.addE
|
|
|
1294
1252
|
$("head").children().each(function() { found |= this.isEqualNode(el); });
|
|
1295
1253
|
if(!found) {
|
|
1296
1254
|
|
|
1255
|
+
|
|
1297
1256
|
if(this.tagName != "SCRIPT" || Settings["global_code"] == true) {
|
|
1298
1257
|
|
|
1299
1258
|
$("head").append(this.cloneNode(true));
|