Hi
I am in the development of an extension for Google Chrome and I need to be able to load a web in a tab but separate the session or load of cookies from it, that is to say isolate each tab a of the other. An example of what I am looking for is an already created extension called SessionBOX that allows you to create different sessions or profiles but all from the main window, only in different tabs.
My code extracted from a tutorial:
document.addEventListener('DOMContentLoaded', function() {
var checkPageButton = document.getElementById('checkPage');
checkPageButton.addEventListener('click', function() {
chrome.tabs.getSelected(null, function(tab) {
d = document;
var f = d.createElement('form');
f.action = 'http://mi-web?bm';
f.method = 'post';
var i = d.createElement('input');
i.type = 'hidden';
i.name = 'url';
i.value = tab.url;
f.appendChild(i);
d.body.appendChild(f);
f.submit();
});
}, false);
}, false);
This code allows me to load a web in the current tab. But I only need to isolate the cookies or separate this tab as if it were a session or profile. This is my first extension and I appreciate your guide.
Aucun commentaire:
Enregistrer un commentaire