File tree Expand file tree Collapse file tree 2 files changed +23
-14
lines changed Expand file tree Collapse file tree 2 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 1
- function saveBookmark ( ) {
2
- browser . tabs . query ( { active : true , currentWindow : true } , function ( tabs ) {
3
- let tab = tabs [ 0 ] ;
4
- let url = tab . url ;
5
-
6
- browser . tabs . create ( {
7
- url : "https://micro.blog/bookmarks?go=" + encodeURIComponent ( url )
8
- } ) ;
9
- } ) ;
1
+ function saveBookmark ( tab ) {
2
+ // browser.tabs.query({ active: true, currentWindow: true }, function(tabs) {
3
+ // let tab = tabs[0];
4
+ // let url = tab.url;
5
+ //
6
+ // browser.tabs.create({
7
+ // url: "https://micro.blog/bookmarks?go=" + encodeURIComponent(url)
8
+ // });
9
+ // });
10
+
11
+ let url = tab . url ;
12
+ chrome . tabs . create ( {
13
+ url : "https://micro.blog/bookmarks?go=" + encodeURIComponent ( url )
14
+ } ) ;
10
15
}
11
16
12
- browser . browserAction . onClicked . addListener ( saveBookmark ) ;
17
+ // browser.browserAction.onClicked.addListener(saveBookmark);
18
+
19
+ chrome . action . onClicked . addListener ( ( tab ) => {
20
+ saveBookmark ( tab ) ;
21
+ } ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " Micro.blog" ,
3
3
"description" : " Save bookmarks to Micro.blog." ,
4
- "manifest_version" : 2 ,
5
- "version" : " 1.0" ,
4
+ "manifest_version" : 3 ,
5
+ "version" : " 1.0.1 " ,
6
6
"permissions" : [ " activeTab" ],
7
7
"background" : {
8
- "scripts " : [ " background.js" ]
8
+ "service_worker " : " background.js"
9
9
},
10
10
"icons" : {
11
11
"16" : " icons/icon-16.png" ,
12
12
"32" : " icons/icon-32.png" ,
13
13
"64" : " icons/icon-64.png" ,
14
14
"128" : " icons/icon-128.png"
15
15
},
16
- "browser_action " : {
16
+ "action " : {
17
17
"default_icon" : {
18
18
"16" : " icons/icon-16.png" ,
19
19
"32" : " icons/icon-32.png" ,
You can’t perform that action at this time.
0 commit comments