Answers for "google chrome download current page"

2

chrome extension get current tab url

chrome.tabs.query({currentWindow: true, active: true}, function(tabs){
    console.log(tabs[0].url);
});
Posted by: Guest on February-06-2021
0

javascript download current html page

// in the current page, download the html source
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:attachment/text,' + encodeURI(document.documentElement.outerHTML);
hiddenElement.target = '_blank';
hiddenElement.download = 'myFile.txt';
hiddenElement.click();
Posted by: Guest on December-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language