-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[PM-13115] Allow users to disable extension content script injections by domain #11826
Conversation
77d3472
to
e8ddd67
Compare
Fixed Issues
|
308c302
to
2695a47
Compare
@@ -67,7 +66,6 @@ import { PopupPageComponent } from "../../../platform/popup/layout/popup-page.co | |||
JslibModule, | |||
LinkModule, | |||
PopOutComponent, | |||
PopupFooterComponent, |
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.
PopupFooterComponent
was not in use anywhere here or in the template
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 file is largely a copy of apps/browser/src/autofill/popup/settings/excluded-domains.component.ts
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 have an open bug for the existing UI here PM-13808 with the input styling. Do you think we can get that fixed so we don't duplicate the UI into this new component?
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 added a note to that ticket to include the blocked URIs view that would be introduced by this work
@@ -3,6 +3,7 @@ | |||
[ciphers]="ciphers" | |||
[title]="'autofillSuggestions' | i18n" | |||
[showRefresh]="showRefresh" | |||
[sectionIndicators]="sectionIndicators" |
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 concept allows for the conditional addition of icon indicators alongside the section title (in this case, an informational icon indicating the view contains ciphers for a domain that has been added to the user's block list).
apps/browser/src/vault/popup/components/vault/vault-v2.component.html
Outdated
Show resolved
Hide resolved
this.domainSettingsService | ||
.setBlockedInteractionsUris({ | ||
...blockedURIs, | ||
[this.autofillTabHostname]: { bannerIsDismissed: 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.
using the existing NeverDomains
data shape give us tons of flexibility in the future if we implement more granular injection-blocking options.
As it is, we could merge the neverDomains
state concept (expressed in the interface as "Excluded Domains" and currently used to allow users to block the notification bar on specified domains) into blockedInteractionsUris
concept with a state migration.
For example (not a well-considered data shape, just for illustrative purposes):
{
"banking-portal.real-tld": {
"blockedInjections": null, // all injections blocked
"dismissedMessages": ['autofillBlockedBanner']
},
"duckduckgo.com": {
"blockedInjections": ["notifications", "inline-menu"],
"dismissedMessages": []
}
}
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.
For example (not a well-considered data shape, just for illustrative purposes):
💭 You might want to update this example to account for our "no-null" guidance. If you want to keep the example short, I'd just swap out the null
for true
or "all"
(no list).
A more comprehensive example that would be easier to port to Rust (as an enum
) uses a discriminated union.
type ScriptType = "notifications" | "inline-menu";
type Injectable = { type: "allow-all" } | { type: "deny-list", injections: ScriptType[] } | { type: "deny-all" };
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.
noted; a fair point and we'll pull this into our design when we get to migrating excluded domains (or other NeverDomain concepts) in
if (!injectionAllowedInTab) { | ||
throw new Error("This URI of this tab is on the blocked domains list."); | ||
} |
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 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 is purposeful blocking, no? Do we want a visible error like this?
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 was thinking it might be helpful to have some kind of dev/console visibility in case people set a blocked domain and forget later (and then are wondering why the extension isn't working). But yeah, I think that would be better served as a warning or informational log
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.
updated in f6c1a55
1dd180e
to
ab2f085
Compare
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's a nit, but it doesn't block merge.
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 looks pretty good from a Vault's perspective and I'm excited for the feature!
I did have two suggestions for how we could better encapsulate the autofill logic and avoid adding complexity to the generic vault components. Let me know what you think!
@@ -22,6 +22,16 @@ | |||
</bit-no-items> | |||
</div> | |||
|
|||
<bit-banner |
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.
🎨 How would you feel if we encapsulated this banner in its own blocked-injection-script-banner
component? It would let us move the handleScriptInjectionIsBlockedBannerDismiss()
and showScriptInjectionIsBlockedBanner
logic out of the top-level vault.
This is a problem we have in the Web vault component today -- it has a lot of various business logic in a single component -- and I'm hoping we can avoid repeating that in the new refreshed Browser vault by breaking logic out into their own components.
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 would prefer we use content projection instead of introducing sectionIndicator
strings. We could use something like this in the template:
<h2 bitTypography="h6">
{{ title }}
<ng-content select="[slot=title-icon]"></ng-content>
</h2>
And then the autofill-vault-list-items
component could do something like:
<app-vault-list-items-container ...>
<i slot="title-icon"
*ngIf="showAutofillBlockedIndicator"
class="bwi bwi-info-circle"
[appA11yTitle]="'autofillBlockedTooltip' | i18n">
</i>
</app-vault-list-items-container>
This would help reduce the amount of bespoke autofill logic in our generic vault item components. Let me know what you think!
fe40dd8
🎟️ Tracking
PM-13115
📔 Objective
Create a concept of disabled domains for the Bitwarden extension; unlike the excluded domains in the notification settings, a page belonging to the disabled domain list would prevent the Bitwarden extension from interacting with the page at all.
Notes
block-browser-injections-by-domain
feature flagScreen capture
Kapture.2024-12-16.at.11.09.36.mp4
Kapture.2024-12-16.at.11.28.39.mp4
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes