Merge lp:~michael-sheldon/webbrowser-app/general-download-support into lp:webbrowser-app

Proposed by Michael Sheldon
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 593
Merged at revision: 617
Proposed branch: lp:~michael-sheldon/webbrowser-app/general-download-support
Merge into: lp:webbrowser-app
Diff against target: 444 lines (+276/-23)
9 files modified
debian/control (+2/-2)
src/app/ContentDownloadDialog.qml (+2/-2)
src/app/ContentPickerDialog.qml (+6/-1)
src/app/ContentShareDialog.qml (+2/-2)
src/app/Downloader.qml (+26/-11)
src/app/FileExtensionMapper.js (+211/-0)
src/app/MimeTypeMapper.js (+3/-1)
src/app/Share.qml (+5/-4)
src/app/WebViewImpl.qml (+19/-0)
To merge this branch: bzr merge lp:~michael-sheldon/webbrowser-app/general-download-support
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+225143@code.launchpad.net

Commit message

Add support for downloads via content-hub on non-desktop devices when it's either not possible to render a file within the browser itself or when a download is explicitly requested via the Content-Disposition header.

Description of the change

Adds support for downloads via content-hub on non-desktop devices when it's either not possible to render a file within the browser itself or when a download is explicitly requested via the Content-Disposition header.

To post a comment you must log in.
585. By Michael Sheldon

Merge from trunk

586. By Michael Sheldon

Even out bracket spacing

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Testing with the latest oxide built from trunk (revision 634) and ubuntu-download-manager built from revision 320 of https://code.launchpad.net/~mandel/ubuntu-download-manager/expose-property/+merge/223874, and downloading image attachments from gmail works. Trying to download an mp4 video attachment results in a message that tells me there is no app installed that can handle this type of content. Is that expected? The same happens for PDF, but I know this is expected.

Revision history for this message
Olivier Tilloy (osomon) wrote :

315 + headers["Referer"] = request.referrer

It seems "referer" is a common mispelling of "referrer", would that be a bug/typo in UDM?

317 + headers["User-Agent"] = webview.context.userAgent

This won’t get us the overridden UA if any, it’s probably good enough in most cases but I would bet some corner cases will fail because the download is not requested with the same UA as the one that was used to request the parent page.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

It looks like Ken's branch for adding video as one of gallery's accepted types was never merged: https://code.launchpad.net/~ken-vandine/gallery-app/register_for_videos

I'll propose something new for that tomorrow.

The "Referer" spelling is pretty interesting and something I only found out about whilst implementing this; it's actually a misspelling carried forward from the original HTTP spec, so the correct header for HTTP requests is "Referer" instead of "Referrer" (http://en.wikipedia.org/wiki/HTTP_referer#Origin_of_the_term_referer has a bit of detail on that).

Is there a mechanism by which we could be getting the overridden user agent?

Revision history for this message
Olivier Tilloy (osomon) wrote :

> The "Referer" spelling is pretty interesting and something I only found out
> about whilst implementing this; it's actually a misspelling carried forward
> from the original HTTP spec, so the correct header for HTTP requests is
> "Referer" instead of "Referrer"
> (http://en.wikipedia.org/wiki/HTTP_referer#Origin_of_the_term_referer has a
> bit of detail on that).

Interesting. Thanks for the pointer, I learnt some history today :)

> Is there a mechanism by which we could be getting the overridden user agent?

Not without modifying the UA override mechanism. I see a few options:

 - In UbuntuWebContext, in the message handler for the networkRequestDelegate, we could store the url and corresponding override in a dictionary that would be exposed as a property (or a method) of the context. We would then query this dictionary to get the overridden UA for the URL of the current page, and if not found, use the default.

 - Alternatively, we could expose the UA override mechanism as a method of the context, but that’s not necessarily trivial as the mechanism involves user scripts which would need to be refactored to be exposed as generic JS libs.

 - Finally, another option would be to add an API to oxide itself to expose the HTTP headers for the current page, that might be useful for other use cases.

What do you think? In case you reckon option #1 is reasonable, feel free to go ahead with it (it shouldn’t be too much work). Other options look more involved, so I think it’s OK to go with the current implementation for now (but in that case please file a bug report and add a comment that points to it).

587. By Michael Sheldon

Merge from trunk

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * Requires oxide trunk release
 * https://code.launchpad.net/~mandel/ubuntu-download-manager/expose-property/+merge/223874

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/webbrowser-app) on device or emulator?

 * Yes, except for youtube videos, which I assume is due to my local oxide build being built with default free ffmpeg codecs (I seem to remember this has to be rebuilt in some way to enable non-free codecs?) - Could someone confirm this?

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:587
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/922/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1588/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1355
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-amd64-ci/121
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/121
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/121/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-i386-ci/121
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1863/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2589
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2589/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9324
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1123
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1519
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1519/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/922/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

In debian/control, can you bump the required version of liboxideqt-qmlplugin to >= 1.1.0 ?

Note that the build-dep probably doesn’t need to be bumped, and neither does the runtime dep for qtdeclarative5-ubuntu-web-plugin, however runtime deps for webbrowser-app and webapp-container do.

588. By Michael Sheldon

Set required version of liboxideqt-qmlplugin to >= 1.1.0 for webbrowser-app and webapp-container

589. By Michael Sheldon

Add 'm4v' to file extension mapper

590. By Michael Sheldon

Merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
591. By Michael Sheldon

Use PopupUtils open and close methods instead of experimental show/hide

592. By Michael Sheldon

Pass content picker popup parameters as part of PopupUtils.open call

593. By Michael Sheldon

