-
Notifications
You must be signed in to change notification settings - Fork 403
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 crossorigin attribute to prefetch method #423
base: main
Are you sure you want to change the base?
add crossorigin attribute to prefetch method #423
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). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@giorgiopellegrino please make sure everything is green locally and add a new test case too. |
Sorry, I forgot to run the npm run eslint-fix command and run the automatic tests. |
I decided to simplify my feature by adding only the boolean parameter addCrossorigin to the prefetch(url, isPriority, addCrossorigin) method. When set to true, this parameter adds the crossorigin=“anonymous” attribute to the prefetch link. |
.size-limit.json
Outdated
@@ -19,4 +19,4 @@ | |||
"limit": "2 kB", | |||
"gzip": 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.
There are still unrelated changes, please revert all of them
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 undid the changes in the .size-limit.json file and changed the addCrossorigin parameter from a boolean to a “crossorigin” string, so as to reduce the space during minification, as the user will be entering the value of the property.
Thank you.
Giorgio
…into xmr/prefetch-crossorigin
…pellegrino/quicklink into xmr/prefetch-crossorigin
Dear @XhmikosR , I would like to inform you that I recently performed a pull procedure from the main branch in order to keep the xmr/prefetch-crossorigin branch aligned with the same main branch. I would appreciate any instructions regarding the next steps to be taken or if it is necessary to wait for certain developments before proceeding with merging my branch on the main branch, so to approve the PR. I thank you in advance for the valuable information you would like to share. Sincerely, Giorgio |
@XhmikosR thanks for all your help on this PR so far! @addyosmani FYI |
Hi. I added a new boolean parameter to the
prefetch(url, isPriority, isCrossorigin)
method.When isCrossorigin is true, XHR calls will occur with mode: “cors”, and prefetch will add the crossorigin=“anonymous” attribute to the link element.
On the other hand, if isCorssorigin is false (default value), XHR calls will occur with credentials: “include”, and the prefetch will add the crossorigin=“use-credentials” attribute to the link element.
I hope this feature will be useful as well as to me to the whole community.
Thank you!
Giorgio