It was reading properties that a scroll event does not have.
It was messaging the background page with an expensive call on every
scroll event. This slowed down the page unnecessarily.
Also extracted jumps.timeoutid to the content script scope.
This variable is not useful to others outside of the current content
script. Storing it locally means we can avoid expensive communication
with the background page and only do it once we're sure we need to add
a new entry to the jump list.
The entire config gets written to one storage or the other and there's
no support for partially setting values locally or remotely; so it's
meaningless to try and merge them on initialization.
The storageloc setting is inherently unsyncable; since it is used to
decide which storage to use, it is always set to "local" in local
storage and "sync" in sync storage. Any updates from sync storage will
cause mayhem and override local settings with "sync".
So instead, ensure that it is always saved to local storage with the
intended value, and that remote updates cannot change it.
The prior (and still default) autocontain behaviour is to intercept all
page loads that match an aucon pattern, and may even replace a tab to do
so. "relaxed" mode is introduced here as a way to only apply the rules
when opening a new tab.
Updates to the global configuration object happen via storage onChanged
event, however this is not guaranteed to fire before a set() promise
resolves: https://bugzilla.mozilla.org/show_bug.cgi?id=1554088
This can lead to situations where setting multiple values in sequence
can result in a previously scheduled callback clobbering newer settings.
Slightly mitigate races by not replacing the entire object; however this
only helps with flat values and won't catch nested object updates such
as the keymap settings.
GitHub sponsors have invited me to the beta. There isn't one for organisations
yet so you'll have to trust me to distribute the donations fairly.
I pinky promise that I will.
This just removes the background.ts code that detects whether the user
wants to clobber their csp and adds an error message if the user tries
to `set csp clobber`.
The `csp` setting is marked as deprecated but left untouched in case we
find a way to edit CSP in a way that complies with Mozilla's policies.
The csp-editing code in `requests.ts` is left untouched for the same
reason.