Fix URLs with question marks (query strings)
This commit is contained in:
parent
1c7df139ef
commit
ba079c730b
|
@ -33,6 +33,7 @@ chrome.pageAction.onClicked.addListener(function(tab) {
|
||||||
getCurrentTabUrl(function(url) {
|
getCurrentTabUrl(function(url) {
|
||||||
var betterUrl = getBetterUrl(url);
|
var betterUrl = getBetterUrl(url);
|
||||||
var filename = betterUrl.substr(betterUrl.lastIndexOf("/"));
|
var filename = betterUrl.substr(betterUrl.lastIndexOf("/"));
|
||||||
|
filename = filename.substr(0, filename.indexOf('?'));
|
||||||
|
|
||||||
chrome.storage.sync.get({url: '', tabbehaviour: '', copytoclipboard: false, replacebookmark: false}, function(config) {
|
chrome.storage.sync.get({url: '', tabbehaviour: '', copytoclipboard: false, replacebookmark: false}, function(config) {
|
||||||
if(config.url == '') {
|
if(config.url == '') {
|
||||||
|
@ -86,6 +87,7 @@ function isCoolUrl(url) {
|
||||||
|
|
||||||
var extensionIndex = url.lastIndexOf('.');
|
var extensionIndex = url.lastIndexOf('.');
|
||||||
var extension = url.substr(extensionIndex + 1);
|
var extension = url.substr(extensionIndex + 1);
|
||||||
|
extension = extension.substr(0, extension.indexOf('?'));
|
||||||
|
|
||||||
var validExtensions = ["jpg", "jpeg", "png", "gif", "webm", "gifv", "mp4", "mp3", "ogg", "opus"];
|
var validExtensions = ["jpg", "jpeg", "png", "gif", "webm", "gifv", "mp4", "mp3", "ogg", "opus"];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue