%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/firefox/current/usr/lib/firefox/browser/features/
Upload File :
Create Path :
Current File : //snap/firefox/current/usr/lib/firefox/browser/features/webcompat-reporter@mozilla.org.xpi

PK
!<�ё{33chrome.manifestlocale report-site-issue en-US en-US/locale/en-US/
PK
!<�K88
background.js/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

/* globals browser */

const desktopReporterConfig = {
  src: "desktop-reporter",
  utm_campaign: "report-site-issue-button",
  utm_source: "desktop-reporter",
};

const androidReporterConfig = {
  src: "android-components-reporter",
  utm_campaign: "report-site-issue-button",
  utm_source: "android-components-reporter",
};

const getReporterConfig = (() => {
  let promise;
  return async () => {
    promise ??= new Promise(resolve => {
      browser.permissions
        .contains({ permissions: ["nativeMessaging"] })
        .then(needProductName => {
          if (needProductName) {
            const port = browser.runtime.connectNative(
              "mozacWebcompatReporter"
            );
            port.onMessage.addListener(message => {
              if ("productName" in message) {
                androidReporterConfig.productName = message.productName;
                androidReporterConfig.extra_labels = [
                  `browser-${message.productName}`,
                ];
                resolve(androidReporterConfig);

                // For now, setting the productName and extra_labels is the only use for this port,
                // and that's only happening once after startup, so let's disconnect the port when we're done.
                port.disconnect();
              }
            });
          } else {
            resolve(desktopReporterConfig);
          }
        });
    });
    return promise;
  };
})();

async function loadTab(url) {
  const newTab = await browser.tabs.create({ url });
  return new Promise(resolve => {
    const listener = (tabId, changeInfo, tab) => {
      if (
        tabId == newTab.id &&
        tab.url !== "about:blank" &&
        changeInfo.status == "complete"
      ) {
        browser.tabs.onUpdated.removeListener(listener);
        resolve(newTab);
      }
    };
    browser.tabs.onUpdated.addListener(listener);
  });
}

async function captureAndSendReport(tab) {
  const { id, url } = tab;
  try {
    const { endpointUrl, webcompatInfo } =
      await browser.tabExtras.getWebcompatInfo(id);
    const reporterConfig = await getReporterConfig();
    const dataToSend = {
      endpointUrl,
      reportUrl: url,
      reporterConfig,
      webcompatInfo,
    };
    const newTab = await loadTab(endpointUrl);
    browser.tabExtras.sendWebcompatInfo(newTab.id, dataToSend);
  } catch (err) {
    console.error("WebCompat Reporter: unexpected error", err);
  }
}

if ("helpMenu" in browser) {
  // desktop
  browser.helpMenu.onHelpMenuCommand.addListener(captureAndSendReport);
} else {
  // Android
  browser.pageAction.onClicked.addListener(captureAndSendReport);
}
PK
!<���__'en-US/locale/en-US/webcompat.properties
wc-reporter.label2=Report Site Issue…
wc-reporter.tooltip=Report a site compatibility issue
PK
!<��W�experimentalAPIs/helpMenu.js/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

/* global ExtensionAPI, ExtensionCommon, Services */

const TOPIC = "report-site-issue";

this.helpMenu = class extends ExtensionAPI {
  getAPI(context) {
    const { tabManager } = context.extension;
    let EventManager = ExtensionCommon.EventManager;

    return {
      helpMenu: {
        onHelpMenuCommand: new EventManager({
          context,
          name: "helpMenu",
          register: fire => {
            let observer = subject => {
              let nativeTab = subject.wrappedJSObject;
              let tab = tabManager.convert(nativeTab);
              fire.async(tab);
            };

            Services.obs.addObserver(observer, TOPIC);

            return () => {
              Services.obs.removeObserver(observer, TOPIC);
            };
          },
        }).api(),
      },
    };
  }
};
PK
!<:����experimentalAPIs/helpMenu.json[
  {
    "namespace": "helpMenu",
    "events": [
      {
        "name": "onHelpMenuCommand",
        "type": "function",
        "async": "callback",
        "description": "Fired when the command event for the Report Site Issue menuitem in Help is fired.",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "tab",
                "$ref": "tabs.Tab",
                "optional": true,
                "description": "Details about the selected tab in the window where the menuitem command fired."
              }
            ]
          }
        ]
      }
    ]
  }
]
PK
!<�J�:experimentalAPIs/tabExtras.js/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

/* global ExtensionAPI */

const lazy = {};

const DEFAULT_NEW_REPORT_ENDPOINT = "https://webcompat.com/issues/new";
const NEW_REPORT_ENDPOINT_PREF =
  "ui.new-webcompat-reporter.new-report-endpoint";

this.tabExtras = class extends ExtensionAPI {
  getAPI(context) {
    const { tabManager } = context.extension;
    const queryReportBrokenSiteActor = (tabId, name, params) => {
      const { browser } = tabManager.get(tabId);
      const windowGlobal = browser.browsingContext.currentWindowGlobal;
      if (!windowGlobal) {
        return null;
      }
      return windowGlobal.getActor("ReportBrokenSite").sendQuery(name, params);
    };
    return {
      tabExtras: {
        async getWebcompatInfo(tabId) {
          const endpointUrl = Services.prefs.getStringPref(
            NEW_REPORT_ENDPOINT_PREF,
            DEFAULT_NEW_REPORT_ENDPOINT
          );
          const webcompatInfo = await queryReportBrokenSiteActor(
            tabId,
            "GetWebCompatInfo"
          );
          return {
            webcompatInfo,
            endpointUrl,
          };
        },
        async sendWebcompatInfo(tabId, info) {
          console.error(info);
          return queryReportBrokenSiteActor(
            tabId,
            "SendDataToWebcompatCom",
            info
          );
        },
      },
    };
  }
};
PK
!<��N�>>experimentalAPIs/tabExtras.json[
  {
    "namespace": "tabExtras",
    "description": "experimental tab API extensions",
    "functions": [
      {
        "name": "getWebcompatInfo",
        "type": "function",
        "description": "Gets the content blocking status and script log for a given tab",
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0
          }
        ],
        "async": true
      },
      {
        "name": "sendWebcompatInfo",
        "type": "function",
        "description": "Sends the given webcompat info to the given tab",
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0
          },
          {
            "type": "any"
          }
        ],
        "async": true
      }
    ]
  }
]
PK
!<��;s��icons/lightbulb.svg<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="context-fill" fill-opacity="context-fill-opacity">
  <path d="M5.625 16a.625.625 0 0 1 0-1.25l4.75 0a.625.625 0 0 1 0 1.25l-4.75 0z"/>
  <path d="m9.534 13-3.068 0a1.621 1.621 0 0 1-1.601-1.348l-.34-1.956C2.966 8.493 2.226 6.515 2.592 4.488 2.983 2.322 4.685.566 6.828.119c1.66-.343 3.352.062 4.642 1.111a5.482 5.482 0 0 1-.041 8.549l-.294 1.873A1.622 1.622 0 0 1 9.534 13zm.369-1.561.341-1.958c.046-.264.188-.504.402-.676 1.019-.818 1.603-2.022 1.603-3.306s-.572-2.487-1.569-3.298a4.247 4.247 0 0 0-2.692-.95c-.3 0-.604.03-.907.094-1.648.342-2.958 1.695-3.259 3.366a4.214 4.214 0 0 0 1.53 4.093c.215.172.358.413.404.678l.34 1.956.37.312 3.067 0 .37-.311z"/>
</svg>
PK
!<$�˜��
manifest.json{
  "manifest_version": 2,
  "name": "WebCompat Reporter",
  "description": "Report site compatibility issues on webcompat.com",
  "author": "Thomas Wisniewski <twisniewski@mozilla.com>",
  "version": "2.1.0",
  "homepage_url": "https://github.com/mozilla/webcompat-reporter",
  "browser_specific_settings": {
    "gecko": {
      "id": "webcompat-reporter@mozilla.org"
    }
  },
  "experiment_apis": {
    "helpMenu": {
      "schema": "experimentalAPIs/helpMenu.json",
      "parent": {
        "scopes": ["addon_parent"],
        "script": "experimentalAPIs/helpMenu.js",
        "paths": [["helpMenu"]]
      }
    },
    "tabExtras": {
      "schema": "experimentalAPIs/tabExtras.json",
      "parent": {
        "scopes": ["addon_parent"],
        "script": "experimentalAPIs/tabExtras.js",
        "paths": [["tabExtras"]]
      }
    }
  },
  "icons": {
    "16": "icons/lightbulb.svg",
    "32": "icons/lightbulb.svg",
    "48": "icons/lightbulb.svg",
    "96": "icons/lightbulb.svg",
    "128": "icons/lightbulb.svg"
  },
  "permissions": ["tabs", "<all_urls>"],
  "background": {
    "persistent": false,
    "type": "module",
    "scripts": ["background.js"]
  }
}
PK
!<�ё{33��chrome.manifestPK
!<�K88
��`background.jsPK
!<���__'���en-US/locale/en-US/webcompat.propertiesPK
!<��W���gexperimentalAPIs/helpMenu.jsPK
!<:�������experimentalAPIs/helpMenu.jsonPK
!<�J�:���experimentalAPIs/tabExtras.jsPK
!<��N�>>��experimentalAPIs/tabExtras.jsonPK
!<��;s�����icons/lightbulb.svgPK
!<$�˜��
��~!manifest.jsonPK		wC&

Zerion Mini Shell 1.0