Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chromeless popup

Status
Not open for further replies.

Lordes

Programmer
Sep 27, 2002
1
CA
hi...

My chromeless popup always open fullscreen while in my parameters is 300x350, I have IE6 service pack 1,

please help......

Lordes
 
Hi,

I've not got a clue which script you are using so I have included the html needed to pop the window, and then close the original browser. And the Javescript ( the java should be called "pz_chromeless_2.1.js" ) needed to run the chromeless browser. I hope this will be of some assistance!

(by the way sorry for the length of the reply!)
-------------------------HTML----------------------------
<html>
<head>
<title> chromeless window loader</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>

<script id=&quot;chromeless&quot; src=&quot;pz_chromeless_2.1.js&quot;></script>
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!--
function openChromeslessWindow(openUrl, winName, wWidth, wHeight, wPosx, wPosy, wTIT,
windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel,
bCenter, sFontFamily, sFontSize, sFontColor){

openchromeless(openUrl,winName, wWidth, wHeight, wPosx, wPosy, wTIT, wTIT ,
windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel,
bCenter, sFontFamily, sFontSize, sFontColor);
}

function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args+&quot;.location='&quot;+args[i+1]+&quot;'&quot;);
}
//-->
</script>
</head>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; onLoad=&quot;openChromeslessWindow('intro.htm','<window name>',<width>,<height>,null,null,'<window title>', '#000000', '#000000', '#000099', '#000099' ,true,'Verdana, Arial, Helvetica, sans-serif', '1','#CCCCCC');MM_goToURL('parent','javascript:window.close()');return document.MM_returnValue&quot;>



</body>
</html>


-------------------------JAVA---------------------------
// chromeless windows v2.1
// / Gabriel Suchowolski power[z]one - powerz@microbians.com
//
// Distributed under the terms of the GNU Library General Public License
//
// - Chromeless trick by webFX. // - Chromeless mouse control to handled like a normal window by Gabriel Suchowolski power[z]one

function openchromeless(theURL, wname, W, H, posx, posy, windowTIT, windowREALtit ,
windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel,
bCenter, sFontFamily, sFontSize, sFontColor) {

var windowCERRARa = &quot;close_a.gif&quot;;
var windowCERRARd = &quot;close_d.gif&quot;;
var windowCERRARo = &quot;close_o.gif&quot;;
var windowNONEgrf = &quot;none.gif&quot;;
var windowCLOCK = &quot;clock.gif&quot;;
var windowW = W;
var windowH = H;
var windowX = -1;
var windowY = -1;

if(bCenter){
windowX = Math.ceil( (window.screen.width - windowW) / 2 );
windowY = Math.ceil( (window.screen.height - windowH) / 2 );
} else {
windowX = posx;
windowY = posy;
}

if (navigator.appName == &quot;Microsoft Internet Explorer&quot; && parseInt(navigator.appVersion)>=4) isie=true
else isie=false

if (isie) { H=H+20+2; W=W+2; }

s = &quot;,width=&quot;+W+&quot;,height=&quot;+H;

if (isie && (navigator.userAgent.toLowerCase().indexOf(&quot;win&quot;)!=-1) ) {

var dowin = theURL != &quot;&quot; ? true : false;

var chromeTIThtml = '\n' +
'<html> '+ '\n'+
'<head> '+ '\n'+
'<title> CHROMELESS WINDOWS / TITLEBAR</title> '+ '\n'+
'<style type=&quot;text/css&quot;> '+ '\n'+
'#mywindowTITLE { position: absolute; left: 0px; top: 0px; width: 100%; height: 22px; z-index: 1; background-color: '+windowTITBGCOLOR+'; clip:rect(0,100%,22,0); } '+ '\n'+
'#mywindow { position: absolute; left: 0px; top: 0px; width: 100%; height: 22px; z-index: 2; clip:rect(0,100%;22,0); } '+ '\n'+
'#mywindowCLOSE { position: absolute; left: -22px; top: -22px; width: 11px; height: 11px; z-index: 3; clip:rect(0,11,11,0); } '+ '\n'+
'#mywindowCLOCK { position: absolute; left: -22px; top: -22px; width: 11px; height: 11px; z-index: 3; clip:rect(0,11,11,0); } '+ '\n'+
'</style> '+ '\n'+
'<script language=&quot;javascript&quot;> '+ '\n'

if ( theURL != &quot;&quot; ) {

chromeTIThtml = chromeTIThtml +
' theURL = &quot;'+theURL +'&quot; '+ '\n'+
' windowCERRARa = &quot;'+windowCERRARa +'&quot; '+ '\n'+
' windowCERRARd = &quot;'+windowCERRARd +'&quot; '+ '\n'+
' windowCERRARo = &quot;'+windowCERRARo +'&quot; '+ '\n'+
' windowCLOCK = &quot;'+windowCLOCK +'&quot; '+ '\n'+
' windowBORDERCOLOR = &quot;'+windowBORDERCOLOR +'&quot; '+ '\n'+
' windowBORDERCOLORsel= &quot;'+windowBORDERCOLORsel +'&quot; '+ '\n'+
' windowTITBGCOLOR = &quot;'+windowTITBGCOLOR +'&quot; '+ '\n'+
' windowTITBGCOLORsel = &quot;'+windowTITBGCOLORsel +'&quot; '+ '\n'

} else {

chromeTIThtml = chromeTIThtml +
' theURL=&quot;about:blank&quot; '+ '\n'+
' windowCERRARa = &quot;img/close_a.gif&quot; '+ '\n'+
' windowCERRARd = &quot;img/close_d.gif&quot; '+ '\n'+
' windowCERRARo = &quot;img/close_o.gif&quot; '+ '\n'+
' windowCLOCK = &quot;img/clock.gif&quot; '+ '\n'+
' windowTIT = &quot;<font face=verdana size=1>  window title</font>&quot; '+ '\n'+
' windowBORDERCOLOR = &quot;#000000&quot; '+ '\n'+
' windowBORDERCOLORsel = &quot;#FF8A00&quot; '+ '\n'+
' windowTITBGCOLOR = &quot;#d7dcd9&quot; '+ '\n'+
' windowTITBGCOLORsel = &quot;#ffffff&quot; '+ '\n'

}

chromeTIThtml = chromeTIThtml +
'var windowCERRARImg_a = new Image(); windowCERRARImg_a.src = windowCERRARa; '+ '\n'+
'var windowCERRARImg_d = new Image(); windowCERRARImg_d.src = windowCERRARd; '+ '\n'+
'var windowCERRARImg_o = new Image(); windowCERRARImg_o.src = windowCERRARo; '+ '\n'+
'var windowCLOCKImg = new Image(); windowCLOCKImg.src = windowCLOCK; '+ '\n'+
' '+ '\n'+
'function mouseSTATUS() { '+ '\n'+
' this.x = null; '+ '\n'+
' this.y = null; '+ '\n'+
' this.bt = &quot;up&quot;; '+ '\n'+
' this.oldx = null; '+ '\n'+
' this.oldy = null; '+ '\n'+
' this.dx = null; '+ '\n'+
' this.dy = null; '+ '\n'+
' this.screeny = null; '+ '\n'+
' this.screenx = null; '+ '\n'+
' '+ '\n'+
' this.element = null; '+ '\n'+
' this.event = null; '+ '\n'+
'} '+ '\n'+
' '+ '\n'+
'var mouse = new mouseSTATUS(); '+ '\n'+
' '+ '\n'+
'function actualizateMouseSTATUS(e) { '+ '\n'+
' if (!e) var e = event '+ '\n'+
' if ( (e.type==&quot;mousedown&quot; || e.type==&quot;mouseup&quot;) && e.button!=1) return true '+ '\n'+
' '+ '\n'+
' var x=e.x+document.body.scrollLeft '+ '\n'+
' var y=e.y+document.body.scrollTop '+ '\n'+
' '+ '\n'+
' mouse.x = x; '+ '\n'+
' mouse.y = y; '+ '\n'+
' '+ '\n'+
' if ( e.type == &quot;mousedown&quot; ) mouse.bt = &quot;down&quot;; '+ '\n'+
' else if ( e.type == &quot;mouseup&quot; ) mouse.bt = &quot;up&quot;; '+ '\n'+
' '+ '\n'+
' if (window.event) { '+ '\n'+
' mouse.screenx=window.event.screenX; '+ '\n'+
' mouse.screeny=window.event.screenY; '+ '\n'+
' } else { '+ '\n'+
' mouse.screenx=-1; '+ '\n'+
' mouse.screeny=-1; '+ '\n'+
' } '+ '\n'+
' '+ '\n'+
'} '+ '\n'+
' '+ '\n'+
' '+ '\n'+
'function initMouseEvents() { '+ '\n'+
' document.onmousedown = actualizateMouseSTATUS '+ '\n'+
' document.onmousemove = actualizateMouseSTATUS '+ '\n'+
' document.onmouseup = actualizateMouseSTATUS '+ '\n'+
' document.onselectstart = selectstart '+ '\n'+
' document.ondragstart = new Function(&quot;actualizateMouseSTATUS(event); return false;&quot;) '+ '\n'+
'} '+ '\n'+
' '+ '\n'+
'function selectstart(){ '+ '\n'+
' if ( event.srcElement.tagName != &quot;INPUT&quot; && event.srcElement.tagName != &quot;TEXTAREA&quot;) { return false; } '+ '\n'+
' else { mouse.bt=&quot;up&quot;; return true; } '+ '\n'+
'} '+ '\n'+
' '+ '\n'+
'initMouseEvents() '+ '\n'+
' '+ '\n'+
'var mywindowbt =&quot;up&quot;; '+ '\n'+
'var wincloseSTATUS=&quot;up&quot;; '+ '\n'+
' '+ '\n'+
'var ofx=0; '+ '\n'+
'var ofy=0; '+ '\n'+
'var opx=0; '+ '\n'+
'var opy=0; '+ '\n'+
'var px=0; '+ '\n'+
'var py=0; '+ '\n'+
' '+ '\n'+
'var wcpx1=-1, wcpy1=-1; '+ '\n'+
'var wcpx2=-1, wcpy2=-1; '+ '\n'+
' '+ '\n'+
'var wclosechanged = false; '+ '\n'+
' '+ '\n'+
'function initToMoveWin() { '+ '\n'+
' if (wincloseSTATUS==&quot;up&quot; && ( mywindowbt==&quot;up&quot; || mywindowbt==&quot;over&quot;) ) { '+ '\n'+
' '+ '\n'+
' if ( parent.mainloaded ) document.all[&quot;mywindowCLOCK&quot;].style.visibility = &quot;hidden&quot;; '+ '\n'+
' '+ '\n'+
' document.all[&quot;mywindowCLOCK&quot;].style.pixelLeft=document.body.clientWidth-36 '+ '\n'+
' document.all[&quot;mywindowCLOCK&quot;].style.pixelTop =4 '+ '\n'+
' '+ '\n'+
' wcpx1 = document.all[&quot;mywindowCLOSE&quot;].style.pixelLeft=document.body.clientWidth-18 '+ '\n'+
' wcpy1 = document.all[&quot;mywindowCLOSE&quot;].style.pixelTop =4 '+ '\n'+
' wcpx2 = wcpx1 + 11 - 1 '+ '\n'+
' wcpy2 = wcpy1 + 11 - 1 '+ '\n'+
' if ( mouse.x >= wcpx1 && mouse.x <= wcpx2 && mouse.y >= wcpy1 && mouse.y <= wcpy2) { '+ '\n'+
' if (wclosechanged == false) { '+ '\n'+
' document.all[&quot;mywindowCLOSE&quot;].document.images[&quot;closewin&quot;].src=windowCERRARImg_o.src '+ '\n'+
' wclosechanged = true '+ '\n'+
' } '+ '\n'+
' '+ '\n'+
' } else if (wclosechanged == true) { '+ '\n'+
' document.all[&quot;mywindowCLOSE&quot;].document.images[&quot;closewin&quot;].src=windowCERRARImg_d.src '+ '\n'+
' wclosechanged = false '+ '\n'+
' } '+ '\n'+
' } '+ '\n'+
' '+ '\n'+
' if ( mouse.y <= 22 && mouse.y >= 1 && mywindowbt == &quot;up&quot; && mouse.bt ==&quot;up&quot; ) { mywindowbt = &quot;over&quot; } '+ '\n'+
' else if ( ( mouse.y > 22 || mouse.y < 1 ) && mywindowbt == &quot;over&quot; && mouse.bt ==&quot;up&quot; ) { mywindowbt = &quot;up&quot; } '+ '\n'+
' else if ( mouse.y <= 22 && mouse.y >= 1 && mywindowbt == &quot;over&quot; && mouse.bt == &quot;down&quot; ) { '+ '\n'+
' self.window.focus(); '+ '\n'+
' '+ '\n'+
' if ( mouse.x >= wcpx1 && mouse.x <= wcpx2 && mouse.y >= wcpy1 && mouse.y <= wcpy2 ) { '+ '\n'+
' wincloseSTATUS=&quot;down&quot; '+ '\n'+
' document.all[&quot;mywindowCLOSE&quot;].document.images[&quot;closewin&quot;].src=windowCERRARImg_a.src '+ '\n'+
' } else { '+ '\n'+
' document.all[&quot;mywindowTITLE&quot;].style.backgroundColor = windowTITBGCOLORsel '+ '\n'+
' document.body.style.borderColor = windowBORDERCOLORsel '+ '\n'+
' parent.chromewinb.document.bgColor = windowBORDERCOLORsel '+ '\n'+
' parent.chromewinl.document.bgColor = windowBORDERCOLORsel '+ '\n'+
' parent.chromewinr.document.bgColor = windowBORDERCOLORsel '+ '\n'+
' ofx = mouse.x; '+ '\n'+
' ofy = mouse.y; '+ '\n'+
' opx = mouse.x; '+ '\n'+
' opy = mouse.y; '+ '\n'+
' } '+ '\n'+
' mywindowbt=&quot;down&quot;; '+ '\n'+
' } '+ '\n'+
' else if ( mouse.bt ==&quot;up&quot; && mywindowbt == &quot;down&quot; ) { '+ '\n'+
' mywindowbt=&quot;up&quot;; '+ '\n'+
' ofx=0; '+ '\n'+
' ofy=0; '+ '\n'+
' opx=0; '+ '\n'+
' opy=0; '+ '\n'+
' '+ '\n'+
' if ( mouse.x >= wcpx1 && mouse.x <= wcpx2 && mouse.y >= wcpy1 && mouse.y <= wcpy2 && wincloseSTATUS==&quot;down&quot; ) { top.window.close() } '+ '\n'+
' '+ '\n'+
' wincloseSTATUS=&quot;up&quot; '+ '\n'+
' '+ '\n'+
' if ( document.all[&quot;mywindowTITLE&quot;] ) { '+ '\n'+
' document.all[&quot;mywindowTITLE&quot;].style.backgroundColor = windowTITBGCOLOR '+ '\n'+
' document.body.style.borderColor = windowBORDERCOLOR '+ '\n'+
' parent.chromewinb.document.bgColor= windowBORDERCOLOR '+ '\n'+
' parent.chromewinl.document.bgColor= windowBORDERCOLOR '+ '\n'+
' parent.chromewinr.document.bgColor= windowBORDERCOLOR '+ '\n'+
' } '+ '\n'+
' '+ '\n'+
' } '+ '\n'+
' else if ( mywindowbt == &quot;down&quot; && wincloseSTATUS == &quot;up&quot;) { '+ '\n'+
' var m_scrx = mouse.screenx; '+ '\n'+
' var m_scry = mouse.screeny; '+ '\n'+
' opx = px + ofx - m_scrx; '+ '\n'+
' opy = py + ofy - m_scry; '+ '\n'+
' px = m_scrx - ofx; '+ '\n'+
' py = m_scry - ofy; '+ '\n'+
' top.window.moveTo(px , py); '+ '\n'+
' } '+ '\n'+
' setTimeout(&quot;initToMoveWin()&quot;,50); '+ '\n'+
'} '+ '\n'+
'</script> '+ '\n'+
'</head> '+ '\n'+
'<body TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=no style=&quot;border: 1px solid '+ windowBORDERCOLOR +'; overflow: hidden; margin: 0pt;&quot; bgcolor='+windowTITBGCOLOR+'> '+ '\n'+
'<div id=mywindow><img src=&quot;'+windowNONEgrf+'&quot; width=100% height=20></div> '+ '\n'+
'<div id=mywindowTITLE>'+ '<table width=100% height=20 border=0 cellpadding=0 cellspacing=0><tr><td valign=middle align=left><font face=&quot;' + sFontFamily + '&quot; size=' + sFontSize + ' color=&quot;' + sFontColor + '&quot;>   ' + windowTIT + '</font></td></tr></table>' +'</div> '+ '\n'+
'<div id=mywindowCLOSE><img name=closewin src=&quot;'+ windowCERRARd +'&quot; border=0 width=11 height=11></div> '+ '\n'+
'<div id=mywindowCLOCK><img name=clockwin src=&quot;'+ windowCLOCK +'&quot; border=0 width=11 height=11></div> '+ '\n'+
'</body> '+ '\n'+
'<script>initToMoveWin();</script> '+ '\n'+
'</html> '+ '\n'

var chromeFRMhtml = '' +
'<HTML> '+ '\n'+
'<HEAD> '+ '\n'+
'<TITLE>' + '  ' + windowREALtit + '</TITLE> '+ '\n'+
'</HEAD> '+ '\n'+
'<script> '+ '\n'+
'mainloaded = false '+ '\n'+
'function generatetitle() { '+ '\n'+
' if( window.frames[&quot;chromewint&quot;] && window.frames[&quot;chromewinl&quot;] && window.frames[&quot;chromewinb&quot;] && window.frames[&quot;chromewinr&quot;] ) { '+ '\n'+
' chromewint.document.open(); '+ '\n'+
' chromewint.document.write( &quot;'+ quitasaltolinea(chromeTIThtml) +'&quot; ); '+ '\n'+
' chromewint.document.close(); '+ '\n'+
' chromewinl.document.bgColor=&quot;'+ windowBORDERCOLOR +'&quot; '+ '\n'+
' chromewinb.document.bgColor=&quot;'+ windowBORDERCOLOR +'&quot; '+ '\n'+
' chromewinr.document.bgColor=&quot;'+ windowBORDERCOLOR +'&quot; '+ '\n'+
' } else { '+ '\n'+
' setTimeout(&quot;generatetitle()&quot;,200) '+ '\n'+
' } '+ '\n'+
'} '+ '\n'+
'generatetitle() '+ '\n'+
'</script> '+ '\n'+
'<frameset border=0 framespacing=0 frameborder=0 rows=&quot;22,100%,1&quot; onload=&quot;mainloaded=true&quot; onreadystatechange=&quot;generatetitle()&quot;> '+ '\n'+
' <frame name=chromewint src=&quot;about:blank&quot; scrolling=no noresize> '+ '\n'+
' <frameset border=0 framespacing=0 frameborder=0 cols=&quot;1,100%,1&quot;> '+ '\n'+
' <frame name=chromewinl src=&quot;about:blank&quot; scrolling=no noresize> '+ '\n'+
' <frame name=main src=&quot;'+theURL+'&quot;> '+ '\n'+
' <frame name=chromewinr src=&quot;about:blank&quot; scrolling=no noresize> '+ '\n'+
' </frameset> '+ '\n'+
' <frame name=chromewinb src=&quot;about:blank&quot; scrolling=no noresize> '+ '\n'+
'</frameset> '+ '\n'+
'</HTML> '

splashWin = window.open( &quot;&quot; , wname, &quot;fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0&quot;+s);

splashWin.resizeTo( Math.ceil( W ) , Math.ceil( H ) );
splashWin.moveTo ( Math.ceil( windowX ) , Math.ceil( windowY ) );

splashWin.document.open();
splashWin.document.write( chromeFRMhtml );
splashWin.document.close();

}
else {
var splashWin = window.open(theURL, wname, &quot;toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1&quot;+s, true);
}

splashWin.focus();
}

function quitasaltolinea(txt) {

var salida = txt.toString()
var re = /\\/g; var salida = salida.replace(re, &quot;\\\\&quot;);
var re = /\//g; var salida = salida.replace(re, &quot;\\\/&quot;);
var re = /\&quot;/g; var salida = salida.replace(re, &quot;\\\&quot;&quot;);
var re = /\'/g; var salida = salida.replace(re, &quot;\\\'&quot;);
var re = /\n/g; var salida = salida.replace(re, &quot;\\n&quot;);
var re = / /g; var salida = salida.replace(re, &quot;&quot;);
var re = /\t/g; var salida = salida.replace(re, &quot;&quot;);
var re = /\r/g; var salida = salida.replace(re, &quot;&quot;);

return salida

}
---------------------------------------------------------
 
If I may ask, what do you mean by &quot;chromeless&quot;? That's a new term for me, but it sounds interesting. :)

--Ryan
 
This term is usually used to describe window style when it doesn't have neither status bar, nor menu bar, nor other bars... Good Luck! :)
 
I have the same problem.
At work, I have W2K SP3, IE 6 SP1 and all chromeless windows appear maximized.
I have XP at home, no service pack, and they work fine.
Is there any way to resize them? I tried onload resize, but that didn't do the trick :(

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top