为什么我的Google Chrome扩展程序只能打开25个选项卡? [英] Why does my Google Chrome extension only open 25 tabs out of many more?

查看:137
本文介绍了为什么我的Google Chrome扩展程序只能打开25个选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有一段代码,只是不希望作为Chrome扩展程序正常工作。



据我所知,一切都很完美,除非它停止在第25页打开页面,无论打开多少个标签页。我检查了代码,它试图正确地打开每一个链接,但实际上并没有。任何想法?



pre $ for(x = 0; x <55; x ++){
window.open();


解决方案

=http://code.google.com/codesearch#OAMlx_jo-ck/src/content/renderer/render_view_impl.cc&exact_package=chromium&q=kMaximumNumberOfUnacknowledgedPopups&type=cs&l=290 =nofollow>在 window.open 调用上有意设置上限。请参阅Chromium错误 2632 3382 作为背景,但简而言之,这个想法是为了防止拒绝服务(UI -

扩展API如 chrome.tabs.create (正如PAEz的答案所建议的)不受这些API的约束,因为扩展已经有特权访问。


I have a piece of code here that just doesn't want to work right as a Chrome Extension.

As far as I can tell, everything works perfectly, except it stops opening pages around tab 25, no matter how many tabs should be opened. I checked the code and it attempts to open every single link properly, but in reality it doesn't. Any ideas?

for (x = 0; x<55; x++){
   window.open();
}

解决方案

There is an intentional upper bound of 25 on window.open calls. See Chromium bugs 2632 and 3382 for background, but in brief, the idea is to prevent denial-of-service (both UI-wise and memory-wise) attacks from pages that open popups indefinitely.

Extension APIs like chrome.tabs.create (as PAEz's answer suggests) are not subject to these APIs, since extensions are privileged access already.

这篇关于为什么我的Google Chrome扩展程序只能打开25个选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