-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
clients(extension): firefox #10332
clients(extension): firefox #10332
Changes from all commits
6714c38
954e52e
a4bb1f2
405462f
c1bbfce
8b93709
6a7b673
5e3ad1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,19 @@ const SettingsController = require('./settings-controller.js'); | |
|
||
const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer/'; | ||
const optionsVisibleClass = 'main--options-visible'; | ||
// Replaced with 'chrome' or 'firefox' in the build script. | ||
/** @type {string} */ | ||
const BROWSER_BRAND = '___BROWSER_BRAND___'; | ||
|
||
const CHROME_STRINGS = { | ||
localhostErrorMessage: 'Use DevTools to audit pages on localhost.', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the future, if we want to support i18n pulling these out to |
||
}; | ||
|
||
const FIREFOX_STRINGS = { | ||
localhostErrorMessage: 'Use the Lighthouse Node CLI to audit pages on localhost.', | ||
}; | ||
|
||
const STRINGS = BROWSER_BRAND === 'chrome' ? CHROME_STRINGS : FIREFOX_STRINGS; | ||
|
||
/** | ||
* Guaranteed context.querySelector. Always returns an element or throws if | ||
|
@@ -120,7 +133,7 @@ function getSiteUrl() { | |
|
||
const url = new URL(tabs[0].url); | ||
if (url.hostname === 'localhost') { | ||
reject(new Error('Use DevTools to audit pages on localhost.')); | ||
reject(new Error(STRINGS.localhostErrorMessage)); | ||
} else if (/^(chrome|about)/.test(url.protocol)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any firefox specific urls we need to include here now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
reject(new Error(`Cannot audit ${url.protocol}// pages.`)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Firefox, |
||
} else { | ||
|
@@ -134,7 +147,11 @@ function getSiteUrl() { | |
* Initializes the popup's state and UI elements. | ||
*/ | ||
async function initPopup() { | ||
fillDevToolsShortcut(); | ||
if (BROWSER_BRAND === 'chrome') { | ||
fillDevToolsShortcut(); | ||
} | ||
const browserBrandEl = find(`.browser-brand--${BROWSER_BRAND}`); | ||
browserBrandEl.classList.remove('hidden'); | ||
|
||
const mainEl = find('main'); | ||
const optionsEl = find('.button--configure'); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,7 @@ npm publish | |
# Publish viewer. | ||
yarn deploy-viewer | ||
|
||
# Publish the extension (if it changed). | ||
# Publish the extensions (if it changed). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there firefox specific instructions so that someone can release this? Or will that be handled in a follow up once this has landed and can be released for the first time? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't uploaded to the FF store before, so IDK. I'll update when I do. |
||
open https://chrome.google.com/webstore/developer/edit/blipmdconlkpinefehnmjammfjpmpbjk | ||
cd dist/extension-package/ | ||
echo "Upload the package zip to CWS dev dashboard..." | ||
|
@@ -151,6 +151,8 @@ echo "Upload the package zip to CWS dev dashboard..." | |
# Select `lighthouse-X.X.X.X.zip` | ||
# _Publish_ at the bottom | ||
|
||
# For Firefox: https://addons.mozilla.org/en-US/developers/addon/google-lighthouse/versions/submit/ | ||
|
||
# * Tell the world!!! * | ||
echo "Complete the _Release publicity_ tasks documented above" | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is simpler to use. just always package.