I made an extension example that allows you to do what you asked.
In the archive manifest.json it is necessary to add a permission to have access to the host,
otherwise it will not be possible to execute ajax. In this case, I will use an echo page
jsfiddle:
"permissions": [
"http://jsfiddle.net/" // aqui está a permissão necessária, para acessar o host
]
The rest is just like normal Web development... you can even use jQuery.
I put the jquery file together with the extension files.
The version used is the one that is linked in the file listing below.
Archives
jquery-1.11.2.min. js
manifest.json
{
"manifest_version": 2,
"name": "Extensão de teste, com Ajax e Janela de Pop-up",
"description": "Extensão de teste, com Ajax e Janela de Pop-up",
"version": "1.0",
"browser_action": {
"default_popup": "popup.html"
},
"permissions": [
"http://jsfiddle.net/"
]
}
popup.html
<!doctype html>
<html>
<head>
<title>Abrindo resultado de ajax em outra tela</title>
<script src="jquery-1.11.2.min.js"></script>
<script src="popup.js"></script>
</head>
<body>
<button id="btn">Abrir conteúdo em outra janela</button>
</body>
</html>
popup.js
$(function() {
$('#btn').click(function() {
$.ajax({
url: 'http://jsfiddle.net/echo/html/',
data: {
html: '<div>Documento carregado via ajax!</div>',
delay: 1
},
type: 'POST',
success: function(data){
var win = window.open(
"",
"Title",
"toolbar=no,"+
"location=no,"+
"directories=no,"+
"status=no,"+
"menubar=no,"+
"scrollbars=yes,"+
"resizable=yes,"+
"width=780,"+
"height=200,"+
"top="+(screen.height-400)+","+
"left="+(screen.width-840));
win.document.body.innerHTML = data;
},
error: function() {
alert("error: "+JSON.stringify(arguments));
}
});
return false;
});
});
Could you add the code that makes the POST ajax? So it’s easier to see what you’re doing.
– Miguel Angelo