New issue
Advanced search Search tips

Issue 607353 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Canceling Re-enable prompt when enabling an extension turns the enabled checkbox checked

Project Member Reported by lazyboy@chromium.org, Apr 27 2016

Issue description

Steps:
1. Make it so that an extension gets disabled because of permission increase after update.
2. Try to enable the extension from chrome://extensions by clicking "Enable" checkbox for the extension, you'd see a Re-enable prompt with an option to "Cancel" or "Re-enable".
3. Press "Cancel", notice that the checkbox stays incorrectly checked, even though the extension wasn't enabled.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bb4de91c987389a932a7f0b9afad8f4031efaa9b

commit bb4de91c987389a932a7f0b9afad8f4031efaa9b
Author: lazyboy <lazyboy@chromium.org>
Date: Thu Apr 28 00:26:59 2016

Fix an issue in checkbox handler to enable extension.

The code is supposed to preventDefault() always and update the
checkbox's state when enabling/disabling result comes back from
management API call. However, this uses <input>'s onchange event
handler to preventDefault() and onchange event is not cancelable
(https://developer.mozilla.org/en-US/docs/Web/Events/change),
so calling preventDefault() has no effect.

This regressed in
https://codereview.chromium.org/893453002/diff/300001/chrome/browser/resources/extensions/extension_list.js
as I understand.

The issue is a bit serious when user tries to enable a permission
increased extension. Enabling permission increased extension results
in showing a "Re-enable" prompt. Because the preventDefault() code
was busted, it will keep showing that the extension is "Enabled" even
if you cancel the "Re-enable" prompt.

This CL fixes the issue.

BUG= 607353 
Test=a) Update an extension so it has more permissions now and it shows
"extension was disabled due to permission increase" warning.
b) Try to enable the extension from chrome://extensions, it will
show you a "Cancel"/"Re-enable" prompt.
c) Hit "Cancel". Without this change, you'd see that extension's Enable
checkbox gets checked incorrectly. With this CL, you'd see that
the "Enable" checkbox stays unchecked.

I've also tested enabling extension with:
a. click/mousedown with a mouse on desktop
b. tap on chromebook pixel
c. screenreader: with OSX voiceover. (cmd+f5 to turn on voice over, tab to select the checkbox, ctrl+option+space to select/deselect the checkbox).
d. keyboard: focus the checkbox and press space.
In *all* of the above cases, a "click" event gets dispatched, so this should not break anything.

Review-Url: https://codereview.chromium.org/1920153002
Cr-Commit-Position: refs/heads/master@{#390252}

[modify] https://crrev.com/bb4de91c987389a932a7f0b9afad8f4031efaa9b/chrome/browser/resources/extensions/extension_list.js

Status: Fixed (was: Started)

Sign in to add a comment