javascript - How can I open a tab next to the activeTab from a Safari extension? -


i want open tab using tabs , windows api, so...

var newtab = safari.application.activebrowserwindow.opentab(); newtab.url = blahurl; 

...such new tab appears next visible tab. there method this, requires index. there not seem way current tab's index. have loop through , find index value of active tab?

i want sure opens new tab instead of window. if use javascript method open new tab, may open new window based on user settings, correct?

to index of active tab, can use

safari.application.activebrowserwindow.tabs.indexof(safari.application.activebrowserwindow.activetab) 

if use opentab method of safari browser window object, it's guaranteed open tab , not window.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -