summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 00:08:06 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 00:08:06 +0000
commit6e754b722b4fb14606bf5f441ae07ad2f853483f (patch)
treea694094fd4a7e06fe2db2345f88b1d3e9a610686 /chrome
parent1410fb00866fd282414a32e04b300230a51bbe1c (diff)
downloadchromium_src-6e754b722b4fb14606bf5f441ae07ad2f853483f.zip
chromium_src-6e754b722b4fb14606bf5f441ae07ad2f853483f.tar.gz
chromium_src-6e754b722b4fb14606bf5f441ae07ad2f853483f.tar.bz2
Replace the net-internals iframe with an anchor tag.
R=eroman@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/9755008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127842 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/resources/net_internals/export_view.html2
-rw-r--r--chrome/browser/resources/net_internals/export_view.js12
2 files changed, 9 insertions, 5 deletions
diff --git a/chrome/browser/resources/net_internals/export_view.html b/chrome/browser/resources/net_internals/export_view.html
index 8a17a04..9a458f3 100644
--- a/chrome/browser/resources/net_internals/export_view.html
+++ b/chrome/browser/resources/net_internals/export_view.html
@@ -47,6 +47,6 @@
</p>
</div>
- <iframe style="display: none" id=export-view-download-iframe></iframe>
+ <a style="display: none" id=export-view-download-anchor download="net-internals-log.json"></a>
</div>
diff --git a/chrome/browser/resources/net_internals/export_view.js b/chrome/browser/resources/net_internals/export_view.js
index fd1563c..46069f5 100644
--- a/chrome/browser/resources/net_internals/export_view.js
+++ b/chrome/browser/resources/net_internals/export_view.js
@@ -25,8 +25,6 @@ var ExportView = (function() {
securityStrippingCheckbox.onclick =
this.onSetSecurityStripping_.bind(this, securityStrippingCheckbox);
- this.downloadIframe_ = $(ExportView.DOWNLOAD_IFRAME_ID);
-
this.saveFileButton_ = $(ExportView.SAVE_FILE_BUTTON_ID);
this.saveFileButton_.onclick = this.onSaveFile_.bind(this);
this.saveStatusText_ = $(ExportView.SAVE_STATUS_TEXT_ID);
@@ -46,7 +44,7 @@ var ExportView = (function() {
// IDs for special HTML elements in export_view.html
ExportView.MAIN_BOX_ID = 'export-view-tab-content';
- ExportView.DOWNLOAD_IFRAME_ID = 'export-view-download-iframe';
+ ExportView.DOWNLOAD_ANCHOR_ID = 'export-view-download-anchor';
ExportView.SAVE_FILE_BUTTON_ID = 'export-view-save-log-file';
ExportView.SAVE_STATUS_TEXT_ID = 'export-view-save-status-text';
ExportView.SECURITY_STRIPPING_CHECKBOX_ID =
@@ -186,7 +184,13 @@ var ExportView = (function() {
blobBuilder.append(dumpText, 'native');
var textBlob = blobBuilder.getBlob('octet/stream');
this.lastBlobURL_ = window.webkitURL.createObjectURL(textBlob);
- this.downloadIframe_.src = this.lastBlobURL_;
+
+ // Update the anchor tag and simulate a click on it to start the
+ // download.
+ var downloadAnchor = $(ExportView.DOWNLOAD_ANCHOR_ID);
+ downloadAnchor.href = this.lastBlobURL_;
+ downloadAnchor.click();
+
this.setSaveFileStatus('Dump successful', false);
}
};