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 {
|
try {
|
||||||
if (fs.existsSync("main.js")) {
|
if (fs.existsSync("main.js")) {
|
||||||
let content = fs.readFileSync("main.js", "utf8");
|
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");
|
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) {
|
} catch (err) {
|
||||||
console.error("Failed to post-process main.js:", err);
|
console.error("Failed to post-process main.js:", err);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "gridexplorer",
|
"id": "gridexplorer",
|
||||||
"name": "GridExplorer",
|
"name": "GridExplorer",
|
||||||
"version": "3.4.1",
|
"version": "3.4.2",
|
||||||
"minAppVersion": "1.8.7",
|
"minAppVersion": "1.8.7",
|
||||||
"description": "Browse note files in a grid view.",
|
"description": "Browse note files in a grid view.",
|
||||||
"author": "Devon22",
|
"author": "Devon22",
|
||||||
|
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "gridexplorer",
|
"name": "gridexplorer",
|
||||||
"version": "3.4.1",
|
"version": "3.4.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "gridexplorer",
|
"name": "gridexplorer",
|
||||||
"version": "3.4.1",
|
"version": "3.4.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jszip": "^3.10.1"
|
"jszip": "^3.10.1"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "gridexplorer",
|
"name": "gridexplorer",
|
||||||
"version": "3.4.1",
|
"version": "3.4.2",
|
||||||
"description": "Browse note files in a grid view.",
|
"description": "Browse note files in a grid view.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "bundler",
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue