Always include pageAction buttons in the address bar
Categories
(Firefox :: Toolbars and Customization, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox88 | --- | verified |
People
(Reporter: mstriemer, Assigned: adw)
References
(Blocks 1 open bug)
Details
(Whiteboard: [proton-address-bar])
Attachments
(1 file, 1 obsolete file)
All pageAction buttons should be included in the address bar.
This can be achieved by updating the pinnedToUrlBar
property [1] to always return true. There is some state management code in PageActions.jsm so there could be some better way of doing this but it looks like this could be a simple way to get started.
The bookmark button should always be the last button on the address bar. Changing the pinnedToUrlBar
logic to always return true appears to break this functionality.
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Comment 2•4 years ago
|
||
I can add a test for that but first wanted to verify that I'm doing the right change here.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
The IDs of actions pinned to the urlbar are kept in
PageActions._persistedActions.idsInUrlbar
. To pin all actions to the urlbar,
theoretically all we need to do is add all action IDs to this array, and things
should just work. PageActions already has a migration mechanism that could check
if Proton is enabled and add all the action IDs if it is. However, that would
mean that if Proton were subsequently disabled, or if the user downgraded to a
Firefox without Proton, they'd end up with all their actions still in the
urlbar. They could remove them one by one so it's not a big problem, but it
would be annoying.
Instead, this patch keeps two arrays of urlbar IDs. One stashes the user's
original pinned actions and PageActions never touches it as long as Proton is
enabled, and the other is the usual array that happens to have the IDs of all
the actions when Proton is enabled.
When PageActions initializes _persistedActions
on init (by either loading it
from prefs or using the default value), it moves idsInUrlbar
to
_idsInUrlbarNonProton
and then sets idsInUrlbar
to an empty array. When
PageActions subsequently registers all the built-in actions, it forces
action._pinnedToUrlbar
to true instead of computing it from idsInUrlbar
, and
since pinnedToUrlbar
is true, all actions end up in idsInUrlbar
. PageActions
works as it usually does after that, except that when it stores
_persistedActions
back to prefs, it moves _idsInUrlbarNonProton
back to
idsInUrlbar
, just for the store.
Ultimately we need to redesign this module. We can remove a lot of it since
Proton removes the panel, and we don't need the idsInUrlbar
array at all since
now all actions must be in the urlbar.
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
Assignee | ||
Comment 7•4 years ago
|
||
Assignee | ||
Comment 8•4 years ago
|
||
Assignee | ||
Comment 9•4 years ago
|
||
Assignee | ||
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
Comment 12•4 years ago
|
||
bugherder |
Updated•3 years ago
|
Description
•