You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of the javascript logic, preference checking, and expensive individual element style setting that executes every page load (for every post) can be converted to some CSS that we generate once in the background page and insert into tabs as necessary with tabs.insertCSS().
Ideally I'd like to configure the background page to be persistent rather than event (event pages aren't even supported on Firefox, so on Firefox it's already persistent). It may even be acting as persistent on Chrome with the way it's listening for messages. If we make the background page officially persistent, it could generate the CSS once on extension load (and, subsequently, if any preference that would affect styles is modified in the settings) and keep a copy of it in memory. Then, when an SA forum page is loaded, it can inject the relevant CSS immediately. There would be separate CSS sets for different forum contexts (showthread and forumdisplay+usercp would be the two main ones)
Another option could be to store the computed CSS strings somewhere else, perhaps storage.local, but there it would count against the 5MB limit and have to get loaded out of storage each page load, which would slow things down somewhat.
Yet another option is for the background page to compute it on page load, but this, too, is less than ideal.
This feature will also helpfully reduce the amount of stuff that needs to be converted from jQuery in the main part of the extension. It will make things nicer for the users with SALR's style changes applying more quickly and with fewer reflows. The result of this feature will be most noticeable for options like thread highlighting where a lot of CSS is applied.
The text was updated successfully, but these errors were encountered:
Doing it this way will require adding a host permission to the manifest for *://forums.somethingawful.com/*.
This will result in a dialog requesting additional permissions when the extension updates; not sure how big a deal that is, but it'd be worth it for the performance gains.
A lot of the javascript logic, preference checking, and expensive individual element style setting that executes every page load (for every post) can be converted to some CSS that we generate once in the background page and insert into tabs as necessary with
tabs.insertCSS()
.Ideally I'd like to configure the background page to be persistent rather than event (event pages aren't even supported on Firefox, so on Firefox it's already persistent). It may even be acting as persistent on Chrome with the way it's listening for messages. If we make the background page officially persistent, it could generate the CSS once on extension load (and, subsequently, if any preference that would affect styles is modified in the settings) and keep a copy of it in memory. Then, when an SA forum page is loaded, it can inject the relevant CSS immediately. There would be separate CSS sets for different forum contexts (showthread and forumdisplay+usercp would be the two main ones)
Another option could be to store the computed CSS strings somewhere else, perhaps
storage.local
, but there it would count against the 5MB limit and have to get loaded out of storage each page load, which would slow things down somewhat.Yet another option is for the background page to compute it on page load, but this, too, is less than ideal.
This feature will also helpfully reduce the amount of stuff that needs to be converted from jQuery in the main part of the extension. It will make things nicer for the users with SALR's style changes applying more quickly and with fewer reflows. The result of this feature will be most noticeable for options like thread highlighting where a lot of CSS is applied.
The text was updated successfully, but these errors were encountered: