用javascript打开一个新选项卡,但保持当前选项卡 [英] Open a new tab with javascript but stay on current tab

查看:95
本文介绍了用javascript打开一个新选项卡,但保持当前选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用window.open(http://www.google.com)在Firefox中打开新选项卡;函数,但打开它在后台,并保持在当前页面?



感谢您的帮助

解决方案

您无法使用JavaScript在后台打开选项卡,因为这是在 about:config 的用户首选项中设置的,您没有掌控。设置为:

  browser.tabs.loadDivertedInBackground = true 


Is it possible to open a new tab in Firefox using the window.open("http://www.google.com"); function, but open it in the background and remain on the current page?

Thanks for any help

解决方案

You can't open tabs in the background using javascript because this is set in the user's preferences in about:config, which you have no control over. The setting is:

browser.tabs.loadDivertedInBackground=true

这篇关于用javascript打开一个新选项卡,但保持当前选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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