From 8516a7248c51e9676f5e0dd31281eea782108631 Mon Sep 17 00:00:00 2001 From: Cha Sung Won Date: Mon, 15 Jan 2024 22:36:30 +0900 Subject: [PATCH] manifest v3 https://github.com/bluewings/md-slide-chrome-extension/issues/2 --- package.json | 4 +- .../components/Main/useSlides.ts | 2 +- src/manifest.json | 42 ++++++++++++------- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 46061b6..203645e 100644 --- a/package.json +++ b/package.json @@ -22,13 +22,13 @@ "copy-webpack-plugin": "^5.1.1", "css-loader": "^3.5.1", "html-webpack-plugin": "^4.0.4", - "node-sass": "^4.13.1", "postcss-flexbugs-fixes": "^4.2.0", "postcss-loader": "^3.0.0", "postcss-normalize": "^8.0.1", "postcss-preset-env": "^6.7.0", - "prettier": "^2.0.4", + "prettier": "^3.2.2", "react-dev-utils": "^10.2.1", + "sass": "^1.69.7", "sass-loader": "^8.0.2", "style-loader": "^1.1.3", "typescript": "^3.8.3", diff --git a/src/content_scripts/components/Main/useSlides.ts b/src/content_scripts/components/Main/useSlides.ts index ff9e167..2f1e085 100644 --- a/src/content_scripts/components/Main/useSlides.ts +++ b/src/content_scripts/components/Main/useSlides.ts @@ -18,7 +18,7 @@ function getTimelineComments() { }) .filter( ({ html, input }) => - (html && html.search(/^]*>use slide<\/code><\/p>\n/) !== -1) || + (html && html.search(/^]*>]*>use slide<\/code><\/p>\n/) !== -1) || (input && input.search(/^`use\s+slide`\s*\n*/) !== -1), ); } diff --git a/src/manifest.json b/src/manifest.json index 031d238..a0b8aba 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,5 +1,5 @@ { - "manifest_version": 2, + "manifest_version": 3, "name": "Markdown Slide", "version": "1.0.0", "description": "Markdown Slide", @@ -8,23 +8,37 @@ "48": "icons/icon48.png", "128": "icons/icon128.png" }, - "background": { - "scripts": ["background/index.js"] - }, "content_scripts": [ { - "matches": ["https://github.com/**/*", "https://oss.navercorp.com/**/*"], - "js": ["content_scripts/index.js"] + "matches": [ + "https://github.com/**/*", + "https://oss.navercorp.com/**/*" + ], + "js": [ + "content_scripts/index.js" + ] } ], - "permissions": ["https://github.com/**/*", "https://oss.navercorp.com/**/*", "https://raw.oss.navercorp.com/**/*"], - + "host_permissions": [ + "https://github.com/**/*", + "https://oss.navercorp.com/**/*", + "https://raw.oss.navercorp.com/**/*" + ], "web_accessible_resources": [ - "images/*.png", - "style/double-rainbow.css", - "script/double-rainbow.js", - "script/main.js", - "templates/*", - "content_scripts/*" + { + "resources": [ + "images/*.png", + "style/double-rainbow.css", + "script/double-rainbow.js", + "script/main.js", + "templates/*", + "content_scripts/*" + ], + "matches": [ + "https://github.com/*", + "https://oss.navercorp.com/*", + "https://raw.oss.navercorp.com/*" + ] + } ] }