Adding upstream version 0.4.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
12
.babelrc
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"useBuiltIns": "usage",
|
||||
"modules": "commonjs",
|
||||
"debug": false
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
8
.browserslistrc
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Browsers that we support
|
||||
# This file tells Babel what to do
|
||||
# See https://github.com/browserslist/browserslist for more info
|
||||
|
||||
Firefox >= 45
|
||||
Firefox ESR
|
||||
Opera >= 43
|
||||
Chrome >= 56
|
11
.editorconfig
Normal file
|
@ -0,0 +1,11 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
6
.eslintrc.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": "standard",
|
||||
"globals": {
|
||||
"browser": true
|
||||
}
|
||||
}
|
1
.gitattributes
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
* text=auto
|
53
.gitignore
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
.tmp
|
||||
build
|
||||
dist
|
||||
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
lib-cov
|
||||
coverage
|
||||
.nyc_output
|
||||
.grunt
|
||||
.lock-wscript
|
||||
node_modules
|
||||
jspm_packages
|
||||
.npm
|
||||
.eslintcache
|
||||
.node_repl_history
|
||||
*.tgz
|
||||
|
||||
*.bak
|
||||
|
||||
*~
|
||||
.fuse_hidden*
|
||||
.directory
|
||||
.Trash-*
|
||||
.nfs*
|
||||
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
Desktop.ini
|
||||
$RECYCLE.BIN/
|
||||
*.lnk
|
||||
|
||||
*.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
._*
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
26
.travis.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- 8
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
script: npm run build
|
||||
after_success:
|
||||
- ls -al --block-size=KB build
|
||||
- if [ -n "$TRAVIS_TAG" ]; then rename 's/tab-counter/tab-counter-'"$TRAVIS_TAG"'/' build/tab-counter*; else rename 's/tab-counter/tab-counter-'"$TRAVIS_BRANCH"'-'"$TRAVIS_COMMIT"'/' build/tab-counter*; fi
|
||||
- touch build/verifybuild.txt; echo -n 'Check at the following URL to verify matching SHA256SUMS from the Travis build https://travis-ci.org/DaAwesomeP/tab-counter/jobs/' > build/verifybuild.txt; echo $TRAVIS_BUILD_ID >> build/verifybuild.txt; cat build/verifybuild.txt
|
||||
- sha256sum build/* > build/SHA256SUMS
|
||||
- ls -al --block-size=KB build
|
||||
- cat build/SHA256SUMS
|
||||
before_deploy: echo -n 'The checkums of the files in the Travis build should match those of the uploaded files for the release at https://github.com/DaAwesomeP/tab-counter/releases/tag/' >> build/verifybuild.txt; echo $TRAVIS_TAG >> build/verifybuild.txt; cat build/verifybuild.txt
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: j2/HN9O57AeqgT9XYMnxPmHF+PfQWCtVrB/cGFZzEBB5dKYTghLUNn1p+ZCNueVRNoS2UbufRwKAxonQU0TtFsC1TbgwyC9an6b6gDmSwPyIlY1O5PmM2yq3csR5lqODe9rMcxufsCxm4dksLD26Yz/UOXngh9R1ow9yXJ/+ypo3djzjsmDc5avwHAXUJkvoIKPNkEK9Tb8BfVVC4YO7dgdBC3qE7oohokFsKuHNyLb2cdNm/ge/TKjz2n/EPMNtRRsAPc/KT5jPPao8ClK/4uiwS/9HaixYte9LwSa/Hg2KIoZSPjv/M9c6pSdvywQf5McfK6azr3s970NRRp82Lsz7WNImtCYC/ymUOjRpweoeXh70BvOTXfzBvSgcPpA1HF4s0UTVor212sxLkTAxHZ189w/e8XbgQBnmgE3jdQl72V1+EKZs9b4YzEvrrGLdooAcA1YHEMRj5bp8Vnn/tQFLvoKe+EyO4DFaxsFjBu0mpP+GIOughAX6LQ6bW0klqbFUaUXPciFaJrSAWgjPccZzk5yGKjaYC1rRdwTEW0NGYatP9kyAMi8MLP0vfdwq5NnluBHQv5vOFAu8QcSwLUysaS5Yn5v4FTZvVvCli1zUSqTLn62wIF+IIL3QfBPy3pKBOdwuZ9iGGdJ8QnXdvrZUh1XEzk/XCaNmpoZPE7Q=
|
||||
file_glob: true
|
||||
file: build/*
|
||||
skip_cleanup: true
|
||||
on:
|
||||
repo: DaAwesomeP/tab-counter
|
||||
tags: true
|
201
LICENSE
Normal file
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
28
README.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
tab-counter [](https://travis-ci.org/DaAwesomeP/tab-counter)
|
||||
===========
|
||||
A button badge that shows the number of tabs open in a window. This addon was created as a WebExtension Replacement for [Michael Kraft's Tab Counter](https://addons.mozilla.org/en-US/firefox/addon/tab-counter/). Tested for Firefox and Opera.
|
||||
|
||||
| | |
|
||||
|:-------:|-|
|
||||
| [**Firefox**](https://addons.mozilla.org/en-US/firefox/addon/tab-counter-webext/) | [](https://addons.mozilla.org/en-US/firefox/addon/tab-counter-webext/) [](https://addons.mozilla.org/en-US/firefox/addon/tab-counter-webext/) [](https://addons.mozilla.org/en-US/firefox/addon/tab-counter-webext/) [](https://addons.mozilla.org/en-US/firefox/addon/tab-counter-webext/) [](https://addons.mozilla.org/en-US/firefox/addon/tab-counter-webext/) |
|
||||
| [**Opera**](https://addons.opera.com/en/extensions/details/tab-counter-2/) | [](https://addons.opera.com/en/extensions/details/tab-counter-2/) |
|
||||
| [**WebExtension**](https://github.com/DaAwesomeP/tab-counter/releases/latest) | [](https://github.com/DaAwesomeP/tab-counter/releases/latest) [](https://github.com/DaAwesomeP/tab-counter/releases/latest) [](https://github.com/DaAwesomeP/tab-counter/releases/latest) |
|
||||
| **Chrome** | *Google charges a developer fee to enlist in the Chrome Web Store. Please use the Opera WebExtension download.* |
|
||||
|
||||
## Development
|
||||
You will need NodeJS v7 or higher with the NPM v4 or higher.
|
||||
```bash
|
||||
# install dependencies
|
||||
npm i
|
||||
|
||||
# build extension (makes ZIP archives in build/)
|
||||
npm run build
|
||||
|
||||
# watch for changes and build dist/ (temporarily rename a manifest to load unpacked)
|
||||
npm run watch
|
||||
|
||||
# check package.json and gulpfile.js for more commands
|
||||
```
|
||||
|
||||
## License
|
||||
[Apache 2.0](https://github.com/DaAwesomeP/tab-counter/blob/master/LICENSE)
|
97
gulpfile.js
Normal file
|
@ -0,0 +1,97 @@
|
|||
/* gulpfile.js
|
||||
* Originally created 3/11/2017 by DaAwesomeP
|
||||
* This is the main build/task file of the extension
|
||||
* https://github.com/DaAwesomeP/tab-counter
|
||||
*
|
||||
* Copyright 2017-present DaAwesomeP
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const gulp = require('gulp')
|
||||
const del = require('del')
|
||||
const lec = require('gulp-line-ending-corrector')
|
||||
const bro = require('gulp-bro')
|
||||
const babelify = require('babelify')
|
||||
const eslint = require('gulp-eslint')
|
||||
const rename = require('gulp-rename')
|
||||
const sourcemaps = require('gulp-sourcemaps')
|
||||
const zip = require('gulp-zip')
|
||||
|
||||
gulp.task('check', () => {
|
||||
return gulp.src(['src/**/*.js', 'gulpfile.js'])
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError())
|
||||
})
|
||||
|
||||
gulp.task('checkSafe', () => {
|
||||
return gulp.src(['src/**/*.js', 'gulpfile.js'])
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.format())
|
||||
})
|
||||
|
||||
gulp.task('static', () => {
|
||||
return gulp.src('src/**/*.js')
|
||||
.pipe(lec())
|
||||
.pipe(gulp.dest('src'))
|
||||
})
|
||||
|
||||
gulp.task('clean', (callback) => {
|
||||
del(['dist/*', 'build/*']).then(() => {
|
||||
callback()
|
||||
})
|
||||
})
|
||||
|
||||
gulp.task('compile', gulp.parallel(() => {
|
||||
return gulp.src('src/**/*.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(bro({
|
||||
transform: [
|
||||
babelify.configure()
|
||||
]
|
||||
}))
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(gulp.dest('dist'))
|
||||
}, () => {
|
||||
return gulp.src(['src/**/*', '!src/**/*.js'])
|
||||
.pipe(gulp.dest('dist'))
|
||||
}))
|
||||
|
||||
gulp.task('pack', gulp.parallel(() => {
|
||||
return gulp.src(['dist/**/*', '!dist/**/*.map', 'node_modules/underscore/**/*', 'icons/**/clear-*.png', 'icons/**/*.min.svg', 'manifest.firefox.json', 'LICENSE'], { base: '.' })
|
||||
.pipe(rename(path => {
|
||||
if (path.basename === 'manifest.firefox') {
|
||||
path.basename = 'manifest'
|
||||
}
|
||||
}))
|
||||
.pipe(zip('tab-counter.firefox.zip'))
|
||||
.pipe(gulp.dest('build'))
|
||||
}, () => {
|
||||
return gulp.src(['dist/**/*.js', 'dist/**/*.html', 'node_modules/webextension-polyfill/dist/browser-polyfill.js', 'node_modules/underscore/underscore.js', 'icons/**/*.png', 'icons/**/*.min.svg', 'manifest.opera.json', 'LICENSE'], { base: '.' })
|
||||
.pipe(rename(path => {
|
||||
if (path.basename === 'manifest.opera') {
|
||||
path.basename = 'manifest'
|
||||
}
|
||||
}))
|
||||
.pipe(zip('tab-counter.opera.zip'))
|
||||
.pipe(gulp.dest('build'))
|
||||
}))
|
||||
|
||||
gulp.task('watch', gulp.series('checkSafe', 'compile', () => {
|
||||
return gulp.watch(['src/**/*', 'node_modules/webextension-polyfill/**/*', 'node_modules/underscore/**/*', 'icons/**/*', 'manifest.json', 'package.json'], gulp.parallel('checkSafe', 'compile'))
|
||||
}))
|
||||
|
||||
gulp.task('dist', gulp.series('static', 'check', 'clean', 'compile'))
|
||||
gulp.task('build', gulp.series('dist', 'pack'))
|
||||
gulp.task('default', gulp.series('build'))
|
BIN
icons/clear-1.png
Normal file
After Width: | Height: | Size: 95 B |
1
icons/clear.plain.min.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 67.733333 67.733335" height="256" width="256"/>
|
After Width: | Height: | Size: 100 B |
30
icons/clear.plain.svg
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="svg3684"
|
||||
version="1.1"
|
||||
viewBox="0 0 67.733333 67.733335"
|
||||
height="256"
|
||||
width="256">
|
||||
<defs
|
||||
id="defs3678" />
|
||||
<metadata
|
||||
id="metadata3681">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(0,-229.26667)"
|
||||
id="layer1" />
|
||||
</svg>
|
After Width: | Height: | Size: 790 B |
59
icons/clear.svg
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="256"
|
||||
height="256"
|
||||
viewBox="0 0 67.733333 67.733335"
|
||||
version="1.1"
|
||||
id="svg3684"
|
||||
inkscape:version="0.92.0 r15299"
|
||||
sodipodi:docname="clear.svg">
|
||||
<defs
|
||||
id="defs3678" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.35"
|
||||
inkscape:cx="-27.142857"
|
||||
inkscape:cy="560"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="847"
|
||||
inkscape:window-x="1592"
|
||||
inkscape:window-y="91"
|
||||
inkscape:window-maximized="1"
|
||||
units="px"
|
||||
inkscape:showpageshadow="false"
|
||||
borderlayer="true" />
|
||||
<metadata
|
||||
id="metadata3681">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-229.26667)" />
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
BIN
icons/tabcounter-128.png
Normal file
After Width: | Height: | Size: 836 B |
BIN
icons/tabcounter-16.png
Normal file
After Width: | Height: | Size: 255 B |
BIN
icons/tabcounter-256.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
icons/tabcounter-32.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
icons/tabcounter-38.png
Normal file
After Width: | Height: | Size: 334 B |
BIN
icons/tabcounter-64.png
Normal file
After Width: | Height: | Size: 553 B |
BIN
icons/tabcounter-96.png
Normal file
After Width: | Height: | Size: 656 B |
1
icons/tabcounter-black.plain.min.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33.867 33.867" height="128" width="128" fill="#000000" fill-opacity="1"><path d="M-32.4 6.287a1.323 1.323 0 0 0-1.073.546l-4.845 6.684-4.848 6.684a1.323 1.323 0 0 0-.252.775v35.645a1.323 1.323 0 0 0 1.324 1.322h72.257a1.323 1.323 0 0 0 1.323-1.322V20.47a1.323 1.323 0 0 0-1.312-1.324l-9.694-.084-8.966-.078-3.58-5.73L3.967 6.91a1.323 1.323 0 0 0-1.121-.623h-17.623zm.673 2.646h33.84l3.576 5.723L9.654 21a1.323 1.323 0 0 0 1.112.622l9.691.085 8.383.073v33.517h-69.611V21.406l4.593-6.336z" style="shape-padding:0;isolation:auto;mix-blend-mode:normal" overflow="visible"/></svg>
|
After Width: | Height: | Size: 628 B |
1
icons/tabcounter-gray10.plain.min.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33.867 33.867" height="128" width="128" fill="#f9f9fa" fill-opacity="1"><path d="M-32.4 6.287a1.323 1.323 0 0 0-1.073.546l-4.845 6.684-4.848 6.684a1.323 1.323 0 0 0-.252.775v35.645a1.323 1.323 0 0 0 1.324 1.322h72.257a1.323 1.323 0 0 0 1.323-1.322V20.47a1.323 1.323 0 0 0-1.312-1.324l-9.694-.084-8.966-.078-3.58-5.73L3.967 6.91a1.323 1.323 0 0 0-1.121-.623h-17.623zm.673 2.646h33.84l3.576 5.723L9.654 21a1.323 1.323 0 0 0 1.112.622l9.691.085 8.383.073v33.517h-69.611V21.406l4.593-6.336z" style="shape-padding:0;isolation:auto;mix-blend-mode:normal" overflow="visible"/></svg>
|
After Width: | Height: | Size: 628 B |
1
icons/tabcounter-gray90.plain.min.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33.867 33.867" height="128" width="128" fill="#0c0c0d" fill-opacity="1"><path d="M-32.4 6.287a1.323 1.323 0 0 0-1.073.546l-4.845 6.684-4.848 6.684a1.323 1.323 0 0 0-.252.775v35.645a1.323 1.323 0 0 0 1.324 1.322h72.257a1.323 1.323 0 0 0 1.323-1.322V20.47a1.323 1.323 0 0 0-1.312-1.324l-9.694-.084-8.966-.078-3.58-5.73L3.967 6.91a1.323 1.323 0 0 0-1.121-.623h-17.623zm.673 2.646h33.84l3.576 5.723L9.654 21a1.323 1.323 0 0 0 1.112.622l9.691.085 8.383.073v33.517h-69.611V21.406l4.593-6.336z" style="shape-padding:0;isolation:auto;mix-blend-mode:normal" overflow="visible"/></svg>
|
After Width: | Height: | Size: 628 B |
BIN
icons/tabcounter-logo-128.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
icons/tabcounter-logo-16.png
Normal file
After Width: | Height: | Size: 225 B |
BIN
icons/tabcounter-logo-256.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
icons/tabcounter-logo-32.png
Normal file
After Width: | Height: | Size: 435 B |
BIN
icons/tabcounter-logo-38.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
icons/tabcounter-logo-64.png
Normal file
After Width: | Height: | Size: 899 B |
BIN
icons/tabcounter-logo-96.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
1
icons/tabcounter-logo.plain.min.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33.867 33.867" height="128" width="128"><g font-weight="400"><path d="M-32.4 6.287a1.323 1.323 0 0 0-1.073.546l-4.845 6.684-4.848 6.684a1.323 1.323 0 0 0-.252.775v35.645a1.323 1.323 0 0 0 1.324 1.322h72.257a1.323 1.323 0 0 0 1.323-1.322V20.47a1.323 1.323 0 0 0-1.312-1.324l-9.694-.084-8.966-.078-3.58-5.73L3.967 6.91a1.323 1.323 0 0 0-1.121-.623h-17.623zm.673 2.646h33.84l3.576 5.723L9.654 21a1.323 1.323 0 0 0 1.112.622l9.691.085 8.383.073v33.517h-69.611V21.406l4.593-6.336z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal" color="#000" font-family="sans-serif" white-space="normal" overflow="visible" paint-order="fill markers stroke"/><text y="280.067" x="16.553" style="line-height:4.02790976px;-inkscape-font-specification:Lato" font-size="14.098" font-family="Lato" letter-spacing="0" word-spacing="0" stroke-width=".265" transform="translate(0 -263.133)"><tspan style="-inkscape-font-specification:Arial" y="280.067" x="16.553" font-family="Arial">#</tspan></text></g></svg>
|
After Width: | Height: | Size: 1.4 KiB |
45
icons/tabcounter-logo.plain.svg
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="svg3684"
|
||||
version="1.1"
|
||||
viewBox="0 0 33.866667 33.866668"
|
||||
height="128"
|
||||
width="128">
|
||||
<defs
|
||||
id="defs3678" />
|
||||
<metadata
|
||||
id="metadata3681">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(0,-263.13333)"
|
||||
id="layer1">
|
||||
<path
|
||||
id="rect9"
|
||||
d="m -32.400391,269.41992 a 1.323049,1.323049 0 0 0 -1.072265,0.54688 l -4.845703,6.68359 -4.847657,6.68359 a 1.323049,1.323049 0 0 0 -0.251953,0.7754 v 17.82226 17.82227 a 1.323049,1.323049 0 0 0 1.324219,1.32226 H -5.9667969 30.162109 a 1.323049,1.323049 0 0 0 1.324219,-1.32226 v -18.07618 -18.07421 a 1.323049,1.323049 0 0 0 -1.3125,-1.32422 l -9.693359,-0.084 -8.966797,-0.0781 -3.5800782,-5.73047 -3.9667969,-6.34375 A 1.323049,1.323049 0 0 0 2.8457031,269.41992 H -14.777344 Z m 0.673829,2.64649 h 16.949218 16.8906252 l 3.5761719,5.72265 3.9648438,6.34571 a 1.323049,1.323049 0 0 0 1.1113281,0.62109 l 9.691406,0.0859 8.382813,0.0723 v 16.76367 16.75391 H -5.9667969 -40.771484 v -16.5 -17.39258 l 4.59375,-6.33594 z"
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.64583349;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<text
|
||||
id="text822"
|
||||
y="280.06665"
|
||||
x="16.552696"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.09768486px;line-height:4.02790976px;font-family:Lato;-inkscape-font-specification:Lato;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
style="stroke-width:0.26458335px;-inkscape-font-specification:Arial;font-family:Arial;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal"
|
||||
y="280.06665"
|
||||
x="16.552696"
|
||||
id="tspan820">#</tspan></text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.5 KiB |
76
icons/tabcounter-logo.svg
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="128"
|
||||
height="128"
|
||||
viewBox="0 0 33.866667 33.866668"
|
||||
version="1.1"
|
||||
id="svg3684"
|
||||
inkscape:version="0.92.0 r15299"
|
||||
sodipodi:docname="tabcounter-logo.svg">
|
||||
<defs
|
||||
id="defs3678" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="3.959798"
|
||||
inkscape:cx="21.305736"
|
||||
inkscape:cy="81.509772"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="847"
|
||||
inkscape:window-x="1016"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
units="px"
|
||||
inkscape:showpageshadow="false"
|
||||
borderlayer="true" />
|
||||
<metadata
|
||||
id="metadata3681">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-263.13333)">
|
||||
<path
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.64583349;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -32.400391,269.41992 a 1.323049,1.323049 0 0 0 -1.072265,0.54688 l -4.845703,6.68359 -4.847657,6.68359 a 1.323049,1.323049 0 0 0 -0.251953,0.7754 v 17.82226 17.82227 a 1.323049,1.323049 0 0 0 1.324219,1.32226 H -5.9667969 30.162109 a 1.323049,1.323049 0 0 0 1.324219,-1.32226 v -18.07618 -18.07421 a 1.323049,1.323049 0 0 0 -1.3125,-1.32422 l -9.693359,-0.084 -8.966797,-0.0781 -3.5800782,-5.73047 -3.9667969,-6.34375 A 1.323049,1.323049 0 0 0 2.8457031,269.41992 H -14.777344 Z m 0.673829,2.64649 h 16.949218 16.8906252 l 3.5761719,5.72265 3.9648438,6.34571 a 1.323049,1.323049 0 0 0 1.1113281,0.62109 l 9.691406,0.0859 8.382813,0.0723 v 16.76367 16.75391 H -5.9667969 -40.771484 v -16.5 -17.39258 l 4.59375,-6.33594 z"
|
||||
id="rect9"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.09768486px;line-height:4.02790976px;font-family:Lato;-inkscape-font-specification:Lato;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="16.552696"
|
||||
y="280.06665"
|
||||
id="text822"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan820"
|
||||
x="16.552696"
|
||||
y="280.06665"
|
||||
style="stroke-width:0.26458335px;-inkscape-font-specification:Arial;font-family:Arial;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal">#</tspan></text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
1
icons/tabcounter-white.plain.min.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33.867 33.867" height="128" width="128" fill="#ffffff" fill-opacity="1"><path d="M-32.4 6.287a1.323 1.323 0 0 0-1.073.546l-4.845 6.684-4.848 6.684a1.323 1.323 0 0 0-.252.775v35.645a1.323 1.323 0 0 0 1.324 1.322h72.257a1.323 1.323 0 0 0 1.323-1.322V20.47a1.323 1.323 0 0 0-1.312-1.324l-9.694-.084-8.966-.078-3.58-5.73L3.967 6.91a1.323 1.323 0 0 0-1.121-.623h-17.623zm.673 2.646h33.84l3.576 5.723L9.654 21a1.323 1.323 0 0 0 1.112.622l9.691.085 8.383.073v33.517h-69.611V21.406l4.593-6.336z" style="shape-padding:0;isolation:auto;mix-blend-mode:normal" overflow="visible"/></svg>
|
After Width: | Height: | Size: 628 B |
1
icons/tabcounter.plain.min.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33.867 33.867" height="128" width="128" fill="context-fill" fill-opacity="context-fill-opacity"><path d="M-32.4 6.287a1.323 1.323 0 0 0-1.073.546l-4.845 6.684-4.848 6.684a1.323 1.323 0 0 0-.252.775v35.645a1.323 1.323 0 0 0 1.324 1.322h72.257a1.323 1.323 0 0 0 1.323-1.322V20.47a1.323 1.323 0 0 0-1.312-1.324l-9.694-.084-8.966-.078-3.58-5.73L3.967 6.91a1.323 1.323 0 0 0-1.121-.623h-17.623zm.673 2.646h33.84l3.576 5.723L9.654 21a1.323 1.323 0 0 0 1.112.622l9.691.085 8.383.073v33.517h-69.611V21.406l4.593-6.336z" style="shape-padding:0;isolation:auto;mix-blend-mode:normal" overflow="visible"/></svg>
|
After Width: | Height: | Size: 652 B |
37
icons/tabcounter.plain.svg
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="svg3684"
|
||||
version="1.1"
|
||||
viewBox="0 0 33.866667 33.866668"
|
||||
height="128"
|
||||
width="128"
|
||||
fill="context-fill"
|
||||
fill-opacity="context-fill-opacity">
|
||||
<defs
|
||||
id="defs3678" />
|
||||
<metadata
|
||||
id="metadata3681">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(0,-263.13333)"
|
||||
id="layer1">
|
||||
<path
|
||||
id="rect9"
|
||||
d="m -32.400391,269.41992 a 1.323049,1.323049 0 0 0 -1.072265,0.54688 l -4.845703,6.68359 -4.847657,6.68359 a 1.323049,1.323049 0 0 0 -0.251953,0.7754 v 17.82226 17.82227 a 1.323049,1.323049 0 0 0 1.324219,1.32226 H -5.9667969 30.162109 a 1.323049,1.323049 0 0 0 1.324219,-1.32226 v -18.07618 -18.07421 a 1.323049,1.323049 0 0 0 -1.3125,-1.32422 l -9.693359,-0.084 -8.966797,-0.0781 -3.5800782,-5.73047 -3.9667969,-6.34375 A 1.323049,1.323049 0 0 0 2.8457031,269.41992 H -14.777344 Z m 0.673829,2.64649 h 16.949218 16.8906252 l 3.5761719,5.72265 3.9648438,6.34571 a 1.323049,1.323049 0 0 0 1.1113281,0.62109 l 9.691406,0.0859 8.382813,0.0723 v 16.76367 16.75391 H -5.9667969 -40.771484 v -16.5 -17.39258 l 4.59375,-6.33594 z"
|
||||
style="shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;isolation:auto;mix-blend-mode:normal;vector-effect:none;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
65
icons/tabcounter.svg
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="128"
|
||||
height="128"
|
||||
viewBox="0 0 33.866667 33.866668"
|
||||
version="1.1"
|
||||
id="svg3684"
|
||||
inkscape:version="0.92.0 r15299"
|
||||
sodipodi:docname="tabcounter.svg">
|
||||
<defs
|
||||
id="defs3678" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="3.959798"
|
||||
inkscape:cx="21.305736"
|
||||
inkscape:cy="81.509772"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="847"
|
||||
inkscape:window-x="1016"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
units="px"
|
||||
inkscape:showpageshadow="false"
|
||||
borderlayer="true" />
|
||||
<metadata
|
||||
id="metadata3681">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-263.13333)">
|
||||
<path
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.64583349;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m -32.400391,269.41992 a 1.323049,1.323049 0 0 0 -1.072265,0.54688 l -4.845703,6.68359 -4.847657,6.68359 a 1.323049,1.323049 0 0 0 -0.251953,0.7754 v 17.82226 17.82227 a 1.323049,1.323049 0 0 0 1.324219,1.32226 H -5.9667969 30.162109 a 1.323049,1.323049 0 0 0 1.324219,-1.32226 v -18.07618 -18.07421 a 1.323049,1.323049 0 0 0 -1.3125,-1.32422 l -9.693359,-0.084 -8.966797,-0.0781 -3.5800782,-5.73047 -3.9667969,-6.34375 A 1.323049,1.323049 0 0 0 2.8457031,269.41992 H -14.777344 Z m 0.673829,2.64649 h 16.949218 16.8906252 l 3.5761719,5.72265 3.9648438,6.34571 a 1.323049,1.323049 0 0 0 1.1113281,0.62109 l 9.691406,0.0859 8.382813,0.0723 v 16.76367 16.75391 H -5.9667969 -40.771484 v -16.5 -17.39258 l 4.59375,-6.33594 z"
|
||||
id="rect9"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.7 KiB |
46
manifest.firefox.json
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "Tab Counter",
|
||||
"short_name": "Tab Counter",
|
||||
"author": "DaAwesomeP",
|
||||
"developer": {
|
||||
"name": "DaAwesomeP",
|
||||
"url": "https://addons.mozilla.org/en-US/firefox/user/DaAwesomeP/"
|
||||
},
|
||||
"version": "0.4.1",
|
||||
"description": "A button badge that shows the number of tabs open in a window",
|
||||
"homepage_url": "https://github.com/DaAwesomeP/tab-counter",
|
||||
"manifest_version": 2,
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "tab-counter@daawesomep.addons.mozilla.org",
|
||||
"strict_min_version": "52.0"
|
||||
}
|
||||
},
|
||||
"icons": {
|
||||
"1": "icons/tabcounter-logo.plain.min.svg"
|
||||
},
|
||||
"permissions": [
|
||||
"storage"
|
||||
],
|
||||
"browser_action": {
|
||||
"browser_style": true,
|
||||
"default_area": "tabstrip",
|
||||
"default_icon": "icons/tabcounter.plain.min.svg",
|
||||
"theme_icons": [{
|
||||
"dark": "icons/tabcounter-gray10.plain.min.svg",
|
||||
"light": "icons/tabcounter-gray90.plain.min.svg",
|
||||
"size": 1
|
||||
}],
|
||||
"default_popup": "dist/popup.html",
|
||||
"default_title": "Tab Counter"
|
||||
},
|
||||
"options_ui": {
|
||||
"page": "dist/options.html"
|
||||
},
|
||||
"background": {
|
||||
"scripts": [
|
||||
"dist/background.js"
|
||||
],
|
||||
"persistent": true
|
||||
}
|
||||
}
|
49
manifest.opera.json
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"name": "Tab Counter",
|
||||
"short_name": "Tab Counter",
|
||||
"author": "DaAwesomeP",
|
||||
"developer": {
|
||||
"name": "DaAwesomeP",
|
||||
"url": "https://daawesomep.github.io/"
|
||||
},
|
||||
"version": "0.4.1",
|
||||
"description": "A button badge that shows the number of tabs open in a window",
|
||||
"homepage_url": "https://github.com/DaAwesomeP/tab-counter",
|
||||
"manifest_version": 2,
|
||||
"icons": {
|
||||
"16": "icons/tabcounter-logo-16.png",
|
||||
"32": "icons/tabcounter-logo-32.png",
|
||||
"38": "icons/tabcounter-logo-38.png",
|
||||
"64": "icons/tabcounter-logo-64.png",
|
||||
"96": "icons/tabcounter-logo-96.png",
|
||||
"128": "icons/tabcounter-logo-128.png",
|
||||
"256": "icons/tabcounter-logo-256.png"
|
||||
},
|
||||
"permissions": [
|
||||
"storage"
|
||||
],
|
||||
"browser_action": {
|
||||
"browser_style": true,
|
||||
"default_icon": {
|
||||
"16": "icons/tabcounter-16.png",
|
||||
"32": "icons/tabcounter-32.png",
|
||||
"38": "icons/tabcounter-38.png",
|
||||
"64": "icons/tabcounter-64.png",
|
||||
"96": "icons/tabcounter-96.png",
|
||||
"128": "icons/tabcounter-128.png",
|
||||
"256": "icons/tabcounter-256.png"
|
||||
},
|
||||
"default_popup": "dist/popup.html",
|
||||
"default_title": "Tab Counter"
|
||||
},
|
||||
"options_ui": {
|
||||
"page": "dist/options.html"
|
||||
},
|
||||
"background": {
|
||||
"scripts": [
|
||||
"node_modules/webextension-polyfill/dist/browser-polyfill.js",
|
||||
"dist/background.js"
|
||||
],
|
||||
"persistent": true
|
||||
}
|
||||
}
|
7096
package-lock.json
generated
Normal file
44
package.json
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"underscore": "^1.9.1",
|
||||
"webextension-polyfill": "^0.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.1.2",
|
||||
"@babel/polyfill": "^7.0.0",
|
||||
"@babel/preset-env": "^7.1.0",
|
||||
"babelify": "^10.0.0",
|
||||
"del": "^3.0.0",
|
||||
"eslint": "^5.6.1",
|
||||
"eslint-config-standard": "^12.0.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-node": "^7.0.1",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-bro": "^1.0.3",
|
||||
"gulp-cli": "^2.0.1",
|
||||
"gulp-eslint": "^5.0.0",
|
||||
"gulp-line-ending-corrector": "^1.0.3",
|
||||
"gulp-rename": "1.4.*",
|
||||
"gulp-sourcemaps": "^2.6.4",
|
||||
"gulp-zip": "4.2.*"
|
||||
},
|
||||
"engines": {
|
||||
"node": "8.x"
|
||||
},
|
||||
"scripts": {
|
||||
"gulp": "node ./node_modules/gulp/bin/gulp.js",
|
||||
"build": "node ./node_modules/gulp/bin/gulp.js build",
|
||||
"dist": "node ./node_modules/gulp/bin/gulp.js dist",
|
||||
"check": "node ./node_modules/gulp/bin/gulp.js check",
|
||||
"clean": "node ./node_modules/gulp/bin/gulp.js clean",
|
||||
"pack": "node ./node_modules/gulp/bin/gulp.js pack",
|
||||
"watch": "node ./node_modules/gulp/bin/gulp.js watch"
|
||||
},
|
||||
"repository": {
|
||||
"url": "https://github.com/DaAwesomeP/tab-counter"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"private": true
|
||||
}
|
222
src/background.js
Normal file
|
@ -0,0 +1,222 @@
|
|||
/* src/background.js
|
||||
* Originally created 3/10/2017 by DaAwesomeP
|
||||
* This is the background task file of the extension
|
||||
* https://github.com/DaAwesomeP/tab-counter
|
||||
*
|
||||
* Copyright 2017-present DaAwesomeP
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { debounce } from 'underscore'
|
||||
|
||||
const updateIcon = async function updateIcon () {
|
||||
// Get settings
|
||||
let settings = await browser.storage.local.get()
|
||||
|
||||
// Get tab counter setting
|
||||
let counterPreference = settings.counter || 0
|
||||
|
||||
// Stop tab badge update if badge disabled
|
||||
if (counterPreference === 3) return
|
||||
|
||||
// Get current tab to update badge in
|
||||
let currentTab = (await browser.tabs.query({ currentWindow: true, active: true }))[0]
|
||||
|
||||
// Get tabs in current window, tabs in all windows, and the number of windows
|
||||
let currentWindow = (await browser.tabs.query({ currentWindow: true })).length.toString()
|
||||
let allTabs = (await browser.tabs.query({})).length.toString()
|
||||
let allWindows = (await browser.windows.getAll({ populate: false, windowTypes: ['normal'] })).length.toString()
|
||||
|
||||
if (typeof currentTab !== 'undefined') {
|
||||
let text
|
||||
if (counterPreference === 0) text = currentWindow // Badge shows current window
|
||||
else if (counterPreference === 1) text = allTabs // Badge shows total of all windows
|
||||
else if (counterPreference === 2) text = `${currentWindow}/${allTabs}` // Badge shows both (Firefox limits to about 4 characters based on width)
|
||||
else if (counterPreference === 4) text = allWindows // Badge shows total of all windows
|
||||
|
||||
// Update the badge
|
||||
browser.browserAction.setBadgeText({
|
||||
text: text,
|
||||
tabId: currentTab.id
|
||||
})
|
||||
|
||||
// Update the tooltip
|
||||
browser.browserAction.setTitle({
|
||||
title: `Tab Counter\nTabs in this window: ${currentWindow}\nTabs in all windows: ${allTabs}\nNumber of windows: ${allWindows}`,
|
||||
tabId: currentTab.id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent from firing too frequently or flooding at a window or restore
|
||||
const lazyUpdateIcon = debounce(updateIcon, 250)
|
||||
|
||||
// Prioritize active leading edge of every 1 second on tab switch (fluid update for new tabs)
|
||||
const lazyActivateUpdateIcon = debounce(updateIcon, 1000, { leading: true })
|
||||
|
||||
// Will be error if tab has been removed, so wait 150ms;
|
||||
// onActivated fires slightly before onRemoved,
|
||||
// but tab is gone during onActivated.
|
||||
// Must be a function to avoid event parameter errors
|
||||
const update = function update () { setTimeout(lazyUpdateIcon, 150) }
|
||||
|
||||
// Init badge for when addon starts and not yet loaded tabs
|
||||
browser.browserAction.setBadgeText({ text: 'wait' })
|
||||
browser.browserAction.setBadgeBackgroundColor({ color: '#000000' })
|
||||
|
||||
// Handler for when current tab changes
|
||||
const tabOnActivatedHandler = function tabOnActivatedHandler () {
|
||||
// Run normal update for most events
|
||||
update()
|
||||
|
||||
// Prioritize active (fluid update for new tabs)
|
||||
lazyActivateUpdateIcon()
|
||||
}
|
||||
|
||||
// Load and apply icon and badge color settings
|
||||
const checkSettings = async function checkSettings (settingsUpdate) {
|
||||
// Get settings object
|
||||
let settings = await browser.storage.local.get()
|
||||
// Get the browser name and version
|
||||
let browserInfo
|
||||
if (browser.runtime.hasOwnProperty('getBrowserInfo')) browserInfo = await browser.runtime.getBrowserInfo()
|
||||
else {
|
||||
browserInfo = { // polyfill doesn't seem to support this method, but we're only concerned with FF at the moment
|
||||
version: '0',
|
||||
vendor: '',
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
const browserVersionSplit = browserInfo.version.split('.').map((n) => parseInt(n))
|
||||
|
||||
// Set base defaults if new insall
|
||||
if (!settings.hasOwnProperty('version')) {
|
||||
settings = {
|
||||
version: '0.0.0',
|
||||
icon: 'tabcounter.plain.min.svg',
|
||||
counter: 0,
|
||||
badgeColor: '#999999'
|
||||
}
|
||||
}
|
||||
|
||||
// Perform settings upgrade
|
||||
if (settings.version !== browser.runtime.getManifest().version) {
|
||||
let versionSplit = settings.version.split('.').map((n) => parseInt(n))
|
||||
// Upgrade
|
||||
|
||||
// since v0.3.0, icons now adapt to theme so reset icon setting
|
||||
if (versionSplit[0] === 0 && versionSplit[1] < 3) settings.icon = 'tabcounter.plain.min.svg'
|
||||
|
||||
// disable the "both" counter option in version v0.3.0 due to the four-character badge limit (renders the feature uselss)
|
||||
if (versionSplit[0] === 0 && versionSplit[1] < 3) {
|
||||
if (settings.hasOwnProperty('counter')) {
|
||||
if (settings.counter === 2) settings.counter = 0
|
||||
}
|
||||
}
|
||||
|
||||
// add badgeTextColor support if at least v0.4.0 and FF 63
|
||||
if (versionSplit[0] === 0 && versionSplit[1] < 4 && browserInfo.vendor === 'Mozilla' && browserInfo.name === 'Firefox' && browserVersionSplit[0] >= 63) {
|
||||
settings.badgeTextColorAuto = true
|
||||
settings.badgeTextColor = '#000000'
|
||||
}
|
||||
}
|
||||
browser.storage.local.set(Object.assign(settings, {
|
||||
version: browser.runtime.getManifest().version
|
||||
}))
|
||||
|
||||
// Apply badge color or use default
|
||||
if (settings.hasOwnProperty('badgeColor')) browser.browserAction.setBadgeBackgroundColor({ color: settings.badgeColor })
|
||||
else browser.browserAction.setBadgeBackgroundColor({ color: '#000000' })
|
||||
|
||||
// Apply badge text color or use default if not set or not supported
|
||||
if (settings.hasOwnProperty('badgeTextColor')) {
|
||||
if (settings.badgeTextColorAuto !== true) browser.browserAction.setBadgeTextColor({ color: settings.badgeTextColor })
|
||||
else browser.browserAction.setBadgeTextColor({ color: null })
|
||||
}
|
||||
|
||||
// Apply icon selection or use default
|
||||
if (settings.hasOwnProperty('icon')) browser.browserAction.setIcon({ path: `icons/${settings.icon}` })
|
||||
else browser.browserAction.setIcon({ path: 'icons/tabcounter.plain.min.svg' })
|
||||
|
||||
// Get counter preference
|
||||
let counterPreference
|
||||
if (!settings.hasOwnProperty('counter')) counterPreference = 0
|
||||
else counterPreference = settings.counter
|
||||
|
||||
// Either add badge update events or don't if not set to
|
||||
if (counterPreference !== 3) {
|
||||
// Watch for tab and window events five seconds after browser startup
|
||||
setTimeout(() => {
|
||||
browser.tabs.onActivated.addListener(tabOnActivatedHandler)
|
||||
browser.tabs.onAttached.addListener(update)
|
||||
browser.tabs.onCreated.addListener(update)
|
||||
browser.tabs.onDetached.addListener(update)
|
||||
browser.tabs.onMoved.addListener(update)
|
||||
browser.tabs.onReplaced.addListener(update)
|
||||
browser.tabs.onRemoved.addListener(update)
|
||||
browser.tabs.onUpdated.addListener(update)
|
||||
browser.windows.onCreated.addListener(update)
|
||||
browser.windows.onRemoved.addListener(update)
|
||||
browser.windows.onFocusChanged.addListener(update)
|
||||
}, settingsUpdate ? 1 : 5000) // add listeners immeadietly if not browser startup
|
||||
} else {
|
||||
// remove the listeners that were added
|
||||
browser.tabs.onActivated.removeListener(tabOnActivatedHandler)
|
||||
browser.tabs.onAttached.removeListener(update)
|
||||
browser.tabs.onCreated.removeListener(update)
|
||||
browser.tabs.onDetached.removeListener(update)
|
||||
browser.tabs.onMoved.removeListener(update)
|
||||
browser.tabs.onReplaced.removeListener(update)
|
||||
browser.tabs.onRemoved.removeListener(update)
|
||||
browser.tabs.onUpdated.removeListener(update)
|
||||
browser.windows.onCreated.removeListener(update)
|
||||
browser.windows.onRemoved.removeListener(update)
|
||||
browser.windows.onFocusChanged.removeListener(update)
|
||||
|
||||
// hide the "wait" badge if set not to show a badge
|
||||
browser.browserAction.setBadgeText({ text: '' })
|
||||
browser.browserAction.setTitle({ title: 'Tab Counter' })
|
||||
|
||||
// check each tab that was overriden with a counter badge
|
||||
let allTabs = await browser.tabs.query({})
|
||||
allTabs.forEach((tab) => {
|
||||
browser.browserAction.setBadgeText({
|
||||
text: '',
|
||||
tabId: tab.id
|
||||
})
|
||||
browser.browserAction.setTitle({
|
||||
title: 'Tab Counter',
|
||||
tabId: tab.id
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Load settings and update badge at app start
|
||||
const applyAll = async function applyAll (settingsUpdate) {
|
||||
await checkSettings(settingsUpdate) // Icon and badge color
|
||||
await update() // Badge text options
|
||||
}
|
||||
applyAll()
|
||||
|
||||
// Listen for settings changes and update color, icon, and badge text instantly
|
||||
// Bug: this listener run nonstop
|
||||
// browser.storage.onChanged.addListener(applyAll)
|
||||
|
||||
// Listen for internal addon messages
|
||||
const messageHandler = async function messageHandler (request, sender, sendResponse) {
|
||||
// Check for a settings update
|
||||
if (request.hasOwnProperty('updateSettings')) if (request.updateSettings) applyAll(true)
|
||||
}
|
||||
browser.runtime.onMessage.addListener(messageHandler)
|
88
src/options.html
Normal file
|
@ -0,0 +1,88 @@
|
|||
<!--
|
||||
* src/options.html
|
||||
* Originally created 3/11/2017 by DaAwesomeP
|
||||
* This is the options page markup file
|
||||
* https://github.com/DaAwesomeP/tab-counter
|
||||
*
|
||||
* Copyright 2017-present DaAwesomeP
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Tab Counter Options</title>
|
||||
<style type="text/css">
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
tr {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
td {
|
||||
min-width: 400px !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form>
|
||||
<table>
|
||||
<tr style="display: none">
|
||||
<td>Badge Color</td>
|
||||
<td><input type="color" name="badgeColor" id="badgeColor" optionType="string" /></td>
|
||||
<td><em>Unfortuantely, the browser predetermines thefont size of the badge. Setting the badge text color is available in Firefox 63 and above.</em></td>
|
||||
</tr>
|
||||
<tr style="display: none">
|
||||
<td>Automatically set Badge Color</td>
|
||||
<td><input type="checkbox" name="badgeTextColorAuto" id="badgeTextColorAuto" optionType="boolean" /></td>
|
||||
<td><em>When checked, the text color is either white or black based on the highest constrast with the badge color. When unchecked, a manual color may be selected.</em></td>
|
||||
</tr>
|
||||
<tr style="display: none">
|
||||
<td>Badge Text Color (if not automatic)</td>
|
||||
<td><input type="color" name="badgeTextColor" id="badgeTextColor" optionType="string" /></td>
|
||||
<td><em>This option is ignored/disabled unless "Automatically set Badge Color" is unchecked.</em></td>
|
||||
</tr>
|
||||
<tr style="display: none">
|
||||
<td>Icon Color & Style</td>
|
||||
<td>
|
||||
<select name="icon" id="icon" optionType="string" >
|
||||
<option value="tabcounter.plain.min.svg">Tab Counter Default</option>
|
||||
<option value="tabcounter-gray90.plain.min.svg">Tab Counter Gray 90 (Firefox Photon Design System Light Background Icon Color)</option>
|
||||
<option value="tabcounter-gray10.plain.min.svg">Tab Counter Gray 10 (Firefox Photon Design System Dark Background Icon Color)</option>
|
||||
<option value="tabcounter-black.plain.min.svg">Tab Counter Black</option>
|
||||
<option value="tabcounter-white.plain.min.svg">Tab Counter White</option>
|
||||
<option value="clear.plain.min.svg">Clear SVG for Firefox (shows badge only)</option>
|
||||
<option value="clear-1.png">Clear 1px PNG for Opera (shows badge only)</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none">
|
||||
<td>Counter</td>
|
||||
<td>
|
||||
<select name="counter" id="counter" optionType="number">
|
||||
<option value="0">Number of Tabs in Current Window</option>
|
||||
<option value="1">Total Number of Tabs of All Windows</option>
|
||||
<option value="2">Both Number of Tabs in Current Window/Total Number of Tabs of All Windows</option>
|
||||
<option value="4">Total Number of Windows</option>
|
||||
<option value="3">None (disables the counter and hover text; click the icon to see the count)</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><em>A maximum of four characters can be displayed on the badge; this is a browser limitation.</em></td>
|
||||
</tr>
|
||||
<tr>
|
||||
</table>
|
||||
</form>
|
||||
<script type="text/javascript" src="options.js"></script>
|
||||
</body>
|
||||
</html>
|
83
src/options.js
Normal file
|
@ -0,0 +1,83 @@
|
|||
/* src/options.js
|
||||
* Originally created 3/11/2017 by DaAwesomeP
|
||||
* This is the options page script file
|
||||
* https://github.com/DaAwesomeP/tab-counter
|
||||
*
|
||||
* Copyright 2017-present DaAwesomeP
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var domReady = false
|
||||
var browserReady = false
|
||||
var restored = false
|
||||
|
||||
async function checkBadgeColorManualSetting () {
|
||||
let autoSelect = document.querySelector('#badgeTextColorAuto').checked
|
||||
document.querySelector('#badgeTextColor').disabled = autoSelect
|
||||
}
|
||||
|
||||
async function saveOptions () {
|
||||
checkBadgeColorManualSetting()
|
||||
let settings = await browser.storage.local.get()
|
||||
for (let setting in settings) {
|
||||
if (setting !== 'version') {
|
||||
let el = document.querySelector(`#${setting}`)
|
||||
if (el.getAttribute('type') === 'checkbox') settings[setting] = el.checked
|
||||
else settings[setting] = el.value
|
||||
let optionType = el.getAttribute('optionType')
|
||||
if (optionType === 'number' && typeof settings[setting] !== 'number') settings[setting] = parseInt(settings[setting])
|
||||
else if (optionType === 'string' && typeof settings[setting] !== 'string') settings[setting] = settings[setting].toString()
|
||||
else if (optionType === 'boolean' && typeof settings[setting] !== 'boolean') settings[setting] = (settings[setting].toLowerCase() === 'true')
|
||||
}
|
||||
}
|
||||
browser.storage.local.set(settings)
|
||||
await browser.runtime.sendMessage({ updateSettings: true })
|
||||
}
|
||||
|
||||
async function restoreOptions () {
|
||||
restored = true
|
||||
let settings = await browser.storage.local.get()
|
||||
for (let setting in settings) {
|
||||
if (setting !== 'version') {
|
||||
let el = document.querySelector(`#${setting}`)
|
||||
if (el.getAttribute('type') === 'checkbox') el.checked = settings[setting]
|
||||
else el.value = settings[setting]
|
||||
el.parentElement.parentElement.style.display = 'block'
|
||||
}
|
||||
}
|
||||
checkBadgeColorManualSetting()
|
||||
}
|
||||
|
||||
function start () {
|
||||
browserReady = true
|
||||
if (domReady && !restored) restoreOptions()
|
||||
for (let el of document.querySelectorAll('input, select')) {
|
||||
el.addEventListener('change', saveOptions)
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
domReady = true
|
||||
if (browserReady && !restored) restoreOptions()
|
||||
})
|
||||
|
||||
if (typeof browser === 'undefined') {
|
||||
var script = document.createElement('script')
|
||||
script.addEventListener('load', () => {
|
||||
start()
|
||||
})
|
||||
script.src = '../node_modules/webextension-polyfill/dist/browser-polyfill.js'
|
||||
script.async = false
|
||||
document.head.appendChild(script)
|
||||
} else start()
|
55
src/popup.html
Normal file
|
@ -0,0 +1,55 @@
|
|||
<!--
|
||||
* src/popup.html
|
||||
* Originally created 3/11/2017 by DaAwesomeP
|
||||
* This is the popup markup file
|
||||
* https://github.com/DaAwesomeP/tab-counter
|
||||
*
|
||||
* Copyright 2017-present DaAwesomeP
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
h3 {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Tab Counter</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>Tabs in this window:</strong></td>
|
||||
<td><span id="currentWindow"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Tabs in all windows:</strong></td>
|
||||
<td><span id="allTabs"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Number of windows:</strong></td>
|
||||
<td><span id="allWindows"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript" src="popup.js"></script>
|
||||
</body>
|
||||
</html>
|
38
src/popup.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
/* src/popup.js
|
||||
* Originally created 3/10/2017 by DaAwesomeP
|
||||
* This is the popup script file
|
||||
* https://github.com/DaAwesomeP/tab-counter
|
||||
*
|
||||
* Copyright 2017-present DaAwesomeP
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
async function start () {
|
||||
let currentWindow = (await browser.tabs.query({ currentWindow: true })).length
|
||||
let allTabs = (await browser.tabs.query({})).length
|
||||
let allWindows = (await browser.windows.getAll({ populate: false, windowTypes: ['normal'] })).length.toString()
|
||||
document.getElementById('currentWindow').textContent = currentWindow
|
||||
document.getElementById('allTabs').textContent = allTabs
|
||||
document.getElementById('allWindows').textContent = allWindows
|
||||
}
|
||||
|
||||
if (typeof browser === 'undefined') {
|
||||
var script = document.createElement('script')
|
||||
script.addEventListener('load', () => {
|
||||
start()
|
||||
})
|
||||
script.src = '../node_modules/webextension-polyfill/dist/browser-polyfill.js'
|
||||
script.async = false
|
||||
document.head.appendChild(script)
|
||||
} else start()
|