Skip to content

Conversation

jhadev
Copy link
Collaborator

@jhadev jhadev commented Jul 16, 2022

changed this code to avoid empty arrays without objects with 'name' property

const scripts = { firstParty: [{ name: "no data" }], thirdParty: [{ name: "no data" }], }; if (first.length) { scripts.firstParty = first; } if (third.length) { scripts.thirdParty = third; } return scripts 

Tested by running on apple.com which has no third party scripts. Note timing script does not fail.

pic-Google Chrome-Apple-07-152022 2

Previous snippet caused this error on apple.com

pic-Google Chrome-Buy 14-inch MacBook Pro - Apple-07-162022

@jhadev jhadev linked an issue Jul 16, 2022 that may be closed by this pull request
@jhadev jhadev requested a review from nucliweb July 16, 2022 02:50
@jhadev jhadev added the bug Something isn't working label Jul 16, 2022
@jhadev
Copy link
Collaborator Author

jhadev commented Jul 18, 2022

Cleaned up .gitignore, only beta and .DS_Store are in there now.

Copy link
Owner

@nucliweb nucliweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

.gitignore Outdated
other.js
.DS_Store
.DS_Store
long-tasks.js
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think to add a "beta" o "canary" folder to add the WIP scripts instead of adding a new file to gitignore every time?

@nucliweb nucliweb merged commit a1cbe10 into main Jul 18, 2022
@nucliweb nucliweb deleted the fix-script-info-timings branch July 18, 2022 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

2 participants