如何让Chrome在新标签页中打开多个网站 [英] How to get Chrome to open multiple sites in a new tab

查看:172
本文介绍了如何让Chrome在新标签页中打开多个网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款工具,可以让您使用快捷方式一次打开多个网页,用于打开您的日常网站或查询多个搜索引擎的短语。在Firefox,Internet Explorer和Opera中,假设您已经解除了域的弹出窗口,代码将按预期工作。 然而,Chrome会以新的方式打开网站如果链接在页面加载时自动打开,则代替标签。如果openAll()被注释掉并且按钮被点击或按下了一个键,页面将在标签中打开。注意它调用的是完全相同的函数。

我发现的最好的解决方案(不多说)是一个窗口扩展。它可以工作,但是你可以看到新的窗口打开,然后又被吸入,并且它使你无法用Ctrl-N打开新窗口,迫使你拖出制表符来使用另一个Chrome窗口。



我可以理解,没有改变它的程序化方式,因为它是一个浏览器设置,但作为工具的用户,它让所有站点都在新窗口中打开令人讨厌。是否有Chrome设置或扩展程序,当它们在没有用户输入的情况下加载时会在标签中打开链接?我意识到打开一堆窗户是浏览器旨在阻止的事情,但这是我想要允许的一次。

 < input id =openAllBtntype =buttonvalue =打开所有链接> (或按任意键)
< script type =text / javascriptsrc =http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js><< ; /脚本>
< script type =text / javascript>
函数openAll(){
window.open('http://yahoo.com/');
window.location.replace('http://www.bing.com/');
返回false; (文档).bind('keypress',openAll);
$(#openAllBtn)。 bind(click,openAll);
openAll();
});
< / script>

以下是一段代码: http://jsfiddle.net/sfzjR/

解决方案


是否有Chrome设置或扩展程序
,当
在没有用户输入的情况下加载时,它们将在标签页中打开链接?


查看 Chrome扩展文档中的create方法。默认情况下,它会打开一个新标签页,你可以选择指定你想要打开的标签页窗口,并给这个标签页设置一个url。


I'm developing a tool that lets you open multiple pages at once with a shortcut, to be used for things like opening your daily sites or querying multiple search engines for a phrase. In Firefox, Internet Explorer and Opera, assuming you've unblocked pop-ups for the domain, the code works as expected.

Chrome, however, opens the sites in new windows instead of tabs if the links are opened automatically when the page loads. If openAll() is commented out and the button is clicked or a key is pressed, the pages open in tabs. Note it's calling the exact same function.

The best solution I've found (which isn't saying much) is the One Window extension. It works, but you can see the new window open then get sucked back in, and it keeps you from opening new Windows with Ctrl-N, forcing you to drag tabs out to use another Chrome window.

I can understand there not being a programmatic way to change this because it's a browser setting, but as a user of the tool it's annoying to have the sites all open in new windows. Is there a Chrome setting or extension that will open links in tabs when they're loaded without user input? I realize opening a bevy of windows is the very thing browsers aim to stop, but this is one time where I want to allow it.

<input id="openAllBtn" type="button" value="Open all links"> (Or press any key)
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"></script>
<script type="text/javascript">
function openAll() {
    window.open('http://yahoo.com/');
    window.location.replace('http://www.bing.com/');
    return false;
}
$(document).ready(function() {
    $(document).bind('keypress', openAll);
    $("#openAllBtn").bind("click", openAll);
    openAll();
});
</script>

Here's a Fiddle of the code: http://jsfiddle.net/sfzjR/

解决方案

Is there a Chrome setting or extension that will open links in tabs when they're loaded without user input?

Check out the create method in the chrome extension docs. By default it will open a new tab, you can optionally specify the window you want that tab to open in, and give the tab a url.

这篇关于如何让Chrome在新标签页中打开多个网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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