From 2c35db7797275a03ab5972da7c3ecb915def3a12 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 3 Jun 2020 16:34:00 +0530 Subject: fix zip, get rid of content script remains --- rollup.config.js | 33 -------- src/webex/notify.ts | 218 --------------------------------------------------- webextension/pack.sh | 4 +- 3 files changed, 2 insertions(+), 253 deletions(-) delete mode 100644 src/webex/notify.ts diff --git a/rollup.config.js b/rollup.config.js index 4e3666ea6..71748a864 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -150,43 +150,10 @@ const webExtensionCryptoWorker = { ], }; -const webExtensionContentScript = { - input: "dist/node/webex/notify.js", - output: { - file: "dist/webextension/contentScript.js", - format: "iife", - exports: "default", - name: "webExtensionContentScript", - }, - external: builtins, - plugins: [ - json(), - - nodeResolve({ - preferBuiltins: true, - }), - - terser(), - - replace({ - "process.env.NODE_ENV": JSON.stringify("production"), - }), - - commonjs({ - include: ["node_modules/**", "dist/node/**"], - extensions: [".js"], - ignoreGlobal: false, // Default: false - sourceMap: false, - ignore: ["taler-wallet"], - }), - ], -}; - export default [ walletCli, walletAndroid, webExtensionPageEntryPoint, webExtensionBackgroundPageScript, webExtensionCryptoWorker, - webExtensionContentScript, ]; diff --git a/src/webex/notify.ts b/src/webex/notify.ts deleted file mode 100644 index 9fb0529db..000000000 --- a/src/webex/notify.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - This file is part of TALER - (C) 2015 GNUnet e.V. - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see - */ - -// tslint:disable:no-unused-expression - -/** - * Module that is injected into (all!) pages to allow them - * to interact with the GNU Taler wallet via DOM Events. - */ - -/** - * Imports. - */ -import * as wxApi from "./wxApi"; - -declare let cloneInto: any; - -let logVerbose = false; -try { - logVerbose = !!localStorage.getItem("taler-log-verbose"); -} catch (e) { - // can't read from local storage -} - -if (document.documentElement.getAttribute("data-taler-nojs")) { - document.dispatchEvent(new Event("taler-probe-result")); -} - -interface Handler { - type: string; - listener: (e: Event) => void | Promise; -} -const handlers: Handler[] = []; - -let sheet: CSSStyleSheet | null; - -function initStyle(): void { - logVerbose && console.log("taking over styles"); - const name = "taler-presence-stylesheet"; - const content = "/* Taler stylesheet controlled by JS */"; - let style = document.getElementById(name) as HTMLStyleElement | null; - if (!style) { - style = document.createElement("style"); - // Needed by WebKit - style.appendChild(document.createTextNode(content)); - style.id = name; - document.head.appendChild(style); - sheet = style.sheet as CSSStyleSheet; - } else { - // We've taken over the stylesheet now, - // make it clear by clearing all the rules in it - // and making it obvious in the DOM. - if (style.tagName.toLowerCase() === "style") { - style.innerText = content; - } - if (!style.sheet) { - throw Error( - "taler-presence-stylesheet should be a style sheet ( or