Append .jpg if the original URL doesn't have an extension
This commit is contained in:
parent
4a06ac67f2
commit
b64fffa1e7
|
@ -37,6 +37,10 @@ chrome.pageAction.onClicked.addListener(function(tab) {
|
||||||
var filename = betterUrl.substr(betterUrl.lastIndexOf("/"));
|
var filename = betterUrl.substr(betterUrl.lastIndexOf("/"));
|
||||||
filename = cleanExtension(filename);
|
filename = cleanExtension(filename);
|
||||||
|
|
||||||
|
if(filename.indexOf('.') == -1) {
|
||||||
|
filename = filename + '.jpg'; //on average, it's probably JPEG if it doesn't have an extension
|
||||||
|
}
|
||||||
|
|
||||||
chrome.storage.sync.get({url: '', tabbehaviour: '', copytoclipboard: false, replacebookmark: false, disableblacklist: false}, function(config) {
|
chrome.storage.sync.get({url: '', tabbehaviour: '', copytoclipboard: false, replacebookmark: false, disableblacklist: false}, function(config) {
|
||||||
if(config.url == '') {
|
if(config.url == '') {
|
||||||
alert("Please select a Pomf clone.");
|
alert("Please select a Pomf clone.");
|
||||||
|
|
Loading…
Reference in New Issue