summaryrefslogtreecommitdiffstats
path: root/background.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 07:58:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 07:58:57 +0000
commit592d2180f5d3984853bf55f91be87ac5d1dc0c1a (patch)
tree74ebbedcb80b9eca5e9773fb1b558e75f69cad8d /background.js
parentInitial commit. (diff)
downloaddav4tbsync-592d2180f5d3984853bf55f91be87ac5d1dc0c1a.tar.xz
dav4tbsync-592d2180f5d3984853bf55f91be87ac5d1dc0c1a.zip
Adding upstream version 4.7.upstream/4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'background.js')
-rw-r--r--background.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/background.js b/background.js
new file mode 100644
index 0000000..5c793e1
--- /dev/null
+++ b/background.js
@@ -0,0 +1,26 @@
+function isCompatible(version) {
+ let [ major, minor , patch ] = version.split(".").map(e => parseInt(e,10));
+ return (
+ major > 102 ||
+ (major == 102 && minor > 3) ||
+ (major == 102 && minor == 3 && patch > 2)
+ );
+}
+
+async function main() {
+ let { version } = await browser.runtime.getBrowserInfo();
+ if (isCompatible(version)) {
+ await messenger.BootstrapLoader.registerChromeUrl([ ["content", "dav4tbsync", "content/"] ]);
+ await messenger.BootstrapLoader.registerBootstrapScript("chrome://dav4tbsync/content/bootstrap.js");
+ } else {
+ let manifest = browser.runtime.getManifest();
+ browser.notifications.create({
+ type: "basic",
+ iconUrl: browser.runtime.getURL("content/skin/sabredav32.png"),
+ title: `${manifest.name}`,
+ message: "Please update Thunderbird to at least 102.3.3 to be able to use this provider.",
+ });
+ }
+}
+
+main();