Skip to content

TagSpaces is an offline, open source, document manager with tagging support

switching back from chrome app to extension

Ilian4c22e2a98be8
diff --git a/data/chromelight/background.js b/data/chromelight/background.js
new file mode 100644
index 000000000..103afbe2e
--- /dev/null
+++ b/data/chromelight/background.js
@@ -0,0 +1,14 @@
+/* Copyright (c) 2012-2013 The TagSpaces Authors. All rights reserved.
+ * Use of this source code is governed by a AGPL3 license that
+ * can be found in the LICENSE file. */
+chrome.browserAction.onClicked.addListener(function() {
+ chrome.tabs.create({ url: 'index.html'});
+});
+chrome.runtime.onInstalled.addListener(function(details){
+ if(details.reason == "install"){
+ chrome.tabs.create({url: "index.html"});
+ }else if(details.reason == "update"){
+ var thisVersion = chrome.runtime.getManifest().version;
+ console.log("Updated from " + details.previousVersion + " to " + thisVersion +" !");
+ }
+});
\ No newline at end of file
diff --git a/data/chromelight/chrome.manifest.tmpl.json b/data/chromelight/chrome.manifest.tmpl.json
index 45d407d0b..3bbbdb4b4 100644
--- a/data/chromelight/chrome.manifest.tmpl.json
+++ b/data/chromelight/chrome.manifest.tmpl.json
@@ -9,14 +9,17 @@
"64": "assets/icon64.png",
"128": "assets/icon128.png"
},
- "app": {
- "launch": {
- "local_path": "index.html"
- }
+ "background": {
+ "scripts": ["chrome/background.js"]
+ },
+ "browser_action": {
+ "default_icon": "assets/icon19.png",
+ "default_title": "Launch @@APPNAME"
},
"permissions": [
"<all_urls>",
"storage"
],
- "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
+ "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
+ "homepage_url": "http://tagspaces.org"
}
\ No newline at end of file
diff --git a/data/manifest.json b/data/manifest.json
index 8de2e9f70..d06af56b2 100644
--- a/data/manifest.json
+++ b/data/manifest.json
@@ -9,14 +9,17 @@
"64": "assets/icon64.png",
"128": "assets/icon128.png"
},
- "app": {
- "launch": {
- "local_path": "index.html"
- }
+ "background": {
+ "scripts": ["chrome/background.js"]
+ },
+ "browser_action": {
+ "default_icon": "assets/icon19.png",
+ "default_title": "Launch @@APPNAME"
},
"permissions": [
"<all_urls>",
"storage"
],
- "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
+ "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
+ "homepage_url": "http://tagspaces.org"
}
\ No newline at end of file