-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix(content-script): retrieve href through getAttribute
#472
Conversation
Extension builds preview
|
if (!href) | ||
throw new Error('Monetization link is missing the "href" attribute.') |
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.
if (!href) | |
throw new Error('Monetization link is missing the "href" attribute.') | |
if (!href) { | |
throw new Error('Monetization link is missing the "href" attribute.') | |
} |
throw new Error('Monetization link is missing the "href" attribute.') | ||
checkWalletAddressUrlFormat(href) | ||
const response = await checkWalletAddressUrlCall({ | ||
walletAddressUrl: href |
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.
We could have whitespace here. Why not do the .trim()
part here only (when assigning href
)?
@@ -220,7 +220,7 @@ export class MonetizationTagManager extends EventEmitter { | |||
record.type === 'attributes' && | |||
record.attributeName === 'href' && | |||
target instanceof HTMLLinkElement && | |||
target.href !== record.oldValue | |||
target.getAttribute('href') !== record.oldValue |
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.
Is oldValue
equivalent to getAttribute()
or the property one?
Also, do we disallow protocol relative URls this way here or should only via the https://
check below?
Closing this for now - context: #473 (comment). |
Context
Closes #.
Changes proposed in this pull request