chromium support
Release Firefox and Chromium extensions / Package and attach browser extensions (release) Successful in 54s
Release Firefox and Chromium extensions / Package and attach browser extensions (release) Successful in 54s
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const api = typeof browser === "object" ? browser : chrome;
|
||||
|
||||
const status = document.getElementById("status");
|
||||
const toggle = document.getElementById("toggle");
|
||||
const fontStyleInputs = [...document.querySelectorAll('input[name="font-style"]')];
|
||||
@@ -39,11 +41,11 @@
|
||||
toggle.disabled = true;
|
||||
toggle.setAttribute("aria-pressed", "false");
|
||||
toggle.textContent = "Unavailable on this page";
|
||||
status.textContent = "Firefox protects this page from extensions.";
|
||||
status.textContent = "The browser protects this page from extensions.";
|
||||
}
|
||||
|
||||
async function askBackground(type, extra = {}) {
|
||||
return browser.runtime.sendMessage({ type, ...extra });
|
||||
return api.runtime.sendMessage({ type, ...extra });
|
||||
}
|
||||
|
||||
toggle.addEventListener("click", async () => {
|
||||
@@ -104,7 +106,7 @@
|
||||
|
||||
async function initialize() {
|
||||
try {
|
||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||
const tabs = await api.tabs.query({ active: true, currentWindow: true });
|
||||
if (!tabs[0] || typeof tabs[0].id !== "number") {
|
||||
showUnavailable();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user