Greasy Fork is available in English.

Picviewer CE+

線上看圖工具,支援圖片翻轉、旋轉、縮放、彈出大圖、批量儲存

< 腳本Picviewer CE+的回應

提問/評論

§
發表於:2020-10-21

please replace string:
var result,hasBg=function(node){var nodeStyle=getComputedStyle(node);return node&&nodeStyle.backgroundImage&&/^url/.test(nodeStyle.backgroundImage)&&nodeStyle.backgroundImage.indexOf("about:blank")==-1&&nodeStyle.width.replace("px","")>prefs.floatBar.minSizeLimit.w&&nodeStyle.height.replace("px","")>prefs.floatBar.minSizeLimit.h;}; to sting:
var result,hasBg=function(node){if (node.constructor && node.constructor.name === 'HTMLElement'){ var nodeStyle=getComputedStyle(node);return node&&nodeStyle.backgroundImage&&/^url/.test(nodeStyle.backgroundImage)&&nodeStyle.backgroundImage.indexOf("about:blank")==-1&&nodeStyle.width.replace("px","")>prefs.floatBar.minSizeLimit.w&&nodeStyle.height.replace("px","")>prefs.floatBar.minSizeLimit.h;};}

because in old variant it sometime log to console:
Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element or something like this

發表回覆

登入以回復