Skip to content

Commit

Permalink
Escape the lookup url during reverse image search (#3905)
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamChiu authored and erikdesjardins committed Jan 19, 2017
1 parent 1511d3e commit 73efb5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/modules/showImages.js
Expand Up @@ -46,6 +46,7 @@ import {
frameThrottle,
nextFrame,
isPageType,
string,
waitForEvent,
watchForElement,
getPercentageVisibleYAxis,
Expand Down Expand Up @@ -1522,7 +1523,8 @@ function setMediaControls(media, lookupUrl, downloadUrl) {
// Google doesn't like image url's without a protacol
lookupUrl = new URL(downcast(lookupUrl, 'string'), location.href).href;

openNewTab(`https://images.google.com/searchbyimage?image_url=${lookupUrl}`);
// Escape query string parameters
openNewTab(string.encode`https://images.google.com/searchbyimage?image_url=${lookupUrl}`);
break;
case 'showImageSettings':
SettingsNavigation.loadSettingsPage(module.moduleID, 'mediaControls');
Expand Down

0 comments on commit 73efb5c

Please sign in to comment.