-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Update extension badge text when LH is running #1367
Conversation
@@ -90,17 +109,16 @@ window.runLighthouseForConnection = function(connection, url, options, requested | |||
// Add url and config to fresh options object. | |||
const runOptions = Object.assign({}, options, {url, config}); | |||
|
|||
lighthouseIsRunning = true; |
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.
I'd prefer to keep the explicit lighthouseIsRunning = true;
inline here and below but call a updateBadgeUI()
immediately after each.
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.
Done.
function updateBadgeUI(optUrl) { | ||
if (window.chrome && chrome.runtime) { | ||
const manifest = chrome.runtime.getManifest(); | ||
const title = optUrl ? `Testing ${optUrl}` : manifest.browser_action.default_title; |
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.
now we can use lighthouseIsRunning
for these conditionals. that work for you?
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.
done
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.
ace. thx!
thanks for merging, sorry wasn't available:) |
* Update extension badge text when LH is running * feedback * update method name * Use lighthouseIsRunning var
R: @paulirish @wardpeet all
This expands on #1185 by updating the tooltip and badge text when LH is testing a page. Makes it more obvious something is going on if the popup has been dismissed.