I'm using this JS code to get the page url, title and send them to the server to store them in a database, like a button you bookmarked in your browser toolbar and click it on any website you have open and it will get the website's URL and TITLE.
However this code is working great BUT it's not working with (https) url
javascript:(function(){var jsScript=document.createElement('script');
jsScript.setAttribute('type','text/javascript');
jsScript.setAttribute('src', 'bookmark.php?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title));
document.getElementsByTagName('head')[0].appendChild(jsScript);
})();
It's working good with all url's Except (https) links like
https://facebook.com
https://google.com
It's not working at all with these kind of links.
Any improvements that could make it work with https links?
Thanks in advance.