Commit 1770465d authored by Alex Ilin's avatar Alex Ilin Committed by Commit Bot

[identity] Fix a regression in the extension remote consent flow

https://crrev.com/c/2144200 introduced a regression that broke the
javascript bridge in the remote consent flow.

"inject.js" should be injected in all pages within the consent window.
A recent change made webview.executeScript() execute only once, after
the first page is loaded.

This CL modifies 'loadstop' listener so the script is injected for all
pages but the window is shown only once.

Bug: 1026237
Change-Id: I9f70d99f9cda7c4c6dd7194630a5b2fa1ede5d2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2151865
Commit-Queue: David Roger <droger@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Auto-Submit: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759584}
parent d872517c
......@@ -37,13 +37,15 @@ function loadAuthUrlAndShowWindow(url, win) {
}
webview.src = url;
let windowShown = false;
webview.addEventListener('loadstop', function() {
if (win) {
if (win && !windowShown) {
win.show();
windowId = win.id;
windowShown = true;
}
webview.executeScript({file: 'inject.js'});
}, {once: true});
});
}
chrome.runtime.onMessageExternal.addListener(function(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment