-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from terwer/dev
feat:#85 Google插件扩展-多页面支持
- Loading branch information
Showing
20 changed files
with
696 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ dist-ssr | |
*.private.env.json | ||
__snapshots__ | ||
test/data/ | ||
extension/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pwd | ||
yarn build | ||
# 删除siyuan挂件专属文件 | ||
rm ./dist/widget.json | ||
|
||
rm -rf ./extension/* | ||
mkdir extension | ||
cp -r ./dist/* ./extension/ | ||
echo "Chrome插件发布完毕." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# todo | ||
|
||
## doc | ||
|
||
https://developer.chrome.com/docs/extensions/ | ||
|
||
https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Extension event listeners are a little different from the patterns you may have seen in DOM or | ||
// Node.js APIs. The below event listener registration can be broken in to 4 distinct parts: | ||
// | ||
// * chrome - the global namespace for Chrome's extension APIs | ||
// * runtime – the namespace of the specific API we want to use | ||
// * onInstalled - the event we want to subscribe to | ||
// * addListener - what we want to do with this event | ||
// | ||
// See https://developer.chrome.com/docs/extensions/reference/events/ for additional details. | ||
chrome.runtime.onInstalled.addListener(async () => { | ||
console.log("Installed") | ||
}); | ||
|
||
// function createPage() { | ||
// // While we could have used `let url = "index.html"`, using runtime.getURL is a bit more robust as | ||
// // it returns a full URL rather than just a path that Chrome needs to be resolved contextually at | ||
// // runtime. | ||
// let url = chrome.runtime.getURL("index.html"); | ||
// window.open(url) | ||
// console.log(`Created tab`); | ||
// } | ||
|
||
// chrome.action.onClicked.addListener((tab) => { | ||
// if (!tab.url.includes("chrome://")) { | ||
// chrome.scripting.executeScript({ | ||
// target: {tabId: tab.id}, | ||
// function: createPage | ||
// }); | ||
// } | ||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "思源笔记辅助工具", | ||
"version": "1.1.3", | ||
"manifest_version": 3, | ||
"author": "terwer", | ||
"description": "思源笔记辅助工具,支持博客式制度浏览,文章发布。", | ||
"background": { | ||
"service_worker": "background.js" | ||
}, | ||
"permissions": [ | ||
"activeTab", | ||
"scripting" | ||
], | ||
"web_accessible_resources": [ | ||
{ | ||
"resources": [ | ||
"index/index.html", | ||
"service/index.html" | ||
], | ||
"matches": [ | ||
"<all_urls>" | ||
] | ||
} | ||
], | ||
"action": { | ||
"default_popup": "index/index.html" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<div> | ||
<h1>Index</h1> | ||
<a href="./index.html?pwd=123456&id=20220917154709-4aqccxm"></a> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: "Index.vue" | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<div> | ||
<Index/> | ||
<button @click="createPage">服务</button> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import {onMounted} from "vue"; | ||
import logUtil from "../../lib/logUtil"; | ||
import Index from "../../components/Index.vue" | ||
function createPage() { | ||
// While we could have used `let url = "index.html"`, using runtime.getURL is a bit more robust as | ||
// it returns a full URL rather than just a path that Chrome needs to be resolved contextually at | ||
// runtime. | ||
// let url = chrome.runtime.getURL("index/index.html"); | ||
let url = "/service/index.html?pwd=123456"; | ||
// @ts-ignore | ||
if (typeof chrome.runtime != "undefined") { | ||
// @ts-ignore | ||
url = chrome.runtime.getURL("/service/index.html?pwd=123456"); | ||
} | ||
window.open(url) | ||
console.log(`Created tab`); | ||
} | ||
onMounted(async () => { | ||
logUtil.logWarn("MODE=>", import.meta.env.MODE) | ||
}) | ||
</script> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: 'App' | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>思源笔记辅助工具 - 支持博客式制度浏览,文章发布</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="/lute.min.js"></script> | ||
<script type="module" src="/src/pages/service/main.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {createApp} from 'vue' | ||
import App from './App.vue' | ||
import './style.css' | ||
// 国际化 | ||
import i18n from "../../locales"; | ||
|
||
// Element-Plus | ||
import ElementPlus from 'element-plus' | ||
import 'element-plus/dist/index.css' | ||
|
||
// Vue初始化 | ||
const app = createApp(App) | ||
|
||
// 组件注册 | ||
// 国际化 | ||
app.use(i18n) | ||
// Element-Plus | ||
app.use(ElementPlus) | ||
|
||
// Register a global custom directive called `v-focus` | ||
app.directive('focus', { | ||
// When the bound element is mounted into the DOM... | ||
mounted(el) { | ||
// Focus the element | ||
el.focus() | ||
} | ||
}) | ||
|
||
// 挂载Vue | ||
app.mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
:root { | ||
font-family: "-apple-system", "Wenquanyi Micro Hei", "Wenquanyi Micro Hei Mono", "Microsoft YaHei", "LXGW WenKai", "PT Sans", "Liberation Mono", monospace, dejavu sans mono, Fira Code, Microsoft Yahei, Consolas, Courier New, monospace, Menlo, Monaco !important; | ||
|
||
color-scheme: light dark; | ||
color: rgba(255, 255, 255, 0.87); | ||
background-color: #242424; | ||
|
||
font-synthesis: none; | ||
text-rendering: optimizeLegibility; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
-webkit-text-size-adjust: 100%; | ||
} | ||
|
||
a { | ||
font-weight: 500; | ||
color: #646cff; | ||
text-decoration: inherit; | ||
} | ||
a:hover { | ||
color: #535bf2; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
} | ||
|
||
#app { | ||
padding: 10px; | ||
} | ||
|
||
@media (prefers-color-scheme: light) { | ||
:root { | ||
color: #213547; | ||
background-color: #ffffff; | ||
} | ||
} | ||
|
||
.el-tag { | ||
margin-right: 10px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.top-version-tip { | ||
margin: 10px 0 !important; | ||
} | ||
|
||
.el-alert { | ||
margin-top: 10px !important; | ||
} |
Oops, something went wrong.
05ace28
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
src-sy-post-publisher – ./
src-sy-post-publisher-terwergreen.vercel.app
src-sy-post-publisher-git-main-terwergreen.vercel.app
src-sy-post-publisher.vercel.app
publish.terwer.space