Change liboxideqt-qmlplugin version requirement to >= 1.1 for webbrowser-app and webapp-container

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:590
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/931/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1744/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1468/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-amd64-ci/130
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/130
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/130/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-i386-ci/130
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2006/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2800
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2800/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9529
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1224/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1650
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1650/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/931/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2014-07-04 15:05:13 +0000
+++ debian/control 2014-07-09 13:31:51 +0000
@@ -33,7 +33,7 @@
33Depends: ${misc:Depends},33Depends: ${misc:Depends},
34 ${shlibs:Depends},34 ${shlibs:Depends},
35 fonts-liberation,35 fonts-liberation,
36 liboxideqt-qmlplugin (>= 1.0.2),36 liboxideqt-qmlplugin (>= 1.1),
37 libqt5sql5-sqlite,37 libqt5sql5-sqlite,
38 qtdeclarative5-dialogs-plugin,38 qtdeclarative5-dialogs-plugin,
39 qtdeclarative5-qtquick2-plugin,39 qtdeclarative5-qtquick2-plugin,
@@ -56,7 +56,7 @@
56Depends: ${misc:Depends},56Depends: ${misc:Depends},
57 ${shlibs:Depends},57 ${shlibs:Depends},
58 fonts-liberation,58 fonts-liberation,
59 liboxideqt-qmlplugin (>= 1.0.2),59 liboxideqt-qmlplugin (>= 1.1),
60 libqt5sql5-sqlite,60 libqt5sql5-sqlite,
61 libqt5webkit5-qmlwebkitplugin,61 libqt5webkit5-qmlwebkitplugin,
62 qtdeclarative5-accounts-plugin,62 qtdeclarative5-accounts-plugin,
6363
=== modified file 'src/app/ContentDownloadDialog.qml'
--- src/app/ContentDownloadDialog.qml 2014-05-05 15:31:21 +0000
+++ src/app/ContentDownloadDialog.qml 2014-07-09 13:31:51 +0000
@@ -39,11 +39,11 @@
39 activeTransfer = peer.request()39 activeTransfer = peer.request()
40 activeTransfer.downloadId = downloadDialog.downloadId40 activeTransfer.downloadId = downloadDialog.downloadId
41 activeTransfer.state = ContentTransfer.Downloading41 activeTransfer.state = ContentTransfer.Downloading
42 downloadDialog.hide()42 PopupUtils.close(downloadDialog)
43 }43 }
4444
45 onCancelPressed: {45 onCancelPressed: {
46 downloadDialog.hide()46 PopupUtils.close(downloadDialog)
47 }47 }
48 }48 }
49 }49 }
5050
=== modified file 'src/app/ContentPickerDialog.qml'
--- src/app/ContentPickerDialog.qml 2014-05-22 16:11:25 +0000
+++ src/app/ContentPickerDialog.qml 2014-07-09 13:31:51 +0000
@@ -93,7 +93,12 @@
93 93
94 Component.onCompleted: {94 Component.onCompleted: {
95 if(acceptTypes.length === 1) {95 if(acceptTypes.length === 1) {
96 peerPicker.contentType = MimeTypeMapper.mimeTypeToContentType(acceptTypes[0])96 var contentType = MimeTypeMapper.mimeTypeToContentType(acceptTypes[0])
97 if(contentType == ContentType.Unknown) {
98 // If we don't recognise the type, allow uploads from any app
99 contentType = ContentType.All
100 }
101 peerPicker.contentType = contentType
97 } else {102 } else {
98 peerPicker.contentType = ContentType.All103 peerPicker.contentType = ContentType.All
99 }104 }
100105
=== modified file 'src/app/ContentShareDialog.qml'
--- src/app/ContentShareDialog.qml 2014-06-17 14:32:58 +0000
+++ src/app/ContentShareDialog.qml 2014-07-09 13:31:51 +0000
@@ -39,11 +39,11 @@
39 activeTransfer = peer.request()39 activeTransfer = peer.request()
40 activeTransfer.items = shareDialog.items40 activeTransfer.items = shareDialog.items
41 activeTransfer.state = ContentTransfer.Charged41 activeTransfer.state = ContentTransfer.Charged
42 shareDialog.hide()42 PopupUtils.close(shareDialog)
43 }43 }
4444
45 onCancelPressed: {45 onCancelPressed: {
46 shareDialog.hide()46 PopupUtils.close(shareDialog)
47 }47 }
48 }48 }
49 }49 }
5050
=== modified file 'src/app/Downloader.qml'
--- src/app/Downloader.qml 2014-05-12 10:13:50 +0000
+++ src/app/Downloader.qml 2014-07-09 13:31:51 +0000
@@ -18,34 +18,49 @@
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 0.1
21import Ubuntu.Components.Popups 0.1
21import Ubuntu.DownloadManager 0.122import Ubuntu.DownloadManager 0.1
22import Ubuntu.Content 0.123import Ubuntu.Content 0.1
24import "MimeTypeMapper.js" as MimeTypeMapper
25import "FileExtensionMapper.js" as FileExtensionMapper
2326
24Item {27Item {
28 id: downloadItem
2529
26 ContentDownloadDialog {30 Component {
27 id: downloadDialog31 id: downloadDialog
32 ContentDownloadDialog { }
28 }33 }
2934
30 SingleDownload {35 SingleDownload {
31 id: singleDownload36 id: singleDownload
32 autoStart: false37 autoStart: false
38 property var contentType
33 onDownloadIdChanged: {39 onDownloadIdChanged: {
34 downloadDialog.downloadId = singleDownload.downloadId40 PopupUtils.open(downloadDialog, downloadItem, {"contentType" : singleDownload.contentType, "downloadId" : singleDownload.downloadId})
35 downloadDialog.show()
36 }41 }
37 }42 }
3843
39 function download(url, contentType) {44 function download(url, contentType, headers) {
40 if(contentType) {45 singleDownload.contentType = contentType
41 downloadDialog.contentType = contentType46 if(headers) {
42 } else {47 singleDownload.headers = headers
43 downloaddialog.contentType = ContentType.All
44 }48 }
45 singleDownload.download(url)49 singleDownload.download(url)
46 }50 }
4751
48 function downloadPicture(url) {52 function downloadPicture(url, headers) {
49 download(url, ContentType.Pictures)53 download(url, ContentType.Pictures, headers)
50 }54 }
55
56 function downloadMimeType(url, mimeType, headers, filename) {
57 var contentType = MimeTypeMapper.mimeTypeToContentType(mimeType)
58 if (contentType == ContentType.Unknown && filename) {
59 // If we can't determine the content type from the mime-type
60 // attempt to discover it from the file extension
61 contentType = FileExtensionMapper.filenameToContentType(filename)
62 }
63 download(url, contentType, headers)
64 }
65
51}66}
5267
=== added file 'src/app/FileExtensionMapper.js'
--- src/app/FileExtensionMapper.js 1970-01-01 00:00:00 +0000
+++ src/app/FileExtensionMapper.js 2014-07-09 13:31:51 +0000
@@ -0,0 +1,211 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This file is part of webbrowser-app.
5 *
6 * webbrowser-app is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * webbrowser-app is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19// Constructed from /etc/mime.types
20function filenameToContentType(filename) {
21 var filenameParts = filename.split(".");
22 if(filenameParts.length === 1 || (filenameParts[0] === "" && filenameParts.length === 2)) {
23 return ContentType.Unknown;
24 }
25 var ext = filenameParts.pop().toLowerCase();
26 switch(ext) {
27 case "art":
28 case "bmp":
29 case "cdr":
30 case "cdt":
31 case "cpt":
32 case "cr2":
33 case "crw":
34 case "djv":
35 case "djvu":
36 case "erf":
37 case "gif":
38 case "ico":
39 case "ief":
40 case "jng":
41 case "jp2":
42 case "jpe":
43 case "jpeg":
44 case "jpf":
45 case "jpg":
46 case "jpg2":
47 case "jpm":
48 case "jpx":
49 case "nef":
50 case "orf":
51 case "pat":
52 case "pbm":
53 case "pcx":
54 case "pgm":
55 case "png":
56 case "pnm":
57 case "ppm":
58 case "psd":
59 case "ras":
60 case "rgb":
61 case "svg":
62 case "svgz":
63 case "tif":
64 case "tiff":
65 case "wbmp":
66 case "xbm":
67 case "xpm":
68 case "xwd":
69 return ContentType.Pictures;
70 case "3gp":
71 case "asf":
72 case "asx":
73 case "avi":
74 case "axv":
75 case "dif":
76 case "dl":
77 case "dv":
78 case "fli":
79 case "flv":
80 case "gl":
81 case "lsf":
82 case "lsx":
83 case "m4v":
84 case "mkv":
85 case "mng":
86 case "mov":
87 case "movie":
88 case "mp4":
89 case "mpe":
90 case "mpeg":
91 case "mpg":
92 case "mpv":
93 case "mxu":
94 case "ogv":
95 case "qt":
96 case "ts":
97 case "webm":
98 case "wm":
99 case "wmv":
100 case "wmx":
101 case "wvx":
102 return ContentType.Videos;
103 case "aif":
104 case "aifc":
105 case "aiff":
106 case "amr":
107 case "au":
108 case "awb":
109 case "axa":
110 case "csd":
111 case "flac":
112 case "gsm":
113 case "kar":
114 case "m3u":
115 case "m4a":
116 case "mid":
117 case "midi":
118 case "mp2":
119 case "mp3":
120 case "mpega":
121 case "mpga":
122 case "oga":
123 case "ogg":
124 case "opus":
125 case "orc":
126 case "pls":
127 case "ra":
128 case "ram":
129 case "rm":
130 case "sco":
131 case "sd2":
132 case "sid":
133 case "snd":
134 case "spx":
135 case "wav":
136 case "wax":
137 case "wma":
138 return ContentType.Music;
139 case "vcard":
140 case "vcf":
141 return ContentType.Contacts;
142 case "323":
143 case "appcache":
144 case "asc":
145 case "bib":
146 case "boo":
147 case "brf":
148 case "c":
149 case "c++":
150 case "cc":
151 case "cls":
152 case "cpp":
153 case "csh":
154 case "css":
155 case "csv":
156 case "cxx":
157 case "d":
158 case "diff":
159 case "etx":
160 case "gcd":
161 case "h":
162 case "hh":
163 case "h++":
164 case "hpp":
165 case "hs":
166 case "htc":
167 case "htm":
168 case "html":
169 case "hxx":
170 case "ics":
171 case "icz":
172 case "jad":
173 case "java":
174 case "lhs":
175 case "ltx":
176 case "ly":
177 case "mml":
178 case "moc":
179 case "p":
180 case "pas":
181 case "patch":
182 case "pl":
183 case "pm":
184 case "pot":
185 case "py":
186 case "rtx":
187 case "scala":
188 case "sct":
189 case "sfv":
190 case "sh":
191 case "shtml":
192 case "srt":
193 case "sty":
194 case "tcl":
195 case "tex":
196 case "text":
197 case "tk":
198 case "tm":
199 case "tsv":
200 case "ttl":
201 case "txt":
202 case "uls":
203 case "vcs":
204 case "wml":
205 case "wmls":
206 case "wsc":
207 return ContentType.Documents;
208 default:
209 return ContentType.Unknown;
210 }
211}
0212
=== modified file 'src/app/MimeTypeMapper.js'
--- src/app/MimeTypeMapper.js 2014-05-22 20:03:22 +0000
+++ src/app/MimeTypeMapper.js 2014-07-09 13:31:51 +0000
@@ -22,11 +22,13 @@
22 return ContentType.Pictures;22 return ContentType.Pictures;
23 } else if(mimeType.search("audio/") === 0) {23 } else if(mimeType.search("audio/") === 0) {
24 return ContentType.Music;24 return ContentType.Music;
25 } else if(mimeType.search("video/") === 0) {
26 return ContentType.Videos;
25 } else if(mimeType.search("text/x-vcard") === 0) {27 } else if(mimeType.search("text/x-vcard") === 0) {
26 return ContentType.Contacts;28 return ContentType.Contacts;
27 } else if(mimeType.search("text/") === 0) {29 } else if(mimeType.search("text/") === 0) {
28 return ContentType.Documents;30 return ContentType.Documents;
29 } else {31 } else {
30 return ContentType.All;32 return ContentType.Unknown;
31 }33 }
32}34}
3335
=== modified file 'src/app/Share.qml'
--- src/app/Share.qml 2014-06-20 15:52:26 +0000
+++ src/app/Share.qml 2014-07-09 13:31:51 +0000
@@ -18,14 +18,16 @@
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 0.1
21import Ubuntu.Components.Popups 0.1
21import Ubuntu.DownloadManager 0.122import Ubuntu.DownloadManager 0.1
22import Ubuntu.Content 0.123import Ubuntu.Content 0.1
2324
24Item {25Item {
25 id: shareItem26 id: shareItem
2627
27 ContentShareDialog {28 Component {
28 id: shareDialog29 id: shareDialog
30 ContentShareDialog { }
29 }31 }
3032
31 Component {33 Component {
@@ -34,9 +36,8 @@
34 }36 }
3537
36 function share(url, name, contentType) {38 function share(url, name, contentType) {
37 shareDialog.contentType = contentType39 var sharePopup = PopupUtils.open(shareDialog, shareItem, {"contentType" : contentType})
38 shareDialog.items.push(contentItemComponent.createObject(shareItem, {"url" : url, "name" : name}))40 sharePopup.items.push(contentItemComponent.createObject(shareItem, {"url" : url, "name" : name}))
39 shareDialog.show()
40 }41 }
4142
42 function shareLink(url, title) {43 function shareLink(url, title) {
4344
=== modified file 'src/app/WebViewImpl.qml'
--- src/app/WebViewImpl.qml 2014-06-25 17:07:29 +0000
+++ src/app/WebViewImpl.qml 2014-07-09 13:31:51 +0000
@@ -37,11 +37,30 @@
37 beforeUnloadDialog: BeforeUnloadDialog {}37 beforeUnloadDialog: BeforeUnloadDialog {}
38 filePicker: filePickerLoader.item38 filePicker: filePickerLoader.item
3939
40 onDownloadRequested: {
41 if (downloadLoader.status == Loader.Ready) {
42 var headers = { }
43 if(request.cookies.length > 0) {
44 headers["Cookie"] = request.cookies.join(";")
45 }
46 if(request.referrer) {
47 headers["Referer"] = request.referrer
48 }
49 headers["User-Agent"] = webview.context.userAgent
50 downloadLoader.item.downloadMimeType(request.url, request.mimeType, headers, request.suggestedFilename)
51 }
52 }
53
40 Loader {54 Loader {
41 id: filePickerLoader55 id: filePickerLoader
42 source: formFactor == "desktop" ? "FilePickerDialog.qml" : "ContentPickerDialog.qml"56 source: formFactor == "desktop" ? "FilePickerDialog.qml" : "ContentPickerDialog.qml"
43 }57 }
4458
59 Loader {
60 id: downloadLoader
61 source: formFactor == "desktop" ? "" : "Downloader.qml"
62 }
63
45 selectionActions: ActionList {64 selectionActions: ActionList {
46 Actions.Copy {65 Actions.Copy {
47 onTriggered: copy()66 onTriggered: copy()

Subscribers

People subscribed via source and target branches

to status/vote changes: