Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show consent screen only when the browser is Firefox #60

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

mrts
Copy link
Member

@mrts mrts commented Jul 13, 2023

WE2-789

@mrts mrts requested review from taneltm and metsma July 13, 2023 18:08
@mrts
Copy link
Member Author

mrts commented Jul 13, 2023

As a result, only dist/firefox has the _locales and views directories and the following in the end of background.js:

    browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
        if (message.action) {
            onAction(message, sender).then(sendResponse);
        }
        else if (message.type) {
            onTokenSigningAction(message, sender).then(sendResponse);
        }
        return true;
    });
    async function showConsent() {
        const url = browser.runtime.getURL("views/installed.html");
        return await browser.tabs.create({ url, active: true });
    }
    browser.runtime.onInstalled.addListener(async ({ reason, temporary }) => {
        if (temporary)
            return;
        if (reason == "install") {
            await showConsent();
        }
    });

})();

Chrome background.js end looks as follows (does not contain showConsent() or browser.runtime.onInstalled.addListener():

    browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
        if (message.action) {
            onAction(message, sender).then(sendResponse);
        }
        else if (message.type) {
            onTokenSigningAction(message, sender).then(sendResponse);
        }
        return true;
    });

})();

@mrts mrts force-pushed the show-consent-only-in-firefox-v2 branch 3 times, most recently from ae61247 to 1d35195 Compare July 14, 2023 11:39
@mrts mrts force-pushed the show-consent-only-in-firefox-v2 branch from 1d35195 to 1d14db7 Compare July 25, 2023 16:36
@mrts mrts force-pushed the show-consent-only-in-firefox-v2 branch from 1d14db7 to de7e078 Compare July 25, 2023 16:40
@mrts mrts merged commit 1fe5b31 into main Jul 25, 2023
@mrts mrts deleted the show-consent-only-in-firefox-v2 branch July 25, 2023 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants