Skip to content

Commit 954d75b

Browse files
author
zhangruinan
committed
feat: initiate
1 parent edac97b commit 954d75b

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

background.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
chrome.browserAction.onClicked.addListener(function(tab) {
2+
chrome.tabs.create({url: "http://www.mymap.ai/vizmap?type=vgmap&mid=pg-enFXnlaT66Zh&url=" + encodeURIComponent(tab.url)});
3+
});
4+
5+
chrome.commands.onCommand.addListener(function(command) {
6+
if (command === "_execute_browser_action") {
7+
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
8+
chrome.tabs.create({url: "http://www.mymap.ai/vizmap?type=vgmap&mid=pg-enFXnlaT66Zh&url=" + encodeURIComponent(tabs[0].url)});
9+
});
10+
}
11+
});
12+

manifest.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"manifest_version": 2,
3+
"name": "StoryMap",
4+
"description": "Opens mymap.ai with current URL",
5+
"version": "1.0",
6+
"background": {
7+
"scripts": ["background.js"],
8+
"persistent": false
9+
},
10+
"commands": {
11+
"_execute_browser_action": {
12+
"suggested_key": {
13+
"default": "Ctrl+Shift+M",
14+
"mac": "MacCtrl+Shift+M"
15+
}
16+
}
17+
},
18+
"permissions": [
19+
"activeTab"
20+
],
21+
"browser_action": {}
22+
}
23+

0 commit comments

Comments
 (0)