1
I want to print an iframe, but the print() method does not work because my "src" attribute contains
"data:text/html;charset=utf-8,%3Chtml%3E%3Cbody%3Efoo%3C/body%3E%3C/html%3E",
There is a method that allows me to call the browser print window?
Update: Follow the error:
Uncaught Securityerror: Blocked a frame with origin "http://testeecm:8080" from accessing a frame with origin "null". The frame requesting access has a Protocol of "http", the frame being has accessed a Protocol of "data". Protocols must match.
my iframe:
{
xtype : "component",
hidden: true,
id : 'iframeDudu',
items:[
//framedudu
],
autoEl : {
width : 1000,
//hidden: true,
height: 700,
tag : "iframe",
//items: myPanel
id:'frameAutoEl',
//src : "http://testeecm:8080/webdesk"
//src : "http://servidorweb/redmine/login?back_url=http%3A%2F%2Fservidorweb%2Fredmine%2F"
//Uncaught SecurityError: Blocked a frame with origin "http://testeecm:8080" from accessing a
// frame with origin "http://servidorweb". Protocols, domains, and ports must match.
//html : '<iframe src="http://forum.extjs.com.br/index.php?/topic/27562-resolvido-n%C3%A3o-est%C3%A1-exibindo-arquivo-pdf-na-window-do-extjs/?hl=imprimir"></iframe>',
//html : thtml //acontece nada
//src : 'data:text/html;charset=utf-8,' + encodeURI(thtml)
src : "data:text/html;charset=utf-8,%3Chtml%3E%3Cbody%3Efoo%3C/body%3E%3C/html%3E",
// Uncaught SecurityError: Blocked a frame with origin "http://testeecm:8080" from accessing a frame
// with origin "null". The frame requesting access has a protocol of "http",
// the frame being accessed has a protocol of "data". Protocols must match.
}// final autoElement
}
"but the print() method doesn’t work" - like this? you can give an example in jsFiddle or here?
– Sergio
it returns a blank page to you? Because to print the frame you have to configure it on the server side
– Danilo Pádua
It does not print, error occurs in console
– durtto