We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

ابحث في الدعم

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

window.sidebar.addPanel追加的书签默认是在侧栏加载的,怎么通过js设置它不在侧栏加载?

  • 4 ردود
  • 24 have this problem
  • 1 view
  • آخر ردّ كتبه flysky862

more options

1、实现代码

<script>
function addfavorite()
{
   if (document.all)
   {
      window.external.addFavorite('URL','登录画面');
   }
   else if (window.sidebar)
   {
      window.sidebar.addPanel('登录画面', 'URL', "");
   }
}
</script> 

2、上面的代码实现了追加书签的功能,但是追加的书签默认是在侧栏加载的,请问如何通过js来设置书签的属性,使追加的书签能够在当前标签页中打开,而不是在侧栏中打开。或者能够像firefox3.6版本那样,在弹出的书签追加对话框上,有个复选框“在侧栏中载入此书签”,让用户自己做选择。

1、实现代码 <pre><nowiki><script> function addfavorite() { if (document.all) { window.external.addFavorite('URL','登录画面'); } else if (window.sidebar) { window.sidebar.addPanel('登录画面', 'URL', ""); } } </script> </nowiki></pre> 2、上面的代码实现了追加书签的功能,但是追加的书签默认是在侧栏加载的,请问如何通过js来设置书签的属性,使追加的书签能够在当前标签页中打开,而不是在侧栏中打开。或者能够像firefox3.6版本那样,在弹出的书签追加对话框上,有个复选框“在侧栏中载入此书签”,让用户自己做选择。

Modified by cor-el

الحل المُختار

firefox too bad

Read this answer in context 👍 0

All Replies (4)

more options

You can ask visitors to press Ctrl + D to bookmark the current page. Using that JavaScript will always create a bookmark that opens in the sidebar and there is no other method to create a bookmark.

more options

Thank you very much

more options

الحل المُختار

firefox too bad