-
Notifications
You must be signed in to change notification settings - Fork 176
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
Only open prompt when user clicks badge #828
Conversation
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.
Self-review
@@ -268,6 +270,14 @@ function shouldBadgeBeSmall(ratioCheck, itemHeight) { | |||
return false; | |||
} | |||
|
|||
function openLoginPrompt(parent, el, htmlBadgeDiv) { |
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.
This change was required with the isTrusted
checks. I moved this function outside of the addEventListener
in-line event so that other functions could call it.
@@ -652,7 +692,7 @@ async function detectFacebookOnPage () { | |||
|
|||
// Check if user dismissed the Relay prompt | |||
const relayAddonPromptDismissed = await getLocalStorageSettingFromBackground("hideRelayEmailBadges"); | |||
if (!relayAddonEnabled && !relayAddonPromptDismissed.hideRelayEmailBadges && trackersDetectedOnCurrentPage) { | |||
if (relayAddonPromptDismissed && !relayAddonEnabled && !relayAddonPromptDismissed.hideRelayEmailBadges && trackersDetectedOnCurrentPage) { |
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 kept getting console errors using this.
To check, visit airbnb.com. You should see an email prompt (if you do not have Relay installed and have not opt'ed out of the labels)
Move prevent.default Co-authored-by: luke crouch <luke.crouch@gmail.com>
This PR solves a few different items:
isTrusted
for any click eventsnpm audit
)