Update ctrlnumber.js to ignore pinned tabs #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #5 by ignoring pinned tabs by default
Project proposal
2023-12-03 @ 18:24
I want to get better at programming, that means being able to write code that solves problems. Adding to a plugin I use provides;
I'm thinking of improving the plugin firefox-ctrlnumber as its a simple one & I have a very simple idea of how I would improve it.
I would like it to ignore pinned tabs for which I sent a feature request but I would like it give it a go myself.
Improving firefox-ctrlnumber
2023-12-05 @ 16:32
From my experience most pinned tabs are not used for general browsing and users often already have unique shortcuts for the ones they need this is evidenced by the fact firefoxe's built in ctrl+tab ignores pinned tabs. Therefore ignoring pinned tabs is a sensible default.
The code
The main code of the extension is as follows:
From initial inspection it would seem all I need to do is add a modifier to the query in line 3,
The documentation for
tabs.quiery
is very clear and lists one of the optional properties as:pinned
Optionalboolean
. Whether the tabs are pinned.so I add
, pinned: false
like so:I assume it handles multiple
queryObj
as&&
as there already seems to be 2 in there separated by commas working just fine.The full
src/ctrlnumber.js
would then be:The next step is to figure out how to test & apply my solution...
Implementation
2023-12-05 @ 16:43
I have Mozilla's documentation very clear and helpful and very quickly found a page explaining how to implement your own extensions.
The extension will be installed & enabled until you restart Firefox.
I cloned the Git repo & made the previously described amendment, added it as a temporary add-on and it worked as expected.
Further improvement's
2023-12-06 @ 04:20
From here a basic preferences page could be added allowing users to change which tabs are ignored.