I am trying to load the same link of the tab into the popup window (this is not my primary purpose and i am doing this just to get acquainted) I am getting the error
Failed to load resource: net::ERR_FILE_NOT_FOUND
My js file is as follows
var pageGenerator = {
requestPage: function() {
var urlTosearch;
chrome.windows.getCurrent(function(w) {
chrome.tabs.getSelected(w.id,
function (response){
urlTosearch = response.url;
});
});
var req = new XMLHttpRequest();
req.open("GET", urlTosearch, true);
req.onload = this.loadPage_.bind(this);
req.send(null);
},
loadPage_: function (e) {
var resp = e.target.responseText;
document.body.insertAdjacentHTML( 'beforeend', resp);
}
};
document.addEventListener('DOMContentLoaded', function () {
pageGenerator.requestPage();
});
I have read that external pages can not be loaded onto the popup. Is it so? If true why? and if not how can it be done?