-
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.
- Loading branch information
Showing
11 changed files
with
115 additions
and
20 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
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,25 @@ | ||
{ | ||
"name": "思源笔记辅助工具", | ||
"version": "1.1.3", | ||
"manifest_version": 3, | ||
"author": "terwer", | ||
"description": "思源笔记辅助工具,支持博客式制度浏览,文章发布。", | ||
"background": { | ||
"service_worker": "background.js" | ||
}, | ||
"permissions": [ | ||
"activeTab", | ||
"scripting" | ||
], | ||
"web_accessible_resources": [ | ||
{ | ||
"resources": [ | ||
"index.html" | ||
], | ||
"matches": [ | ||
"<all_urls>" | ||
] | ||
} | ||
], | ||
"action": {} | ||
} |
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,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> |