Feat: add incognito login as
Describe your changes
Add a new button in user detail, calling method loginAsInIncognito(userId) that encapsulate getLoginAsLink(userId) in a new incognito window
Issue ticket number and link
#381
Checklist before requesting a review
- [x] I have read and understand the Contributions section
- [x] Target branch is releaseCandidate and not master
- [x] I have performed a self-review of my code
- [x] I ran the unit tests and my PR does not break any tests
- [x] I documented the changes I've made on the CHANGES.md and followed actual conventions
- [x] I added a new section on how-to.md (optional)
Great addition @alanjaouen π For now I think we are missing a margin when the user is also a portal user (we could also provide an incognito link for this !)
To be honest I was not very satisfied when I added the Login to experience button but now I think we have too many buttons.
I was thinking of a combination of key press + click to open the link in an anonymous window but I'm 100% sure that no one reads the doc and will be aware of this new feature π
We could use icons instead of buttons but not sure if it will be very UI friendly .. Would you have something in mind ? @nshulman any idea ?
Maybe an option to enable user's action icons instead of buttons with text ?
@tprouvot yes in fact there is a lot of button now ^^ didn't wanted to break everything for my first PR ahah
for now I will fix marging and add incognito for experience
@tprouvot I can experiment and see how some options look later this week. I can't remember where I saw it but someone suggested button visibility in options so they can hide the ones they will not use, that could be a useful, easy solution to start with (maybe a More or expandable menu for any hidden ones). I like the icons option idea too and can add more slds icons.
@tprouvot factorised between platform/experience user & created method openUrlInIncognito but feels like UserDetails may be not the right spot to put it, let me know if there is a class somewhere I can put this
@alanjaouen I'm ok with adding the method in User details since I think those are the only use cases where we need to open an incognito window. Thanks for adding it to Experience button !
Since some methods are chrome dependent could you test this functionality on firefox ? You should have a firefox branch which contains some small differences which allows you to test locally the plugin on firefox
What about this one ?
Hi @tprouvot, I didn't manage to make the addon works in firefox (addon is enable, but is not displayed in salesforce page) :/ is there something more to do than https://github.com/tprouvot/Salesforce-Inspector-reloaded?tab=readme-ov-file#firefox ?
Hi @tprouvot, I didn't manage to make the addon works in firefox (addon is enable, but is not displayed in salesforce page) :/ is there something more to do than https://github.com/tprouvot/Salesforce-Inspector-reloaded?tab=readme-ov-file#firefox ?
Hi @alanjaouen,
I updated the documentation which was not up to date, could you try with those guidelines ?
- Checkout branch firefoxAddon and enter addon directory.
- Click on the cog icon and select
Debug Add-ons - Click
Load Temporary Add-onβ¦. - Select the file
addon/manifest.json.
Hi guys, @alanjaouen @nshulman @jefersonchaves
What do you think about this ?
I'm not sure about the UI and the extra clicks that would require [edit] solve the extra clicks by using onMouseEnter and onMouseLeave
@tprouvot - It looks like a good compromise.
@alanjaouen does the login to portal (incognito) works for you ? Because it doesn't on my side. That being said, I'm realizing that unless the login as for crm users, the login as portal doesn't kill the previous session which means you can keep both sessions in parallel. So maybe we don't need the incognito mode for portal users ..
@alanjaouen I'm ok with current design but I tested on firefox and LoginAs incognito does not work, I deployed your PR on this branch for firefox testing
@alanjaouen does the login to portal (incognito) works for you ? Because it doesn't on my side. That being said, I'm realizing that unless the login as for crm users, the login as portal doesn't kill the previous session which means you can keep both sessions in parallel. So maybe we don't need the incognito mode for portal users ..
@tprouvot indeed, this feature is not needed for portal user
Hi @alanjaouen, I updated the documentation which was not up to date, could you try with those guidelines ? Checkout branch firefoxAddon and enter addon directory. Click on the cog icon and select Debug Add-ons Click Load Temporary Add-onβ¦. Select the file addon/manifest.json.
I tried, the addon now loads, but I cannot see the popup in any salesforce org
On my side I'm trying to use browser.extension.isAllowedIncognitoAccess() and browser.windows.create to be compatible with firefox but I'm facing errors like
Uncaught TypeError: browser.extension.isAllowedIncognitoAccess is not a function and
Uncaught TypeError: can't access property "create", browser.windows is undefined
@tprouvot I find out that browser.extension.isAllowedIncognitoAccess is not accessible in background script (works well on front tho)
for Uncaught TypeError: can't access property "create", browser.windows is undefined, we can access it by moving the windows creation to the background script itself, and using messaging to trigger it
Hi @alanjaouen, I'm ok with adding the method in background where browser is not undefined π
I was wondering why there was some conflicts with the manifest file and I found out that you merged firefoxAddon branch into you PR which is not the intention.
manifest file is quite different (still in manifest v2 and other browser differences) I did create a branch to test your PR on firefox. But at the end the changes made for firefox should not integrate releaseCandidate branch.
Could you revert the merge ? I'm available if you want to discuss it by call
hi @tprouvot,
oh yes, totally screw locally between remotes, reverted the merge, we should rebase the PR when ready to merge, so the history will be clean
the actual code is working on both chrome and firefox
one thing that can be improve is the error management: as the actual code does not check is extension is enabled in incognito (thus this is not requiered in firefox), in chrome an error is raise if the extention is not enabled, but no message are displayed to the user
@alanjaouen I think we are close ! I'll do some tests on firefox also but should be ok soon, thank you very much this is a great feature π
Thank you @alanjaouen for this great improvement !