Closed Bug 1133000 Opened 9 years ago Closed 9 years ago

Expose the protected-mode toggle in the Firefox UI

Categories

(Firefox :: General, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 38
Tracking Status
firefox38 --- fixed

People

(Reporter: benjamin, Assigned: benjamin)

References

Details

Attachments

(2 files, 1 obsolete file)

Currently we have a hook which disabled Flash protected mode, but no UI to expose this to users.

Since turning protected mode off for all users may be a security risk we are unwilling to bear, we are considering offering users a way to opt into this option if/when they experience a Flash hang. It may also be a useful option for users with screen readers or other accessibility tools, since those often cause Flash issues.

Once we do that, we still want to have a UI-exposed way to reverse that decision. That is what this bug tracks.

I am looking for a fast turnaround for this, since it may be something we will want to uplift into 37.
Attachment #8564285 - Flags: ui-review?(psackl)
Blocks: 1133003
Attached patch bug1133000-flash-toggle.patch (obsolete) — Splinter Review
Matt, this is intended as a code review while UX review of the strings is still pending.
Attachment #8564313 - Flags: review?(MattN+bmo)
Comment on attachment 8564313 [details] [diff] [review]
bug1133000-flash-toggle.patch

Review of attachment 8564313 [details] [diff] [review]:
-----------------------------------------------------------------

r=me but I'm not that familiar with this code so you may want Blair to also take a look.

::: toolkit/mozapps/extensions/internal/PluginProvider.jsm
@@ +89,5 @@
> +        // Protected mode is win32-only, not win64
> +        let showProtectedModePref = plugin.isFlashPlugin &&
> +          Services.appinfo.XPCOMABI == "x86-msvc";
> +        aSubject.getElementById("pluginDisableProtectedMode")
> +          .setAttribute("collapsed", showProtectedModePref ? "" : "true");

I initially wondered if this could cause unintentionally changing the pref while viewing a non-Flash plugin and having the pref flipped from other code. I thought that maybe we save the pref upon navigation but it seems like the pref changes live with the checkbox so this shouldn't be a problem.

Nit: I'm unsure if this is the preferred indentation style for the module as I don't see another line that had to do similar wrapping and I'm new to the code.

@@ +494,5 @@
>      }
>      return permissions;
>    });
> +
> +  this.isFlashPlugin = false;

I'm fine with this custom property if Blair is.
Attachment #8564313 - Flags: review?(MattN+bmo) → review+
Attachment #8564313 - Flags: feedback?(bmcbride)
Comment on attachment 8564313 [details] [diff] [review]
bug1133000-flash-toggle.patch

Review of attachment 8564313 [details] [diff] [review]:
-----------------------------------------------------------------

Sadly, I don't think we have a reliable way to test this.... normally we'd mock nsPluginHost to test PluginProvider, but we can't do that when we need a browser-chrome test. And normally for browser-chrome tests we use the test-plugin, which doesn't help here :\

::: toolkit/mozapps/extensions/content/pluginPrefs.xul
@@ +13,5 @@
>    <setting type="control" title="&plugin.mimeTypes;">
>      <label class="text-list" id="pluginMimeTypes"/>
>    </setting>
> +  <setting type="bool" pref="dom.ipc.plugins.flash.disable-protected-mode"
> +           title="&plugin.flashProtectedMode.label;" id="pluginDisableProtectedMode">

As a general rule, checking a checkbox to disable something confuses people. It's not how people expect checkboxes to work. So the label here should be "Enable XYZ". And adding inverted="true" to the <setting> will invert how the pref is read/set.

::: toolkit/mozapps/extensions/internal/PluginProvider.jsm
@@ +494,5 @@
>      }
>      return permissions;
>    });
> +
> +  this.isFlashPlugin = false;

I'm not fine with a custom property :)

Can use a closure for optionsType, and observe() is already iterating over pluginMimeTypes.

@@ +496,5 @@
>    });
> +
> +  this.isFlashPlugin = false;
> +  for (let type of this.pluginMimeTypes) {
> +    if (type.type == "application/x-shockwave-flash") {

Make this a const at the top of the file? Makes it more obvious that we're special-casing Flash - going to be too easy to miss otherwise.
Attachment #8564313 - Flags: feedback?(bmcbride) → review-
Blair, I don't have final strings from UX, and so I haven't yet made the change about an inverted pref, but I believe this covers your other concerns. Please review the rest and I'll get final strings with UX tomorrow for landing.
Attachment #8566692 - Flags: review?(bmcbride)
Comment on attachment 8566692 [details] [diff] [review]
bug1133000-flash-toggle.patch

Review of attachment 8566692 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with pref inversion/strings proviso.
Attachment #8566692 - Flags: review?(bmcbride) → review+
Attachment #8564313 - Attachment is obsolete: true
re: the issue of this making a positive checkbox state represent a negative state (i.e. check to disable" -- why don't we change the string to "Enable Adobe Flash protected mode" and make the corresponding inversion when we check the box.
Also - can we strike the grey explanatory text and replace it with a "Learn More" link to the same content we use from the infobar? The trade-off needs more context in its explanation, and that's what we're providing on the Learn More page.
(In reply to Madhava Enros [:madhava] from comment #6)
> re: the issue of this making a positive checkbox state represent a negative
> state (i.e. check to disable" -- why don't we change the string to "Enable
> Adobe Flash protected mode" and make the corresponding inversion when we
> check the box.

sorry - that's ambiguous -- we should just make the checkbox do the right thing, given the new string.
Component: Plug-ins → General
Product: Core → Firefox
Attachment #8564285 - Flags: ui-review?(psackl)
https://hg.mozilla.org/mozilla-central/rev/886bc136c20b
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
Clicking 'Learn More' which is shown in 'Blue' as if its a link goes to Mozilla Page not Found error.

Intended or ?
(In reply to Jim Jeffery not reading bug-mail 1/2/11 from comment #10)
> Clicking 'Learn More' which is shown in 'Blue' as if its a link goes to
> Mozilla Page not Found error.
> 
> Intended or ?

forgot to include URL: https://support.mozilla.org/en-US/kb/flash-protected-mode-settings
Yes, the page doesn't exist yet but it will.
Depends on: 1147877
Depends on: 1181540
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: