Skip to content
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

Unable to disable the Scripts blocked after upgrade to 0.68.133 #5973

Closed
GeetaSarvadnya opened this issue Sep 10, 2019 · 9 comments · Fixed by brave/brave-core#3405
Closed

Comments

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Sep 10, 2019

Description

Unable to disable the Scripts blocked after upgrade to 0.68.33

Steps to Reproduce

  1. Clean profile 0.68.132
  2. Open https://brianbondy.com/
  3. Open BR panel and enable the scripts for https://brianbondy.com/
  4. Upgrade to 0.68.133
  5. Try disabling the Scripts blocked switch after upgrade
  6. Unable to disable the Scripts blocked after upgrade to 0.68.33

Actual result:

image

disable scripts not possible after upgrade

Expected result:

Should be able to disable the Scripts blocked after upgrade to 0.68.33

Reproduces how often:

Always

Brave version (brave://version info)

Brave 0.68.133 Chromium: 77.0.3865.65 (Official Build) (64-bit)
Revision 87a331a3169cab563505fb44011058b904011ba1-refs/branch-heads/3865@{#726}
OS Windows 10 OS Version 1803 (Build 17134.523)

Version/Channel Information:

  • Can you reproduce this issue with the current release? No
  • Can you reproduce this issue with the beta channel? Yes
  • Can you reproduce this issue with the dev channel? Yes
  • Can you reproduce this issue with the nightly channel? Yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? NA
  • Does the issue resolve itself when disabling Brave Rewards? NA
  • Is the issue reproducible on the latest version of Chrome? NA

Miscellaneous Information:

@brave/legacy_qa

@btlechowski
Copy link

Reproduced on Ubuntu.

Steps used:

  1. Clean install 0.68.122
  2. Enable script blocking on https://brianbondy.com/
  3. Upgrade to 0.68.123
  4. Disable script blocking on https://brianbondy.com/
Brave 0.68.133 Chromium: 77.0.3865.65 (Official Build) (64-bit)
Revision 87a331a3169cab563505fb44011058b904011ba1-refs/branch-heads/3865@{#726}
OS Ubuntu 18.04 LTS

@LaurenWags
Copy link
Member

LaurenWags commented Sep 10, 2019

Reproduced on macOS using STR from description when updating from 0.68.132 to 0.68.133

Brave 0.68.133 Chromium: 77.0.3865.65 (Official Build) (64-bit)
Revision 87a331a3169cab563505fb44011058b904011ba1-refs/branch-heads/3865@{#726}
OS macOS Version 10.13.6 (Build 17G5019)

Note - close and restart of Brave did not resolve this.

Additionally, could not reproduce when updating from 0.68.131 to 0.68.132.

@LaurenWags LaurenWags added this to the 0.68.x - Release Hotfix 2 milestone Sep 10, 2019
@LaurenWags LaurenWags changed the title Unable to disable the Scripts blocked after upgrade to 0.68.33 Unable to disable the Scripts blocked after upgrade to 0.68.133 Sep 10, 2019
@LaurenWags
Copy link
Member

Found a scenario that occurs on a clean profile with 0.68.133:

  1. Clean profile with 0.68.133
  2. Visit brianbondy.com
  3. Open shields, turn on script blocking.
  4. Page loads, nothing is shown as expected.
  5. From URL bar, allow scripts.
  6. Refresh page.
  7. Page shows content as expected.
  8. Open shields again.
  9. Attempt to turn on script blocking.
    ---> Script blocking does not turn on. Page loads and shows content. Toggle for script blocking still shows as off.

script-block-068133

For comparison, here's how this works on 0.68.132:
script-block-068132

@bsclifton
Copy link
Member

Confirmed this is a regression

@bsclifton
Copy link
Member

bsclifton commented Sep 10, 2019

Also confirmed this is a bug in Nightly

Here's what's happening in the code (using use-case from Laurens post above)

  1. Clean profile with 0.68.133
  2. Visit brianbondy.com
  3. Open shields, turn on script blocking.
  4. Page loads, nothing is shown as expected.
  5. From URL bar, allow scripts.
  6. Refresh page.
  7. Page shows content as expected.
  8. Open shields again.

(in brave/components/brave_shields/browser/brave_shields_util.cc)
in the method GetNoScriptControlType:
HostContentSettingsMapFactory::GetForProfile(profile)->GetContentSetting(url, GURL(), CONTENT_SETTINGS_TYPE_JAVASCRIPT, "") is returning back CONTENT_SETTING_ALLOW

  1. Attempt to turn on script blocking.
  • React UI does receive the event
  • call is made setting to CONTENT_SETTING_BLOCK
    HostContentSettingsMapFactory::GetForProfile(profile)
      ->SetContentSettingCustomScope(
          primary_pattern, ContentSettingsPattern::Wildcard(),
          CONTENT_SETTINGS_TYPE_JAVASCRIPT, "",
          CONTENT_SETTING_BLOCK);
    
  • setting does NOT appear to be persisted (also, UI does not update)
  • page is reloaded
  • CONTENT_SETTING_ALLOW is returned again (in calls to GetNoScriptControlType())

@bsclifton
Copy link
Member

I believe I found the cause:

Here's what my content settings look like after making this change (from Default/Preferences):

{
  "profile": {
    "content_settings": {
      "exceptions": {
        "javascript": {
          "https://brianbondy.com,*": {
            "last_modified": "13212630641208984",
            "setting": 2
          },
          "https://brianbondy.com:443,*": {
            "last_modified": "13212622765957903",
            "setting": 1
          }
        }
      }
    }
  }
}

The top version (has setting 2) is what I set (block). The bottom one is what I did using the Chromium UI (allow). Only difference is the port is attached to the key

bsclifton added a commit to brave/brave-core that referenced this issue Sep 11, 2019
This fixes a regression unintentionally introduced with #3033 where port would not added (but chromium would add port when you block/unblock using omnibox)

Fixes brave/brave-browser#5973
bsclifton added a commit to brave/brave-core that referenced this issue Sep 11, 2019
This fixes a regression unintentionally introduced with #3033 where port would not added (but chromium would add port when you block/unblock using omnibox)

Fixes brave/brave-browser#5973
@bsclifton
Copy link
Member

Fixed in 0.68.x with brave/brave-core@70b326b

Still an issue in 0.69/0.70/0.71/0.72

@bsclifton
Copy link
Member

Closing as this issue is fixed in 0.68.x (there are some failing browser tests - those are being fixed right now)

@GeetaSarvadnya
Copy link
Author

GeetaSarvadnya commented Sep 12, 2019

Verification passed on

Brave 0.68.135 Chromium: 77.0.3865.75 (Official Build) (64-bit)
Revision 201e747d032611c5f2785cae06e894cf85be7f8a-refs/branch-heads/3865@{#776}
OS Windows 10 OS Version 1803 (Build 17134.523)
  • Verified the STR from the description

Verification passed on

Brave 0.68.135 Chromium: 77.0.3865.75 (Official Build) (64-bit)
Revision 201e747d032611c5f2785cae06e894cf85be7f8a-refs/branch-heads/3865@{#776}
OS Ubuntu 18.04 LTS
  • Verified the STR from the description

Verification PASSED on macOS 10.14.6 x64 using the following build:

Brave 0.68.138 Chromium: 77.0.3865.75 (Official Build) (64-bit)
Revision 201e747d032611c5f2785cae06e894cf85be7f8a-refs/branch-heads/3865@{#776}
OS macOS Version 10.14.6 (Build 18G95)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment