diff --git a/layouts/error.vue b/layouts/error.vue index ca51e9cc8f215ee5408fb3345ecefeaa49303be1..7b37ffb0217ebbe1995b01296cdad2c4ec0dc62e 100644 --- a/layouts/error.vue +++ b/layouts/error.vue @@ -26,7 +26,12 @@ export default { $nuxt.$emit("changeRoute", this.breadcrumb) }, props: ["error"], - layout: "error" + layout: "error", + mounted() { + if (this.error.statusCode === 404) { + this.$router.push(this.localePath("/")) + } + } } </script> diff --git a/package.json b/package.json index 916c741f3d221123d8ff21b3e1399dcc1122df70..912d34500bf73a1c49e22175f17cec0ec5fbd7f7 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "trad": "sh ./utils/findMissingI18nKeys.sh", "build": "npm-run-all -p build-fragment nuxt-build", "start": "npm-run-all -p build-fragment nuxt-start", - "generate": "npm-run-all -p build-fragment nuxt-generate", + "generate": "npm-run-all -p build-fragment nuxt-generate && cp ./web-ext/* ./dist/", "analyze": "nuxt build --analyze", "build-fragment": "node graphql/schemaQuery.js", "nuxt-build": "nuxt build", diff --git a/web-ext/launch-web-ext.js b/web-ext/launch-web-ext.js new file mode 100644 index 0000000000000000000000000000000000000000..75048cc32444cf5f453dfae821076ae6feed453d --- /dev/null +++ b/web-ext/launch-web-ext.js @@ -0,0 +1,7 @@ +function openPage() { + browser.tabs.create({ + url: "/fr/index.html" + }); +} + +browser.browserAction.onClicked.addListener(openPage); diff --git a/web-ext/manifest.json b/web-ext/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..536c69cc24e55018a4db695a0340d352678c463c --- /dev/null +++ b/web-ext/manifest.json @@ -0,0 +1,19 @@ +{ + "manifest_version": 2, + "name": "Wotwizard UI", + "description": "Le magicien de la toile de confiance", + "version": "1.0.0", + "homepage_url": "https://wotwizard.axiom-team.fr", + "browser_action": { + "browser_style": true, + "default_icon": "/_nuxt/icons/icon_64x64.0424c5.png", + "default_title": "Wotwizard UI" + }, + "background" : { + "scripts": ["/launch-web-ext.js"] + }, + "icons": { + "64": "/_nuxt/icons/icon_64x64.0424c5.png", + "120": "/_nuxt/icons/icon_120x120.0424c5.png" + } +}