Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: subscriptionLink.postload.js

Issue 29342971: Fixes 4065 - Subscription links on Chrome 30 (Closed)
Left Patch Set: Addressed feedback Created May 24, 2016, 12:45 p.m.
Right Patch Set: Removed redundant comment Created May 24, 2016, 12:58 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 queryString = match[1]; 59 queryString = match[1];
60 } 60 }
61 61
62 if (!queryString) 62 if (!queryString)
63 return; 63 return;
64 64
65 // This is our link - make sure the browser doesn't handle it 65 // This is our link - make sure the browser doesn't handle it
66 event.preventDefault(); 66 event.preventDefault();
67 event.stopPropagation(); 67 event.stopPropagation();
68 68
69 // Decode URL parameters (Note: Old versions of Chrome (30) don't populate 69 // Decode URL parameters
Sebastian Noack 2016/05/24 12:48:06 Nit: That comment, or at least the part you added,
kzar 2016/05/24 12:59:40 Whoops missed that, Done.
70 // link.search here so we have to grab the search part of the URL manually.)
71 var params = queryString.split("&"); 70 var params = queryString.split("&");
72 var title = null; 71 var title = null;
73 var url = null; 72 var url = null;
74 for (var i = 0; i < params.length; i++) 73 for (var i = 0; i < params.length; i++)
75 { 74 {
76 var parts = params[i].split("=", 2); 75 var parts = params[i].split("=", 2);
77 if (parts.length != 2 || !/\S/.test(parts[1])) 76 if (parts.length != 2 || !/\S/.test(parts[1]))
78 continue; 77 continue;
79 switch (parts[0]) 78 switch (parts[0])
80 { 79 {
(...skipping 19 matching lines...) Expand all
100 return; 99 return;
101 100
102 ext.backgroundPage.sendMessage({ 101 ext.backgroundPage.sendMessage({
103 type: "subscriptions.add", 102 type: "subscriptions.add",
104 title: title, 103 title: title,
105 url: url, 104 url: url,
106 confirm: true 105 confirm: true
107 }); 106 });
108 }, true); 107 }, true);
109 } 108 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld