From b64fffa1e7eaceaae4b38f3a3fa804d1639ed7fb Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Thu, 26 May 2016 01:18:32 +0200 Subject: [PATCH] Append .jpg if the original URL doesn't have an extension --- background.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/background.js b/background.js index 445d9ae..ca72c11 100644 --- a/background.js +++ b/background.js @@ -37,6 +37,10 @@ chrome.pageAction.onClicked.addListener(function(tab) { var filename = betterUrl.substr(betterUrl.lastIndexOf("/")); 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) { if(config.url == '') { alert("Please select a Pomf clone.");