Merge lp:~michael-sheldon/webbrowser-app/fix-double-slash-image-urls into lp:webbrowser-app

Proposed by Michael Sheldon
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 503
Merged at revision: 511
Proposed branch: lp:~michael-sheldon/webbrowser-app/fix-double-slash-image-urls
Merge into: lp:webbrowser-app
Diff against target: 37 lines (+14/-2)
2 files modified
src/Ubuntu/Components/Extras/Browser/selection01.js (+7/-1)
src/Ubuntu/Components/Extras/Browser/selection02.js (+7/-1)
To merge this branch: bzr merge lp:~michael-sheldon/webbrowser-app/fix-double-slash-image-urls
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+216873@code.launchpad.net

Commit message

Resolve image URLs beginning with a double slash correctly for context menu items

Description of the change

Resolves image URLs beginning with a double slash correctly for context menu items (e.g. copying image URLs, opening images in new tabs, etc.).

To post a comment you must log in.
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.

 * No

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

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

 * No change

If you changed the packaging (debian), did you subscribe a core-dev 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
Olivier Tilloy (osomon) wrote :

Looks good, and fixes bug #1311626. Thanks Michael!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/Extras/Browser/selection01.js'
2--- src/Ubuntu/Components/Extras/Browser/selection01.js 2014-03-12 14:39:34 +0000
3+++ src/Ubuntu/Components/Extras/Browser/selection01.js 2014-04-23 12:36:57 +0000
4@@ -40,7 +40,13 @@
5 if (firstcolon !== -1) {
6 protocol = docuri.slice(0, firstcolon + 3);
7 }
8- return protocol + document.domain + uri;
9+ if (uri.slice(0, 2) === '//') {
10+ // URLs beginning with a // should just inherit the protocol
11+ // from the current page
12+ return protocol + uri.slice(2);
13+ } else {
14+ return protocol + document.domain + uri;
15+ }
16 } else {
17 var base = document.baseURI;
18 var lastslash = base.lastIndexOf('/');
19
20=== modified file 'src/Ubuntu/Components/Extras/Browser/selection02.js'
21--- src/Ubuntu/Components/Extras/Browser/selection02.js 2014-03-12 14:15:25 +0000
22+++ src/Ubuntu/Components/Extras/Browser/selection02.js 2014-04-23 12:36:57 +0000
23@@ -34,7 +34,13 @@
24 if (firstcolon !== -1) {
25 protocol = docuri.slice(0, firstcolon + 3);
26 }
27- return protocol + document.domain + uri;
28+ if (uri.slice(0, 2) === '//') {
29+ // URLs beginning with a // should just inherit the protocol
30+ // from the current page
31+ return protocol + uri.slice(2);
32+ } else {
33+ return protocol + document.domain + uri;
34+ }
35 } else {
36 var base = document.baseURI;
37 var lastslash = base.lastIndexOf('/');

Subscribers

People subscribed via source and target branches

to status/vote changes: