-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a "working" graphic and a periodically updating status message to indicate progress during analysis. Did not add an explicit progress bar as hints run in parallel and we don't have a clear indicator of how long a scan will take. Also clean up some dead code and variable names. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Fix #1667 Close #1709
- Loading branch information
Showing
8 changed files
with
131 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/extension-browser/src/devtools/panel/utils/inspire.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const messages = [ | ||
`78.6% of websites use a JS library with known vulnerabilities`, | ||
`The average load time for mobile sites is 19 seconds over 3G connections`, | ||
`53% of mobile site visits are abandoned if pages take longer than 3 seconds to load`, | ||
`84% of websites perform a redirect for at least one resource`, | ||
`97.5% of sites forget to compress one or more resources`, | ||
`72.8% of sites compress at least one resource they shouldn't`, | ||
`52% of resources aren't cacheable`, | ||
`The median site size is 1,731KB`, | ||
`1MB of JavaScript takes more time to process than 1MB of a JPEG file` | ||
]; | ||
|
||
let remaining = [...messages]; | ||
|
||
const inspire = (): string => { | ||
if (!remaining.length) { | ||
remaining = [...messages]; | ||
} | ||
|
||
const index = Math.floor(Math.random() * remaining.length); | ||
|
||
return remaining.splice(index, 1)[0]; | ||
}; | ||
|
||
export default inspire; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
declare const browser: typeof chrome; | ||
|
||
// Normalize access to extension APIs across browsers. | ||
const b: typeof chrome = typeof browser !== 'undefined' ? browser : chrome; | ||
const _browser: typeof chrome = typeof browser !== 'undefined' ? browser : chrome; | ||
|
||
// Include references to web browser globals to facilitate mocks during testing. | ||
const d = document; | ||
const e = eval; // eslint-disable-line | ||
const f = fetch; | ||
const l = location; | ||
const w = window; | ||
const _document = document; | ||
const _eval = eval; // eslint-disable-line no-eval | ||
const _fetch = fetch; | ||
const _location = location; | ||
const _window = window; | ||
|
||
export { | ||
b as browser, | ||
d as document, | ||
e as eval, | ||
f as fetch, | ||
l as location, | ||
w as window | ||
_browser as browser, | ||
_document as document, | ||
_eval as eval, | ||
_fetch as fetch, | ||
_location as location, | ||
_window as window | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters