Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: extensions/renderer/resources/web_view.js

Issue 602193002: Fix for how webview.executeScript and webivew.insertCSS check for page navigtation when loading dat… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Comments. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/resources/web_view.js
diff --git a/extensions/renderer/resources/web_view.js b/extensions/renderer/resources/web_view.js
index 9829bd9f0a057038f06fe406fb5865fd6a38d3d1..98c80b95ab27c0b3471c32fef5e91c78be6b2000 100644
--- a/extensions/renderer/resources/web_view.js
+++ b/extensions/renderer/resources/web_view.js
@@ -292,7 +292,11 @@ WebViewInternal.prototype.validateExecuteCodeCall = function() {
*/
WebViewInternal.prototype.executeScript = function(var_args) {
this.validateExecuteCodeCall();
- var args = $Array.concat([this.guestInstanceId, this.src],
+ var webview_src = this.src;
+ if (this.baseUrlForDataUrl != '') {
+ webview_src = this.baseUrlForDataUrl;
+ }
+ var args = $Array.concat([this.guestInstanceId, webview_src],
$Array.slice(arguments));
$Function.apply(WebView.executeScript, null, args);
};
@@ -302,7 +306,11 @@ WebViewInternal.prototype.executeScript = function(var_args) {
*/
WebViewInternal.prototype.insertCSS = function(var_args) {
this.validateExecuteCodeCall();
- var args = $Array.concat([this.guestInstanceId, this.src],
+ var webview_src = this.src;
+ if (this.baseUrlForDataUrl != '') {
+ webview_src = this.baseUrlForDataUrl;
+ }
+ var args = $Array.concat([this.guestInstanceId, webview_src],
$Array.slice(arguments));
$Function.apply(WebView.insertCSS, null, args);
};
@@ -726,7 +734,9 @@ WebViewInternal.prototype.setupEventProperty = function(eventName) {
// Updates state upon loadcommit.
WebViewInternal.prototype.onLoadCommit = function(
- currentEntryIndex, entryCount, processId, url, isTopLevel) {
+ baseUrlForDataUrl, currentEntryIndex, entryCount,
+ processId, url, isTopLevel) {
+ this.baseUrlForDataUrl = baseUrlForDataUrl;
this.currentEntryIndex = currentEntryIndex;
this.entryCount = entryCount;
this.processId = processId;
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.cc ('k') | extensions/renderer/resources/web_view_events.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698