DEPRECATED - StackOverflow Steroids
DEPRECATED - This Chrome extension / repo is not mainatained any more.
Improved StackOverflow UX and usability!
Download from Chrome Store: https://chrome.google.com/webstore/detail/stackoverflow-steroids/hmpehldkjbnpdhebfangeaoabhphihic
How to introduce new features and improvements
CSS
)
Improve current features (-
In
popup.html
or using the inspector on the popup of the extension, find theid
of the<label>
associated to the feature that you want to modify. It will look something likenavbar-cb
and all of them end in-cb
. -
Edit
steroids.css
as desired, but taking care to:-
Always prefix new
CSS
selectors and put them in separated lines. For the previous example, a new selector will look something likebody.sos-navbar.sos-another-feature-id #rest-of-your > .selectors
.There are just a few exceptional selectors that are not prefixed as they introduce very subtle changes.
-
There are a few comments that group
CSS
blocks for the same feature, like/* TOP NAVBAR ///...///*/
. Try to find the appropriated place for yours or create a new one.
-
JS
)
Improve current features (-
In
popup.html
or using the inspector on the popup of the extension, find theid
of the<label>
associated to the feature that you want to modify. It will look something likescroll-cb
and all of them end in-cb
. -
In
content-sript.js
there is a functionupdateInjection()
whose first line looks like:chrome.storage.sync.get(["global-cb", ...], function(res) { ... });
. There should be anif
-else
block for the feature you are looking for, for exampleif(res["scroll-cb"]){ ... } else { ... }
.-
The
if
part introduces changes, normally using event listeners, so if you want to edit a current feature you would probably need to check the event listenerfunction
.You can see that the property is being deleted from the
res
object
in the first line of theif
block. This is because this feature only introducesJS
code. If it injectedCSS
too, it should NOT be deleted. Otherwise, the associatedCSS
would not be applied. -
The
else
part removes those changes, so that if the user disables the associated feature, it won't be necessary to reload the existing pages for them to be disabled.In both cases a
try
-catch
block is needed just in case the current feature only affects elements present in some of the pages targeted by the extension.
-
CSS
)
Introduce new features (-
In
popup.html
, you should add a new entry in the appropriated place. Just take a look to the current code to see what you need to copy and where to paste it. You can also create a new section if needed. Then, change theid
of the<label>
associated to the entry that you have created and change its title and description. It will look something likefeature-cb
and all of them must end in-cb
. -
Edit
steroids.css
as desired, but taking care to:-
Always prefix new
CSS
selectors and put them in separated lines. For the previous example, a new selector will look something likebody.sos-feature.sos-another-feature-id #rest-of-your > .selectors
.There are just a few exceptional selectors that are not prefixed as they introduce very subtle changes.
-
There are a few comments that group
CSS
blocks for the same feature, like/* TOP NAVBAR ///...///*/
. Try to find the appropriated place for yours or create a new one.
-
JS
)
Introduce new features (-
In
popup.html
, you should add a new entry in the appropriated place. Just take a look to the current code to see what you need to copy and where to paste it. You can also create a new section if needed. Then, change theid
of the<label>
associated to the entry that you have created and change its title and description. It will look something likefeature-cb
and all of them must end in-cb
. -
In
content-sript.js
there is a functionupdateInjection()
whose first line looks like:chrome.storage.sync.get(["global-cb", ...], function(res) { ... });
. You need to add theid
of your new feature in thatArray
. -
Inside the callback, you should add an
if
-else
block for the new feature, for exampleif(res["feature-cb"]){ ... } else { ... }
.-
The
if
part introduces changes, normally using event listeners, so you better create a newfunction
outside the callback and bind the events from here.If your feature only introduces
JS
code, delete your property from theres
object
in the first line of theif
block. If it injectedCSS
too, it should NOT be deleted. Otherwise, the associatedCSS
would not be applied. -
The
else
must remove those changes, so that if the user disables the associated feature, it won't be necessary to reload the existing pages for them to be disabled.In both cases a
try
-catch
block is needed just in case the current feature only affects elements present in some of the pages targeted by the extension.
-
Target new pages
To target new pages, a new rule must be added to the matches
properties of the manifest
(inside content_scripts
).
TO-DO
- Open links in questions and answers in new tabs.
- Add hidden editor features, as
<kbd>Key</kbd>
that shows up as Key, in the editor toolbar and in the editor help. - Auto-resize editor instead of using scrollbars.
- Fix the editor toolbar to the top of the page (after the menu if it is fixed-positioned too) when we scroll down to avoid being constantly scrolling up and down if we prefer to use the toolbar instead of the syntax.
- Make Tab key write 4 spaces and Shift + Tab remove them.