Skip to content

Commit a2769c0

Browse files
committed
update
1 parent edba8c1 commit a2769c0

File tree

2 files changed

+40
-45
lines changed

2 files changed

+40
-45
lines changed

Pagetual/pagetual.user.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4643,14 +4643,8 @@
46434643
});
46444644
break;
46454645
} catch (e) {
4646-
try {
4647-
escapeHTMLPolicy = _unsafeWindow.trustedTypes.policies.get(name);
4648-
if (escapeHTMLPolicy) {
4649-
break;
4650-
}
4651-
} catch (e2) {
4652-
console.warn(`create '${name}' failed`);
4653-
}
4646+
console.warn(`create '${name}' failed`);
4647+
return;
46544648
}
46554649
}
46564650
}

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// @description:ja 画像を強力に閲覧できるツール。ポップアップ表示、拡大・縮小、回転、一括保存などの機能を自動で実行できます
1313
// @description:pt-BR Poderosa ferramenta de visualização de imagens on-line, que pode pop-up/dimensionar/girar/salvar em lote imagens automaticamente
1414
// @description:ru Мощный онлайн-инструмент для просмотра изображений, который может автоматически отображать/масштабировать/вращать/пакетно сохранять изображения
15-
// @version 2025.10.10.1
15+
// @version 2025.10.16.1
1616
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAV1BMVEUAAAD////29vbKysoqKioiIiKysrKhoaGTk5N9fX3z8/Pv7+/r6+vk5OTb29vOzs6Ojo5UVFQzMzMZGRkREREMDAy4uLisrKylpaV4eHhkZGRPT08/Pz/IfxjQAAAAgklEQVQoz53RRw7DIBBAUb5pxr2m3/+ckfDImwyJlL9DDzQgDIUMRu1vWOxTBdeM+onApENF0qHjpkOk2VTwLVEF40Kbfj1wK8AVu2pQA1aBBYDHJ1wy9Cf4cXD5chzNAvsAnc8TjoLAhIzsBao9w1rlVTIvkOYMd9nm6xPi168t9AYkbANdajpjcwAAAABJRU5ErkJggg==
1717
// @namespace https://github.com/hoothin/UserScripts
1818
// @homepage https://github.com/hoothin/UserScripts/tree/master/Picviewer%20CE%2B
@@ -12543,14 +12543,8 @@ ImgOps | https://imgops.com/#b#`;
1254312543
});
1254412544
break;
1254512545
} catch (e) {
12546-
try {
12547-
escapeHTMLPolicy = unsafeWindow.trustedTypes.policies.get(name);
12548-
if (escapeHTMLPolicy) {
12549-
break;
12550-
}
12551-
} catch (e2) {
12552-
console.warn(`create '${name}' failed`);
12553-
}
12546+
console.warn(`create '${name}' failed`);
12547+
return;
1255412548
}
1255512549
}
1255612550
}
@@ -22227,12 +22221,10 @@ ImgOps | https://imgops.com/#b#`;
2222722221

