MCPcopy Create free account
hub / github.com/hoothin/UserScripts / openPrefs

Function openPrefs

Picviewer CE+/dist.user.js:28629–28653  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28627 }
28628
28629 function openPrefs() {
28630 if (window.top != window.self) return;
28631 let fieldsSearchData = GM_config.fields["gallery.searchData"];
28632 if (fieldsSearchData && fieldsSearchData.value) {
28633 fieldsSearchData.value = fieldsSearchData.value.replace(/&amp;/g, "&").replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;");
28634 }
28635 let fieldsCustomRules = GM_config.fields.customRules;
28636 if (fieldsCustomRules && fieldsCustomRules.value) {
28637 fieldsCustomRules.value = fieldsCustomRules.value.replace(/&amp;/g, "&").replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;");
28638 }
28639 document.head.appendChild(configStyle);
28640 GM_config.open();
28641 document.documentElement.appendChild(GM_config.frame);
28642
28643 setTimeout(()=>{
28644 if (GM_config.frame && GM_config.frame.contentDocument.body.innerHTML === "") {
28645 _GM_openInTab("https://pv.hoothin.com/open-settings", {active:true});
28646 return;
28647 }
28648 if (GM_config.frame && GM_config.frame.style && GM_config.frame.style.display == "none") {
28649 GM_config.frame.src="";
28650 }
28651 initKeyInputs();
28652 }, 1000);
28653 }
28654
28655 function loadPrefs() {
28656 // 根据 GM_config 的 key 载入设置到 prefs

Callers 1

initFunction · 0.70

Calls 1

initKeyInputsFunction · 0.70

Tested by

no test coverage detected