-
Notifications
You must be signed in to change notification settings - Fork 407
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
Add support for same-site prerendering with Speculation Rules API #258
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
…es API limitations and ease of change once the limitations are updated
…google formatting
Co-authored-by: Domenic Denicola <d@domenic.me>
removed extra argument in the promise constructor fixed the inconsistent application of spacing throughout repo
…into speculationrules
if (/2g/.test(conn.effectiveType)) { | ||
return Promise.reject(new Error('Cannot prefetch, network conditions are poor')); | ||
} | ||
let chkConn = checkConnection(conn = navigator.connection); |
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.
It's not clear why this is assigning to the conn
parameter. Did you mean to set a default on line 201? Or just remove the conn
parameter altogether? Or do conn || navigator.connection
?
I guess this was already buggy...
* @return {Object} a Promise | ||
*/ | ||
export function prerender(urls, conn) { | ||
let chkConn = checkConnection(conn = navigator.connection); |
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.
Same problem with assigning to a parameter here.
Co-authored-by: Domenic Denicola <d@domenic.me>
Co-authored-by: Domenic Denicola <d@domenic.me>
Co-authored-by: Domenic Denicola <d@domenic.me>
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
Closes #253