2222822222
let size = rectSize, containsScroll = imgWindow.classList.contains("pv-pic-window-scroll");
2222922223
if (rectSize.w > wSize.w) {
22230-
if (rectSize.w / rectSize.h > wSize.w / wSize.h) {
22231-
size = {
22232-
w: wSize.w,
22233-
h: wSize.w / (rectSize.w / rectSize.h),
22234-
};
22235-
}
22224+
size = {
22225+
w: wSize.w,
22226+
h: wSize.w / (rectSize.w / rectSize.h),
22227+
};
2223622228

2223722229
let cs = this.getRotatedImgCliSize(size);
2223822230
let ns = this.imgNaturalSize;
@@ -24250,7 +24242,7 @@ ImgOps | https://imgops.com/#b#`;
2425024242
window.addEventListener('scroll',this._scrollHandler,true);
2425124243
},
2425224244
hide:function(){
24253-
lastEvent = null;
24245+
target = null;
2425424246
clearTimeout(this.showTimer);
2425524247
this.floatBar.style.opacity=0.01;
2425624248
this.shown=false;
@@ -25674,16 +25666,18 @@ ImgOps | https://imgops.com/#b#`;
2567425666
}
2567525667
}
2567625668
}
25677-
if (!found && target.children && target.children[0] && target.children[0].nodeName.toUpperCase() == 'IMG') {
25678-
let img = target.children[0];
25679-
while (img.nextElementSibling && img.nextElementSibling.nodeName.toUpperCase() == 'IMG') {
25680-
img = img.nextElementSibling;
25681-
}
25682-
let rect = img.getBoundingClientRect();
25669+
if (!found && target.children && target.children.length) {
25670+
let img = target.querySelector("img");
25671+
if (img) {
25672+
while (img.nextElementSibling && img.nextElementSibling.nodeName.toUpperCase() == 'IMG') {
25673+
img = img.nextElementSibling;
25674+
}
25675+
let rect = img.getBoundingClientRect();
2568325676

25684-
if (clientY >= rect.top && clientY <= rect.bottom && clientX >= rect.left && clientX <= rect.right) {
25685-
target = img;
25686-
found = true;
25677+
if (clientY >= rect.top && clientY <= rect.bottom && clientX >= rect.left && clientX <= rect.right) {
25678+
target = img;
25679+
found = true;
25680+
}
2568725681
}
2568825682
}
2568925683
if (!found && document.elementsFromPoint) {
@@ -25926,7 +25920,7 @@ ImgOps | https://imgops.com/#b#`;
2592625920
}
2592725921
}
2592825922

25929-
var checkFloatBarTimer, initMouse = false, lastEvent, composedTarget, checking = false;
25923+
var checkFloatBarTimer, initMouse = false, composedTarget, checking = false, target, type, clientX, clientY, altKey;
2593025924
function globalMouseoverHandler(e) {
2593125925
if (galleryMode) return;//库模式全屏中......
2593225926
if (e.target == ImgWindowC.overlayer) return;
@@ -25963,26 +25957,33 @@ ImgOps | https://imgops.com/#b#`;
2596325957
}
2596425958
if (!initMouse) return;
2596525959
if (e.type == "keydown") {
25966-
if (!lastEvent) return;
25967-
e = lastEvent;
25960+
if (!target) return;
2596825961
} else {
25969-
lastEvent = e;
25970-
if (checking) {
25971-
setTimeout(() => {
25972-
checking = false;
25973-
}, 50);
25974-
} else {
25975-
checking = true;
25962+
target = e.target;
25963+
type = e.type;
25964+
clientX = e.clientX;
25965+
clientY = e.clientY;
25966+
altKey = e.altKey;
25967+
if (e.type !== "mousemove") {
2597625968
let path = e && e.composedPath && e.composedPath();
2597725969
composedTarget = path && path[0];
2597825970
}
2597925971
}
2598025972
clearTimeout(checkFloatBarTimer);
2598125973
checkFloatBarTimer = setTimeout(function() {
25982-
if (!e || !e.target || !e.target.parentNode) return;
25974+
if (!target || !target.parentNode) return;
2598325975
if (gallery && gallery.shown) return;
25984-
checkFloatBar(e.target, e.type, canPreview, e.clientX, e.clientY, e.altKey, composedTarget);
25976+
checkFloatBar(target, type, canPreview, clientX, clientY, altKey, composedTarget);
2598525977
}, 50);
25978+
if (e.target.shadowRoot) {
25979+
if (!e.target.shadowRoot.initListener) {
25980+
e.target.shadowRoot.initListener = true;
25981+
e.target.shadowRoot.addEventListener('mouseenter', (e) => {
25982+
globalMouseoverHandler(e);
25983+
}, true);
25984+
e.target.shadowRoot.addEventListener('mousemove', globalMouseoverHandler, true);
25985+
}
25986+
}
2598625987
}
2598725988

2598825989
var selectionClientRect, selectionStr, selectionChanging = false;

0 commit comments

Comments
 (0)