-
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
core(scriptelements): expose id attribute for ScriptElements #9718
Conversation
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.
thanks for taking this on @uchoudh!
There are a few more places that will need updating:
- the artifacts type for
ScriptElements
. Probably helpful to leave a comment that the value will benull
if the element had noid
or ifsource
isnetwork
. - an explicit
null
id
value down in the version returned in L81-90 (noid
for those because they are js file network requests) - run
yarn update:sample-artifacts ScriptElements
to update a set of saved test artifacts to includeid
where applicable - run
yarn update:sample-json
to update any cases where the updated artifacts may affect things (I don't imagine this will end up doing anything because we don't yet useid
anywhere :)
thanks, and don't hesitate to leave a comment if you run into unexpected trouble!
First three changes are looking good. Having some trouble with Steps I took:
After these steps not sure how to use it with the lighthouse project. |
@uchoudh are you using a Mac and homebrew? I just needed to |
@patrickhulce Yes I am using a mac and homebrew. I tried the what you suggested but the problem still persists. I think it's still an error with protobuf not bring installed properly but the error message is a little different. |
@uchoudh I think some people have run into this before. Check out this comment: #9084 (comment) You can also commit what you have and one of us can run the command. Sorry for the trouble! |
Thank you. I've pushed my latest changes. |
Looks like we haven't run I reverted most of it and kept just the
with these more minimal changes to the saved artifacts, |
@googlebot I consent. |
Co-Authored-By: Brendan Kenny <bckenny@gmail.com>
oh googlebot... |
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.
LGTM, thanks @uchoudh!
@@ -109,7 +109,7 @@ module.exports = [ | |||
}, | |||
{ | |||
source: 'Runtime.exception', | |||
description: 'Error: An error\n at http://localhost:10200/dobetterweb/dbw_tester.html:57:38', | |||
description: /^Error: A distinctive error\s+at http:\/\/localhost:10200\/dobetterweb\/dbw_tester.html:\d+:\d+$/, |
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.
another annoying failure for new contributors :) Made the smoke test expectation less sensitive because we don't need to verify the exact column number
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
Thanks @uchoudh! |
Summary
This is a small feature to include the
id
attribute in the output whenScriptElements
are requested in an audit.This change makes it easier to choose a specific script and adds ease of use when writing audits.
Related Issues/PRs
This is the issue that the PR addresses. #9681