用javascript打开一个新选项卡,但保持当前选项卡

编程入门 行业动态 更新时间:2024-10-28 09:19:28
本文介绍了用javascript打开一个新选项卡,但保持当前选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

感谢您的帮助

解决方案

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

browser.tabs.loadDivertedInBackground = true

Is it possible to open a new tab in Firefox using the window.open("www.google"); 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打开一个新选项卡,但保持当前选项卡

本文发布于:2023-11-27 20:47:06,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项卡   javascript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!