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

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: 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..88c6eb961362bc95eb02bd59cd010fa4c0de4c24 100644
--- a/extensions/renderer/resources/web_view.js
+++ b/extensions/renderer/resources/web_view.js
@@ -288,21 +288,29 @@ WebViewInternal.prototype.validateExecuteCodeCall = function() {
};
/**
- * @private
- */
+ * @private
+ */
Fady Samuel 2014/09/25 20:09:03 Just remove this comment. We don't use this style
paulmeyer 2014/09/25 20:39:51 Done.
WebViewInternal.prototype.executeScript = function(var_args) {
this.validateExecuteCodeCall();
- var args = $Array.concat([this.guestInstanceId, this.src],
+ var webview_src = this.src;
+ if (this.baseURLForDataURL != '') {
Fady Samuel 2014/09/25 20:09:03 s/URL/Url preferred in Javascript.
paulmeyer 2014/09/25 20:39:51 Done.
+ webview_src = this.baseURLForDataURL;
+ }
+ var args = $Array.concat([this.guestInstanceId, webview_src],
$Array.slice(arguments));
$Function.apply(WebView.executeScript, null, args);
};
/**
- * @private
- */
+ * @private
+ */
Fady Samuel 2014/09/25 20:09:03 Just remove this comment. we don't use this style
paulmeyer 2014/09/25 20:39:51 Done.
WebViewInternal.prototype.insertCSS = function(var_args) {
this.validateExecuteCodeCall();
- var args = $Array.concat([this.guestInstanceId, this.src],
+ var webview_src = this.src;
+ if (this.baseURLForDataURL != '') {
Fady Samuel 2014/09/25 20:09:03 s/URL/Url preferred in Javascript.
paulmeyer 2014/09/25 20:39:51 Done.
+ 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;

Powered by Google App Engine
This is Rietveld 408576698