Fix URLs with question marks (query strings)

This commit is contained in:
Les De Ridder 2016-01-18 16:59:13 +01:00
parent 1c7df139ef
commit ba079c730b
1 changed files with 2 additions and 0 deletions

View File

@ -33,6 +33,7 @@ chrome.pageAction.onClicked.addListener(function(tab) {
getCurrentTabUrl(function(url) {
var betterUrl = getBetterUrl(url);
var filename = betterUrl.substr(betterUrl.lastIndexOf("/"));
filename = filename.substr(0, filename.indexOf('?'));
chrome.storage.sync.get({url: '', tabbehaviour: '', copytoclipboard: false, replacebookmark: false}, function(config) {
if(config.url == '') {
@ -86,6 +87,7 @@ function isCoolUrl(url) {
var extensionIndex = url.lastIndexOf('.');
var extension = url.substr(extensionIndex + 1);
extension = extension.substr(0, extension.indexOf('?'));
var validExtensions = ["jpg", "jpeg", "png", "gif", "webm", "gifv", "mp4", "mp3", "ogg", "opus"];