Open bjohas opened 2 years ago
@balta2ar - any thoughts on this? I could look at this and do a PR - would that be welcome?
Sure! But before you start writing code, as the first phase, could you do a "research" phrase where you'd look into the available APIs in different browsers and estimate where this feature may incur changes in the code? Feel free to post the relevant links and ideas here. What I mean is something like a planning stage. And then when we're on the same page, it can follow with code.
@balta2ar Hello again. I've looked at this. It doesn't seem to be possible to get the profile like this. However, I have another proposal.
The problem I am trying to solve is to make each instance of the brotab extension unique, so that I know which Profile it corresponds to. There doesn't seem to be unique id associated with each instance.
Would you be ok with the introduction of an option for the brotab browser extension, through which users can add a unique string to this instance? If the string is set, then, e.g., bt clients
would return
$ bt clients
a. localhost:4625 4302 chrome/chromium string1
b. localhost:4626 8583 chrome/chromium string2
How does that sound?
add a unique string to this instance
How would you do that?
An alternative I've just thought about is the following. It's a bit hacky, but it doesn't require changes in brotab, only in your wrapper scripts.
In each profile that you have, you open a tab with a magic title, e.g. file:///home/user/profile1.html
, then you use that magic string to figure out which mediator port corresponds to which profiles. It requires an extra tab, which should always be there, but if you are a tab hoarder like me, you wouldn't even notice 😅 What do you think?
Hi @balta2ar,
I lost track of responding, but I actually made some local changes and have used them since last year. I've added "storage" to the permissions:
Manifest:
"options_page": "options.html",
...
"permissions": ["nativeMessaging", "tabs", "activeTab", "<all_urls>","storage"],
Then: background.js
chrome.storage.sync.get({
brotab_identifier: 'profile_1'
}, function(items) {
instID = items.brotab_identifier;
});
return "chrome/chromium\t"+instID;
Via the options page options.html
, the identifier can be set.
Would you be happy for me to do a PR on this?
I guess if you have the changes locally it's no harm to make a PR :) Do you think you could also come up with a test for this?
I've done a PR. As noted in the PR, this is initially for discussion. Needs more polishing/testing, and a test as well.
Let us know if there's anything else we should do - we're keen to get this integrated into the code.
I am trying to get certain tabs to open in certain profiles. E.g. in chrome,
chrome://version/
, gives meHowever, when I query this tab, I only get this:
Is there a way to access the profile? E.g.,
or maybe
Many thanks!