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
=== modified file 'src/Ubuntu/Components/Extras/Browser/selection01.js'
--- src/Ubuntu/Components/Extras/Browser/selection01.js 2014-03-12 14:39:34 +0000
+++ src/Ubuntu/Components/Extras/Browser/selection01.js 2014-04-23 12:36:57 +0000
@@ -40,7 +40,13 @@
40 if (firstcolon !== -1) {40 if (firstcolon !== -1) {
41 protocol = docuri.slice(0, firstcolon + 3);41 protocol = docuri.slice(0, firstcolon + 3);
42 }42 }
43 return protocol + document.domain + uri;43 if (uri.slice(0, 2) === '//') {
44 // URLs beginning with a // should just inherit the protocol
45 // from the current page
46 return protocol + uri.slice(2);
47 } else {
48 return protocol + document.domain + uri;
49 }
44 } else {50 } else {
45 var base = document.baseURI;51 var base = document.baseURI;
46 var lastslash = base.lastIndexOf('/');52 var lastslash = base.lastIndexOf('/');
4753
=== modified file 'src/Ubuntu/Components/Extras/Browser/selection02.js'
--- src/Ubuntu/Components/Extras/Browser/selection02.js 2014-03-12 14:15:25 +0000
+++ src/Ubuntu/Components/Extras/Browser/selection02.js 2014-04-23 12:36:57 +0000
@@ -34,7 +34,13 @@
34 if (firstcolon !== -1) {34 if (firstcolon !== -1) {
35 protocol = docuri.slice(0, firstcolon + 3);35 protocol = docuri.slice(0, firstcolon + 3);
36 }36 }
37 return protocol + document.domain + uri;37 if (uri.slice(0, 2) === '//') {
38 // URLs beginning with a // should just inherit the protocol
39 // from the current page
40 return protocol + uri.slice(2);
41 } else {
42 return protocol + document.domain + uri;
43 }
38 } else {44 } else {
39 var base = document.baseURI;45 var base = document.baseURI;
40 var lastslash = base.lastIndexOf('/');46 var lastslash = base.lastIndexOf('/');

Subscribers

People subscribed via source and target branches

to status/vote changes: