X
Nhấn vào đây để đến phiên bản di động của trang web.

Diễn đàn trợ giúp

open url in specific tab

Được đăng

Hi,

I'd like to open a specific URL in a specifically identified tab.

Suppose my Firefox browser is open with 3 tabs: tab 1 has support.mozilla.org loaded tab 2 has mozilla.org loaded tab 3 has www.thunderbird.net loaded

I'd like to run a shell command such as "firefox.exe https://iot.mozilla.org", but I'd also like this URL to load in tab 2, no matter where the user's focus is. Is this possible? How can I identify the Firefox tab from command line? One way would be to detect the web page title string, eg. "firefox.exe https://iot.mozilla.org --open-in-tab=\"Internet for people\"" (I just made up that option of course).

Thanks

Hi, I'd like to open a specific URL in a specifically identified tab. Suppose my Firefox browser is open with 3 tabs: tab 1 has support.mozilla.org loaded tab 2 has mozilla.org loaded tab 3 has www.thunderbird.net loaded I'd like to run a shell command such as "firefox.exe https://iot.mozilla.org", but I'd also like this URL to load in tab 2, no matter where the user's focus is. Is this possible? How can I identify the Firefox tab from command line? One way would be to detect the web page title string, eg. "firefox.exe https://iot.mozilla.org --open-in-tab=\"Internet for people\"" (I just made up that option of course). Thanks

Chi tiết hệ thống bổ sung

Phần bổ trợ đã cài đặt

  • Shockwave Flash 28.0 r0
  • 5.1.50907.0

Ứng dụng

  • Chuỗi đại diện người dùng: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0

Thông tin chi tiết

Wesley Branton
  • Top 10 Contributor
705 giải pháp 5596 câu trả lời
Được đăng

To the best of my knowledge, this isn't possible. It's partly because each tab that Firefox creates is given an ID that doesn't necessarily match up to the 1, 2, 3 concept that you mentioned and it's not necessarily going to be the same ID each time.

For example, if a user opens five tabs, let's assume that they are given the IDs 104 to 109. Then the user removes the 106 tab and creates a new tab that's given the ID 110. Now they drag tab 108 into the second position. That now gives us 104, 108, 105, 107, 109, 110 in that order. That's assuming that the tabs are given consecutive IDs.

You could access and modify the tabs using the tabs Javascript API in an extension, but it would not be as simple as simply selecting the second tab on the browser list.

To the best of my knowledge, this isn't possible. It's partly because each tab that Firefox creates is given an ID that doesn't necessarily match up to the 1, 2, 3 concept that you mentioned and it's not necessarily going to be the same ID each time. For example, if a user opens five tabs, let's assume that they are given the IDs 104 to 109. Then the user removes the 106 tab and creates a new tab that's given the ID 110. Now they drag tab 108 into the second position. That now gives us 104, 108, 105, 107, 109, 110 in that order. That's assuming that the tabs are given consecutive IDs. You could access and modify the tabs using [https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs the tabs Javascript API in an extension], but it would not be as simple as simply selecting the second tab on the browser list.

Người tạo câu hỏi

Wesley Branton said

To the best of my knowledge, this isn't possible. It's partly because each tab that Firefox creates is given an ID that doesn't necessarily match up to the 1, 2, 3 concept that you mentioned and it's not necessarily going to be the same ID each time.

Well, in my example I used tab1, tab2, etc. just as a way to say "one tab, another tab, etc". What I was suggesting was to identify a tab according to the web page's HTML title loaded within that tab. This is because the HTML title string is always loaded within the tab as shown even through tools such as AutoIT's Windows Info. Of course, the same HTML title string can be loaded in more than one tab, but the "open-in-tab" virtual option could very well be fine-tuned with "first match" or "order by tab creation time" or whatever.

Anyway, I haven't found anything in the current Firefox options so I guess you're right to say that it isn't possible at this time.

Thanks

''Wesley Branton [[#answer-1194974|said]]'' <blockquote> To the best of my knowledge, this isn't possible. It's partly because each tab that Firefox creates is given an ID that doesn't necessarily match up to the 1, 2, 3 concept that you mentioned and it's not necessarily going to be the same ID each time. </blockquote> Well, in my example I used tab1, tab2, etc. just as a way to say "one tab, another tab, etc". What I was suggesting was to identify a tab according to the web page's HTML title loaded within that tab. This is because the HTML title string is always loaded within the tab as shown even through tools such as AutoIT's Windows Info. Of course, the same HTML title string can be loaded in more than one tab, but the "open-in-tab" virtual option could very well be fine-tuned with "first match" or "order by tab creation time" or whatever. Anyway, I haven't found anything in the current Firefox options so I guess you're right to say that it isn't possible at this time. Thanks