diff --git a/background.js b/background.js index ec049cb..611f282 100644 --- a/background.js +++ b/background.js @@ -31,8 +31,8 @@ function copyToClipboard(url) { chrome.pageAction.onClicked.addListener(function(tab) { getCurrentTabUrl(function(url) { - url = getBetterUrl(url); - var filename = url.substr(url.lastIndexOf("/")); + var betterUrl = getBetterUrl(url); + var filename = betterUrl.substr(betterUrl.lastIndexOf("/")); chrome.storage.sync.get({url: '', tabbehaviour: '', copytoclipboard: false, replacebookmark: false}, function(config) { if(config.url == '') { @@ -65,7 +65,7 @@ chrome.pageAction.onClicked.addListener(function(tab) { replaceBookmark(url, newUrl); } }; - worker.postMessage(JSON.stringify({pomfclone: config.url, url: url, filename: filename})); + worker.postMessage(JSON.stringify({pomfclone: config.url, url: betterUrl, filename: filename})); }); }); });