Service worker registration

Bringing the shields down without first turning “Block scripts” off makes it impossible to register a service worker.

  1. Navigate to “https://googlechrome.github.io/samples/service-worker/custom-offline-page/” with the shields up and “Block scripts” on: the page tries to register a service worker, but the service worker cannot be registered. This is expected, since the scripts are blocked.
  2. Turn “Block scripts” off and reload the page: the service worker is registered; this is expected, since the scripts are not blocked.
  3. Finally, unregister the service worker, turn “Block scripts” on, bring the shields down and reload the page: the service worker registration fails with the message “Failed to register a ServiceWorker …: The user denied permission to use Service Worker.”

Since scripts are not blocked when the shields are down, wouldn’t the expected result be that the service worker be registered?

Version 1.77.100 Chromium: 135.0.7049.100 (Official Build) (64-bit)

With Brave Shields UP and “Block scripts” ON . . .

A) In a Brave Browser New Window, go to the On exit tab at: brave://settings/clearBrowserData

Make sure that both Cookies and other site data and Site and Shields Settings are DISABLED (Maybe also DISABLE Passwords and other sign-in data ← your option) (I am using a generic screenshot, just to make clear where things are):

Exit / Quit everything and RESTART the computer.


B) Next, in a Brave Browser New Window, visit https://googlechrome.github.io and click the “tune” icon that is immediately to the left of http in the URL Address field
Tune_button_left_offset_of_URL_address_field

Click Site settings in the pop-down menu.

In the resulting window, scroll down to the JavaScript setting and set that to Allow

JavaScript__Allow


C) Next, in a Brave Browser New Window, go to brave://settings/content/javascript

Scroll down that javascript settings page to Allowed to use javascript

Click the Add button

Enter or verify (ie already entered): [*.]github.io as the site . . . but do not Enable the following: Current Private session only

Click the Add button


D) Using a Brave Browser New Window, visit again: https://googlechrome.github.io

In the Site-Specific Brave Shields settings (click the Brave Lion icon to the right of the URL Address field), set Trackers & Ads to Standard.

Go to: https://googlechrome.github.io/samples/service-worker/custom-offline-page/

Verify that Trackers & Ads is still set to Standard. Try to register as you planned.