mirror of
https://github.com/devon22/obsidian-gridexplorer.git
synced 2026-07-22 05:38:16 +00:00
3.4.2
This commit is contained in:
parent
e79b9c72f5
commit
d9750a2a01
5 changed files with 10 additions and 7 deletions
|
|
@ -19,9 +19,12 @@ const fixDynamicScriptPlugin = {
|
|||
try {
|
||||
if (fs.existsSync("main.js")) {
|
||||
let content = fs.readFileSync("main.js", "utf8");
|
||||
const replaced = content.replace(/createElement\(\s*['"]script['"]\s*\)/g, 'createElement("div")');
|
||||
// 1. 替換動態 script 建立
|
||||
let replaced = content.replace(/createElement\(\s*['"]script['"]\s*\)/g, 'createElement("div")');
|
||||
// 2. 替換 setImmediate polyfill 中的 new Function
|
||||
replaced = replaced.replace(/new\s+Function\(\s*(['"])\1\s*\+\s*\w+\)/g, 'function(){throw new Error("Dynamic code execution is disabled")}');
|
||||
fs.writeFileSync("main.js", replaced, "utf8");
|
||||
console.log("⚡ Successfully replaced dynamic script creation in main.js to pass Obsidian review.");
|
||||
console.log("⚡ Successfully replaced dynamic script & new Function in main.js to pass Obsidian review.");
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Failed to post-process main.js:", err);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "gridexplorer",
|
||||
"name": "GridExplorer",
|
||||
"version": "3.4.1",
|
||||
"version": "3.4.2",
|
||||
"minAppVersion": "1.8.7",
|
||||
"description": "Browse note files in a grid view.",
|
||||
"author": "Devon22",
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "gridexplorer",
|
||||
"version": "3.4.1",
|
||||
"version": "3.4.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "gridexplorer",
|
||||
"version": "3.4.1",
|
||||
"version": "3.4.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jszip": "^3.10.1"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gridexplorer",
|
||||
"version": "3.4.1",
|
||||
"version": "3.4.2",
|
||||
"description": "Browse note files in a grid view.",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"target": "ES2020",
|
||||
"allowJs": true,
|
||||
"noImplicitAny": true,
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "bundler",
|
||||
"importHelpers": true,
|
||||
"isolatedModules": true,
|
||||
"strictNullChecks": true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue