注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

写着玩

Bob

 
 
 

日志

 
 
 
 

Constrained Popup Windows  

2010-01-10 22:22:58|  分类: Chrome |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Overview

The window.open() API has been abused to open intrusive advertising, which is regretful since there are legitimate reasons to open a new window that enhance user experience. Traditionally, popup windows are blocked when they aren't explicitly requested by a user keypress or mouse click. Currently, other browsers either don't alert the user when a popup is blocked, or they show a user alert bar offering to either whitelist the site or disable the popup blocking notification.

Instead, we display the title bar of the new popup in the lower right corner of the web page when said page tries to open a window not caused by a user gesture. Only the title bar is displayed and if the user navigates away from the site without interacting with the popup, it is automatically dismissed. It's not even a real window that shows up in the task bar. This is a tradeoff. Popup windows are slightly more intrusive than when they are simply blocked without any user notification, but in return, there is no whitelist to manually manage, and false positives become significantly less confusing.

Implementation

When the Browser process receives a message requesting a new popup (TabContents::AddNewContents()), the TabContents has a chance to build aConstrainedWindow instead of passing the message off to Browser::AddNewContents() to do the normal creation of a new window.ConstrainedWindows are owned by the TabContents and are "attached" to the lower right hand corner of the TabContent's visible area. 

Clicking or dragging a constrained popup window's titlebar will convert the popup into a full fledged window (ConstrainedWindowImpl::Detach()).
  评论这张
 
阅读(316)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017