Skip to content

core: use mainDocumentUrl instead of finalUrl #13793

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

Merged
merged 15 commits into from
Apr 5, 2022
Merged

core: use mainDocumentUrl instead of finalUrl #13793

merged 15 commits into from
Apr 5, 2022

Conversation

adamraine
Copy link
Member

@adamraine adamraine commented Mar 29, 2022

Part 2 of #13706

There are still many usages of finalUrl in a few situations:

  • finalUrl is being used to get the origin of the page
  • finalUrl is being used as the base for another URL
  • finalUrl is being used as the displayed URL but not used for any calculations

@adamraine adamraine requested a review from a team as a code owner March 29, 2022 21:51
@adamraine adamraine requested review from connorjclark and removed request for a team March 29, 2022 21:51
const content = stylesheet.content;
const totalTokenLength = UnminifiedCSS.computeTokenLength(content);

let url = stylesheet.header.sourceURL;
if (!url || url === pageUrl) {
if (!url || stylesheet.header.isInline) {
const contentPreview = UnusedCSS.determineContentPreview(stylesheet.content);
url = contentPreview;
Copy link
Collaborator

Choose a reason for hiding this comment

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

(unrelated to pr) ugh we shouldn't be putting non-url strings in url fields. third party filter wont like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants