New issue
Advanced search Search tips

Issue 767157 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Audit Chrome OS Settings UI for proper use of AllowJavascript

Project Member Reported by steve...@chromium.org, Sep 20 2017

Issue description

There are several anti-patterns for the use of AllowJavascript in CrOS Settings WebUI handlers. We should fix these to follow the following guidelines:

1. In general, AllowJavascript should be called by C++ handlers that respond with a JS call (note: not in the response). This makes it clear that JS is allowed at a point when the Web UI is able to respond to the JS call.

2. If JS calls are invoked from observer methods, the WbeUI must make a JS call into the C++ code to indicate that it is ready (in Polymer this is typically in the attached() or ready() method). 
2a. The handler method for the call should call AllowJavascrpt.
2b. The first AllowJavascrpt() call will trigger OnJavascriptallowed() which should set up any observers.

 

Comment 1 by dpa...@chromium.org, Sep 20 2017

Cc: tommycli@chromium.org

Comment 2 by dpa...@chromium.org, Sep 20 2017

Components: UI>Browser>WebUI
Status: Fixed (was: Started)

Comment 5 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Comment 6 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)

Sign in to add a comment