Chrome & PopUp window names

假装没事ソ 提交于 2019-12-11 13:16:26

问题


I am opening pop up windows from a website (flash content) the following way:

RING = window.open(path,'RING_Projekt','width=800,height=600,scrollbars=no,top=' + t + ',left=' + l +'');

The HTML file opened in the popup is valid HTML with a <title>, yet Chrome (all other browsers do work fine) will display "Untitled" in the title bar.

Does anyone know why this is happening and if there is an error / workaround that could fix this? Or is this some kind of a pop up blocker malfunction / bug?

Thanks!

EDIT: Playing around, I noticed the following (unfortunately it ADDS to my confusion...): the page with the flash content opens another popup (displaying news) on load by doing:

var NEWS = window.open('popup/news.htm','RING_news','width=400,height=400,scrollbars=no,top=20, left=20');

When I now open a popup with the function mentioned in the above post, then go and close the news-Popup opened on load and then switch back to the "on-click"-Popup the popup magically acquired a name. When you close this and open it again, the name is gone again. To be honest: I don't get it. I should be able to have more than one pop-up, right? Also, I cannot see any naming problems or anything else that could explain this behavior.

Am I missing something big here? Or is this a plain bug?


回答1:


Ok, I am a 99.99% sure this is a Chrome bug, so I'll answer this myself.

Chrome seems to read the specified title correctly from the HTML (as it will be displayed in the task bar), but seems to have problems when having to display the name in the bar on the popup (see screenshot below). When you start to fiddle with the popup (move / resize), the title will sometimes appear and disappear again. Yet, the names in the task bar will always be right (that plus the fact that it works in every other browser lets me think it is a bug).

I am running Chrome 14.0.835.186 m on Windows Vista.




回答2:


http://code.google.com/p/chromium/issues/detail?id=113201

its a open bug




回答3:


This is a bug with Chrome. However, there is a workaround for this.

If you put the following script in the page that opens in the popup window, it seems to work fine.

<script language"text/javascript">this.window.resizeBy(1,1);this.window.resizeBy(-1,-1);</script>



回答4:


The second argument to window.open isn't the <title> of the new window, used by <a target="...">, for example.. The title is determined by the content of the page.

See MDN docs for more info.



来源:https://stackoverflow.com/questions/7570860/chrome-popup-window-names

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!