Bookmark panel refactor
After the PR to adjust the panel height #5172 I realized there are some things that can be improved for the BookmarkPanelHub.
Specifically we were keeping around a reference to the window and document where the bookmark action happened and we were using this in most of the code. It made it very difficult to test and to mock for ASRAdmin. I find it clearer to pass the window object as argument to the function.
I combined this with another asrouter admin request: open the bookmark panel when previewing the message. And this works with preview endpoints without any code change (and it opens the panel automatically when you navigate to the url) To test:
| Pref name | Pref value |
|---|---|
| browser.newtab.activity-stream.asrouter.whitelistHosts | ["gist.githubusercontent.com"] |
Test url
about:newtab?endpoint=https://gist.githubusercontent.com/piatra/d193ca7e0f513cc19fc6a1d396c214f7/raw/a9d815080912078008613cc476a197034c998013/bookmark_endpoint.json
Preview
