From beea705bb085d74294e34d44f52e7b1e06527a42 Mon Sep 17 00:00:00 2001 From: iw0 Date: Mon, 29 Jul 2024 20:06:35 +0200 Subject: [PATCH] browser action --- _locales/de/messages.json | 5 +++++ _locales/en/messages.json | 5 +++++ bg.js | 6 ++++++ manifest.json | 6 +++++- 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 _locales/de/messages.json create mode 100644 _locales/en/messages.json diff --git a/_locales/de/messages.json b/_locales/de/messages.json new file mode 100644 index 0000000..237318c --- /dev/null +++ b/_locales/de/messages.json @@ -0,0 +1,5 @@ +{ + "iconAction": { + "message": "Formular öffnen" + } +} \ No newline at end of file diff --git a/_locales/en/messages.json b/_locales/en/messages.json new file mode 100644 index 0000000..e030772 --- /dev/null +++ b/_locales/en/messages.json @@ -0,0 +1,5 @@ +{ + "iconAction": { + "message": "Open form" + } +} \ No newline at end of file diff --git a/bg.js b/bg.js index cc654be..f488c9a 100644 --- a/bg.js +++ b/bg.js @@ -11,6 +11,12 @@ browser.runtime.onInstalled.addListener((ev) => { } }) +browser.browserAction.onClicked.addListener((tab, info) => { + browser.tabs.create({ + url: "https://www.bahn.de/buchung/fahrgastrechte?einstiegtyp=BC100" + }) +}) + async function updateIsSignificant(previousVersion) { const significantUpdates = ["0.1.0", "0.2.0", "0.3.0"]; let currentVersion = (await browser.management.getSelf()).version; diff --git a/manifest.json b/manifest.json index f82be0d..50f3e89 100644 --- a/manifest.json +++ b/manifest.json @@ -2,11 +2,15 @@ "manifest_version": 2, "name": "BC100 Autofill", "description": "Autofills your BahnCard 100 number and birthday into the passenger rights claim form.", - "version": "0.3.6", + "version": "0.3.7", "icons": { "48": "icons/icon.png", "96": "icons/icon@2x.png" }, + "browser_action":{ + "default_title":"__MSG_iconAction__" + }, + "default_locale":"en", "content_scripts": [ { "matches": [