mirror of
https://github.com/XFox111/TabsAsideExtension.git
synced 2026-07-02 19:52:47 +03:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4559b25739 | |||
| d8c31e3da5 | |||
| 8d2c83eea6 | |||
| 3e60583427 | |||
| 10edf4f975 | |||
| cc854fbd25 | |||
| ad9acb6208 | |||
| f74eeb5759 |
@@ -0,0 +1,74 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
# Trigger deploy on manifest change
|
||||
- 'manifest.json'
|
||||
|
||||
jobs:
|
||||
Firefox:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build Extension for Firefox
|
||||
id: web-ext-build
|
||||
uses: kewisch/action-web-ext@v1
|
||||
with:
|
||||
cmd: build
|
||||
|
||||
- name: Sign build
|
||||
id: web-ext-sign
|
||||
uses: kewisch/action-web-ext@v1
|
||||
with:
|
||||
cmd: sign
|
||||
channel: listed
|
||||
source: ${{ steps.web-ext-build.outputs.target }}
|
||||
apiKey: ${{ secrets.FIREFOX_API_KEY }}
|
||||
apiSecret: ${{ secrets.FIREFOX_CLIENT_SECRET }}
|
||||
|
||||
- name: Publish to Firefox Webstore
|
||||
uses: trmcnvn/firefox-addon@v1
|
||||
with:
|
||||
uuid: tabsaside@xfox111.net
|
||||
xpi: ${{ steps.web-ext-sign.outputs.target }}
|
||||
manifest: ./manifest.json
|
||||
api-key: ${{ secrets.FIREFOX_API_KEY }}
|
||||
api-secret: ${{ secrets.FIREFOX_CLIENT_SECRET }}
|
||||
|
||||
- name: Drop artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: 'Firefox Artefacts'
|
||||
path: ${{ steps.web-ext-sign.outputs.target }}
|
||||
|
||||
Chrome:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Pack extension
|
||||
uses: TheDoctor0/zip-release@0.4.1
|
||||
with:
|
||||
filename: ./TabsAside.zip
|
||||
exclusions: '.git/* .vscode/* .github/* *.md'
|
||||
|
||||
- name: Publish to Chrome Webstore
|
||||
uses: SebastienGllmt/chrome-addon@v3
|
||||
with:
|
||||
extension: mgmjbodjgijnebfgohlnjkegdpbdjgin
|
||||
zip: ./TabsAside.zip
|
||||
client-id: ${{ secrets.CHROME_CLIENT_ID }}
|
||||
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
|
||||
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
|
||||
|
||||
- name: Drop artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: 'Chrome Artifacts'
|
||||
path: ./TabsAside.zip
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations":
|
||||
[
|
||||
{
|
||||
"name": "Debug",
|
||||
"type": "firefox",
|
||||
"request": "launch",
|
||||
"reAttach": true,
|
||||
"addonPath": "${workspaceFolder}"
|
||||
}
|
||||
]
|
||||
}
|
||||
+8
-8
@@ -4,7 +4,7 @@ Welcome, and thank you for your interest in contributing to my project!
|
||||
There are many ways in which you can contribute, beyond writing code. The goal of this document is to provide a high-level overview of how you can get involved.
|
||||
|
||||
## Table of Contents
|
||||
- [Contribution Guidelines](#gutschedule-contribution-guidelines)
|
||||
- [Contribution Guidelines](#contribution-guidelines)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Asking Questions](#asking-questions)
|
||||
- [Providing Feedback](#providing-feedback)
|
||||
@@ -35,15 +35,15 @@ Have a question? Rather than opening an issue, please ask me directly on opensou
|
||||
|
||||
## Providing Feedback
|
||||
Your comments and feedback are welcome.
|
||||
You can leave your feedbak on feedback@xfox111.net or do it on [Microsoft Edge Add-ons Webstore](https://microsoftedge.microsoft.com/addons/detail/tabs-aside/kmnblllmalkiapkfknnlpobmjjdnlhnd) or [Chrome Webstore](https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin)
|
||||
You can leave your feedbak on feedback@xfox111.net or do it on [Microsoft Edge Add-ons Webstore](https://microsoftedge.microsoft.com/addons/detail/tabs-aside/kmnblllmalkiapkfknnlpobmjjdnlhnd), [Chrome Extensions Webstore](https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin) or [Mozilla Add-ons Webstore](https://addons.mozilla.org/firefox/addon/ms-edge-tabs-aside/)
|
||||
|
||||
## Reporting Issues
|
||||
Have you identified a reproducible problem in the extension? Have a feature request? I'd like to hear it! Here's how you can make reporting your issue as effective as possible.
|
||||
|
||||
### Look For an Existing Issue
|
||||
Before you create a new issue, please do a search in [open issues](https://github.com/xfox111/ChromiumTabsAside/issues) to see if the issue or feature request has already been filed.
|
||||
Before you create a new issue, please do a search in [open issues](https://github.com/xfox111/TabsAsideExtension/issues) to see if the issue or feature request has already been filed.
|
||||
|
||||
Be sure to scan through the [feature requests](https://github.com/XFox111/ChromiumTabsAside/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement).
|
||||
Be sure to scan through the [feature requests](https://github.com/XFox111/TabsAsideExtension/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement).
|
||||
|
||||
If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment:
|
||||
|
||||
@@ -83,7 +83,7 @@ If you are interested in writing code to fix issues or implement new awesome fea
|
||||
### Deploy test version on your browser
|
||||
1. Clone repository to local storage using [Git](https://guides.github.com/introduction/git-handbook/)
|
||||
```
|
||||
git clone https://github.com/xfox111/ChromiumTabsAside.git
|
||||
git clone https://github.com/xfox111/TabsAsideExtension.git
|
||||
```
|
||||
2. Enable Developers mode on your browser extensions page
|
||||
3. Click "Load unpacked" button and navigate to the extension root folder (contains `manifest.json`)
|
||||
@@ -135,14 +135,14 @@ Use "double quotes" wherever it's possible
|
||||
}
|
||||
```
|
||||
- Put spaces between operators and before braces in methods declarations, conditionals and loops
|
||||
- Wrong:
|
||||
- Wrong:
|
||||
- `y=k*x+b`
|
||||
- `function FunctionName()`
|
||||
- Correct:
|
||||
- `y = k * x + b`
|
||||
- `function FunctionName ()`
|
||||
- Use ternary conditionals wherever it's possible
|
||||
- Wrong:
|
||||
- Wrong:
|
||||
```
|
||||
var s;
|
||||
if (condition)
|
||||
@@ -175,7 +175,7 @@ Use "double quotes" wherever it's possible
|
||||
```
|
||||
|
||||
### Finding an issue to work on
|
||||
Check out the [full issues list](https://github.com/XFox111/ChromiumTabsAside/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue) for a list of all potential areas for contributions. **Note** that just because an issue exists in the repository does not mean we will accept a contribution. There are several reasons we may not accept a pull request like:
|
||||
Check out the [full issues list](https://github.com/XFox111/TabsAsideExtension/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue) for a list of all potential areas for contributions. **Note** that just because an issue exists in the repository does not mean we will accept a contribution. There are several reasons we may not accept a pull request like:
|
||||
|
||||
- Performance - One of Tabs Aside core values is to deliver a lightweight extension, that means it should perform well in both real and test environments.
|
||||
- User experience - Since we want to deliver a lightweight extension, the UX should feel lightweight as well and not be cluttered. Most changes to the UI should go through the issue owner and project owner (@XFox111).
|
||||
|
||||
@@ -1,56 +1,64 @@
|
||||
# Tabs aside for Google Chrome
|
||||
# Tabs aside
|
||||
[](https://github.com/xfox111/TabsAsideExtension/releases/latest)
|
||||

|
||||
|
||||
[](https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin)
|
||||
[](https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin)
|
||||
[](https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin)
|
||||
[](https://github.com/xfox111/chromiumtabsaside/releases/latest)
|
||||
|
||||
[](https://github.com/xfox111/ChromiumTabsAside/issues)
|
||||
[](https://github.com/xfox111/ChromiumTabsAside/commits/master)
|
||||
[](https://github.com/xfox111/ChromiumTabsAside)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://addons.mozilla.org/firefox/addon/ms-edge-tabs-aside/)
|
||||
[](https://addons.mozilla.org/firefox/addon/ms-edge-tabs-aside/)
|
||||
[](https://addons.mozilla.org/firefox/addon/ms-edge-tabs-aside/)
|
||||
|
||||
[](https://github.com/xfox111/TabsAsideExtension/issues)
|
||||
[](https://github.com/xfox111/TabsAsideExtension/commits/master)
|
||||
[](https://github.com/xfox111/TabsAsideExtension)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
[](https://twitter.com/xfox111)
|
||||
[](https://github.com/xfox111)
|
||||
[](https://buymeacoffee.com/xfox111)
|
||||
|
||||

|
||||

|
||||
|
||||
If you’re like me, you often find yourself with a bunch of open tabs. You’d like to get those tabs out of the way sometimes, but they’re maybe not worth saving as actual bookmarks.
|
||||
|
||||
In the Edge browser, Microsoft has introduced a new feature called "Tabs aside" (or Tab groups) which lets you set tabs aside in a sort of temporary workspace so that you can call them back up later.
|
||||
|
||||
Unfortunately, in new Chromium-based Microsoft Edge, the devs decided not to implement this must-have-feature. So I've decided to create a browser extension which replicates this awesome feature in Chromium-based browsers
|
||||
Unfortunately, in new Chromium-based Microsoft Edge, the devs decided not to implement this must-have-feature. So I've decided to create a browser extension which replicates this awesome feature
|
||||
|
||||
## Features
|
||||
- Familiar UI inherited from legacy Microsoft Edge with some improvements
|
||||
- Auto Dark mode
|
||||
- Now you can restore one tab from collection without removing
|
||||
- Now you can choose if you want to load restored tabs only when you're navigating onto them
|
||||
- Set tabs you've selected aside
|
||||
- **Now available for Firefox!**
|
||||
|
||||
## Download
|
||||
- [Google Chrome Webstore](https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin)
|
||||
- [Microsoft Edge Add-ons Webstore](https://microsoftedge.microsoft.com/addons/detail/kmnblllmalkiapkfknnlpobmjjdnlhnd)
|
||||
- [GitHub Releases](https://github.com/xfox111/chromiumtabsaside/releases/latest)
|
||||
- [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/ms-edge-tabs-aside/)
|
||||
- [GitHub Releases](https://github.com/xfox111/TabsAsideExtension/releases/latest)
|
||||
|
||||
## Project roadmap
|
||||
You can go to the project's [roadmap kanban board](https://github.com/XFox111/ChromiumTabsAside/projects/1) and see what have we planned and watch our progress in realtime
|
||||
You can go to the project's [roadmap kanban board](https://github.com/XFox111/TabsAsideExtension/projects/1) and see what have we planned and watch our progress in realtime
|
||||
|
||||
## Contributing
|
||||
There are many ways in which you can participate in the project, for example:
|
||||
- [Submit bugs and feature requests](https://github.com/xfox111/gutschedule/issues), and help us verify as they are checked in
|
||||
- Review [source code changes](https://github.com/xfox111/gutschedule/pulls)
|
||||
- [Submit bugs and feature requests](https://github.com/xfox111/TabsAsideExtension/issues), and help us verify as they are checked in
|
||||
- Review [source code changes](https://github.com/xfox111/TabsAsideExtension/pulls)
|
||||
- Review documentation and make pull requests for anything from typos to new content
|
||||
|
||||
If you are interested in fixing issues and contributing directly to the code base, please see the [Contribution Guidelines](https://github.com/XFox111/ChromiumTabsAside/blob/master/CONTRIBUTING.md), which covers the following:
|
||||
- [How to deploy the extension on your browser](https://github.com/XFox111/ChromiumTabsAside/blob/master/CONTRIBUTING.md#deploy-test-version-on-your-browser)
|
||||
- [The development workflow](https://github.com/XFox111/ChromiumTabsAside/blob/master/CONTRIBUTING.md#development-workflow), including debugging and running tests
|
||||
- [Coding guidelines](https://github.com/XFox111/ChromiumTabsAside/blob/master/CONTRIBUTING.md#coding-guidelines)
|
||||
- [Submitting pull requests](https://github.com/XFox111/ChromiumTabsAside/blob/master/CONTRIBUTING.md#submitting-pull-requests)
|
||||
- [Finding an issue to work on](https://github.com/XFox111/ChromiumTabsAside/blob/master/CONTRIBUTING.md#finding-an-issue-to-work-on)
|
||||
- [Contributing to translations](https://github.com/XFox111/ChromiumTabsAside/blob/master/CONTRIBUTING.md#contributing-to-translations)
|
||||
If you are interested in fixing issues and contributing directly to the code base, please see the [Contribution Guidelines](https://github.com/XFox111/TabsAsideExtension/blob/master/CONTRIBUTING.md), which covers the following:
|
||||
- [How to deploy the extension on your browser](https://github.com/XFox111/TabsAsideExtension/blob/master/CONTRIBUTING.md#deploy-test-version-on-your-browser)
|
||||
- [The development workflow](https://github.com/XFox111/TabsAsideExtension/blob/master/CONTRIBUTING.md#development-workflow), including debugging and running tests
|
||||
- [Coding guidelines](https://github.com/XFox111/TabsAsideExtension/blob/master/CONTRIBUTING.md#coding-guidelines)
|
||||
- [Submitting pull requests](https://github.com/XFox111/TabsAsideExtension/blob/master/CONTRIBUTING.md#submitting-pull-requests)
|
||||
- [Finding an issue to work on](https://github.com/XFox111/TabsAsideExtension/blob/master/CONTRIBUTING.md#finding-an-issue-to-work-on)
|
||||
- [Contributing to translations](https://github.com/XFox111/TabsAsideExtension/blob/master/CONTRIBUTING.md#contributing-to-translations)
|
||||
|
||||
## Code of Conduct
|
||||
This project has adopted the Contributor Covenant. For more information see the [Code of Conduct](https://github.com/XFox111/ChromiumTabsAside/blob/master/CODE_OF_CONDUCT.md)
|
||||
This project has adopted the Contributor Covenant. For more information see the [Code of Conduct](https://github.com/XFox111/TabsAsideExtension/blob/master/CODE_OF_CONDUCT.md)
|
||||
|
||||
## Copyrights
|
||||
> ©2020 Michael "XFox" Gordeev
|
||||
|
||||
+45
-32
@@ -8,47 +8,60 @@
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/style.generic.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/style.dark.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/style.listview.css" />
|
||||
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="tabsAside background">
|
||||
<div class="tabsAside closeArea"></div>
|
||||
<aside class="tabsAside pane">
|
||||
<header>
|
||||
<div>
|
||||
<h1 loc="name">Tabs aside</h1>
|
||||
<button loc_alt="options" class="btn more" title="Options"></button>
|
||||
<h1 loc="name">Tabs aside</h1>
|
||||
<button loc_alt="options" class="btn more" title="Options"></button>
|
||||
|
||||
<nav>
|
||||
<p>
|
||||
<input type="checkbox" id="loadOnRestore"/>
|
||||
<label loc="loadOnRestore" for="loadOnRestore">Load tabs on restore</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" id="swapIconAction"/>
|
||||
<label loc="swapIconAction" for="swapIconAction">Set tabs aside on extension icon click (Alt+P or right-click to open the pane)</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" id="showDeleteDialog"/>
|
||||
<label loc="showDeleteDialog" for="showDeleteDialog">Show confirmation dialog before deleting an item</label>
|
||||
</p>
|
||||
<hr/>
|
||||
<div>
|
||||
<button loc="github" value="https://github.com/xfox111/ChromiumTabsAside">Visit GitHub page</button>
|
||||
<button loc="contributors" value="https://github.com/XFox111/ChromiumTabsAside/graphs/contributors">Project contributors</button>
|
||||
<button loc="feedback" feedback-button>Leave feedback</button>
|
||||
<button loc="buyMeACoffee" value="https://buymeacoffee.com/xfox111">Buy me a coffee!</button>
|
||||
</div>
|
||||
<hr/>
|
||||
<p>
|
||||
<small>v1.0</small><br />
|
||||
<span loc="credits">Developed by Michael Gordeev</span> (<a href="https://twitter.com/xfox111"
|
||||
target="_blank">@xfox111</a>)
|
||||
</p>
|
||||
</nav>
|
||||
<nav>
|
||||
<p>
|
||||
<input type="checkbox" id="loadOnRestore" />
|
||||
<label loc="loadOnRestore" for="loadOnRestore">Load tabs on restore</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" id="swapIconAction" />
|
||||
<label loc="swapIconAction" for="swapIconAction">Set tabs aside on extension icon click (Alt+P or right-click to open the pane)</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" id="showDeleteDialog" />
|
||||
<label loc="showDeleteDialog" for="showDeleteDialog">Show confirmation dialog before deleting an item</label>
|
||||
</p>
|
||||
<hr />
|
||||
<div>
|
||||
<button loc="github" value="https://github.com/xfox111/TabsAsideExtension">Visit GitHub page</button>
|
||||
<button loc="contributors" value="https://github.com/XFox111/TabsAsideExtension/graphs/contributors">Project contributors</button>
|
||||
<button loc="feedback" feedback-button>Leave feedback</button>
|
||||
<button loc="buyMeACoffee" value="https://buymeacoffee.com/xfox111">Buy me a coffee!</button>
|
||||
</div>
|
||||
<hr />
|
||||
<p>
|
||||
<small>v1.0</small><br />
|
||||
<span loc="credits">Developed by Michael Gordeev</span> (<a href="https://twitter.com/xfox111" target="_blank">@xfox111</a>)
|
||||
</p>
|
||||
</nav>
|
||||
|
||||
<button loc_alt="closePanel" class="btn remove" title="Close panel"></button>
|
||||
</div>
|
||||
<button loc_alt="closePanel" class="btn remove" title="Close panel"></button>
|
||||
<a class="saveTabs"><span class="iconArrowRight"></span> <span loc="setAside">Set current tabs aside</span></a>
|
||||
|
||||
<div class="listviewSwitch tile">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="listviewSwitch list">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"description":
|
||||
{
|
||||
"message": "Classic Microsoft Edge \"Tabs Aside\" feature for Chromium browsers",
|
||||
"message": "Classic Microsoft Edge \"Tabs Aside\" feature",
|
||||
"description": "Extension description"
|
||||
},
|
||||
"author":
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"name":
|
||||
{
|
||||
"message": "Pestañas que has reservado",
|
||||
"description": "Extension name. Displayed in the manifest and pane header"
|
||||
},
|
||||
"description":
|
||||
{
|
||||
"message": "Función \"Reservar pestañas\" de Microsoft Edge clásico",
|
||||
"description": "Extension description"
|
||||
},
|
||||
"author":
|
||||
{
|
||||
"message": "Michael \"XFox\" Gordeev",
|
||||
"description": "Author name"
|
||||
},
|
||||
"options":
|
||||
{
|
||||
"message": "Opciones",
|
||||
"description": "Alternative text for options button in the pane"
|
||||
},
|
||||
"closePanel":
|
||||
{
|
||||
"message": "Cerrar",
|
||||
"description": "Alternative text for close panel button"
|
||||
},
|
||||
"loadOnRestore":
|
||||
{
|
||||
"message": "Cargar pestañas al restaurar",
|
||||
"description": "Label for option"
|
||||
},
|
||||
"showDeleteDialog":
|
||||
{
|
||||
"message": "Mostrar diálogo de confirmacion antes de eliminar un item",
|
||||
"description": "Label for option"
|
||||
},
|
||||
"swapIconAction":
|
||||
{
|
||||
"message": "Reservar pestañas al apretar el icono de la extensión (%TOGGLE_SHORTCUT% o click-derecho para abrir el panel)",
|
||||
"description": "Label for option"
|
||||
},
|
||||
"github":
|
||||
{
|
||||
"message": "Visitar la pagina de GitHub",
|
||||
"description": "Link title"
|
||||
},
|
||||
"contributors":
|
||||
{
|
||||
"message": "Contribuidores del proyecto",
|
||||
"description": "Link title"
|
||||
},
|
||||
"feedback":
|
||||
{
|
||||
"message": "Deja un comentario",
|
||||
"description": "Link title"
|
||||
},
|
||||
"buyMeACoffee":
|
||||
{
|
||||
"message": "¡Comprame un cafe!",
|
||||
"description": "Link title"
|
||||
},
|
||||
"credits":
|
||||
{
|
||||
"message": "Desarrollado por Michael 'XFox' Gordeev",
|
||||
"description": "Options menu credits"
|
||||
},
|
||||
"setAside":
|
||||
{
|
||||
"message": "Reservar las pestañas actuales",
|
||||
"description": "Save collection action name. Used in the pane, extension context menu and manifest shortcuts"
|
||||
},
|
||||
"nothingSaved":
|
||||
{
|
||||
"message": "No tienes pestañas reservadas",
|
||||
"description": "Placeholder for empty pane"
|
||||
},
|
||||
"removeTab":
|
||||
{
|
||||
"message": "Eliminar pestañas de la colección",
|
||||
"description": "Button hint on a tab card"
|
||||
},
|
||||
"restoreTabs":
|
||||
{
|
||||
"message": "Restaurar pestañas",
|
||||
"description": "Collection restore action link name"
|
||||
},
|
||||
"more":
|
||||
{
|
||||
"message": "Más...",
|
||||
"description": "Collections' more button title"
|
||||
},
|
||||
"restoreNoRemove":
|
||||
{
|
||||
"message": "Restaurar sin eliminar",
|
||||
"description": "Context action item name"
|
||||
},
|
||||
"removeCollection":
|
||||
{
|
||||
"message": "Eliminar la colección",
|
||||
"description": "Collection remove action name"
|
||||
},
|
||||
"removeCollectionConfirm":
|
||||
{
|
||||
"message": "¿Está seguro que quiere eliminar esta colección?",
|
||||
"description": "Prompt dialog content on collection deletion"
|
||||
},
|
||||
"removeTabConfirm":
|
||||
{
|
||||
"message": "¿Está seguro que quiere eliminar esta pestaña?",
|
||||
"description": "Prompt dialog content on one tab deletion"
|
||||
},
|
||||
"togglePaneContext":
|
||||
{
|
||||
"message": "Abrir panel de pestañas",
|
||||
"description": "Context action name. Used in extension context menu and manifest shortcuts"
|
||||
},
|
||||
"noTabsToSave":
|
||||
{
|
||||
"message": "No hay pestañas disponibles para reservar",
|
||||
"description": "Alert dialog message when there's no tabs to save"
|
||||
},
|
||||
"tabs":
|
||||
{
|
||||
"message": "items",
|
||||
"description": "Collection tabs counter label (e.g. 8 items)"
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"description":
|
||||
{
|
||||
"message": "Функиця классического Microsoft Edge на браузерах Chromium",
|
||||
"message": "Функиця отложенных вкладок классического Microsoft Edge",
|
||||
"description": "Extension description"
|
||||
},
|
||||
"author":
|
||||
|
||||
+37
-18
@@ -10,6 +10,17 @@
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tabsAside.closeArea
|
||||
{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.tabsAside.pane
|
||||
{
|
||||
user-select: none;
|
||||
@@ -21,7 +32,7 @@
|
||||
overflow: hidden;
|
||||
display: grid;
|
||||
grid-template-rows: auto 1fr;
|
||||
|
||||
|
||||
width: 100%;
|
||||
min-width: 500px;
|
||||
|
||||
@@ -53,23 +64,20 @@
|
||||
padding: 14px 20px 16px 20px;
|
||||
box-shadow: 0px 0px 5px rgba(0,0,0,.5);
|
||||
background-color: white;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto auto;
|
||||
grid-column-gap: 10px;
|
||||
grid-row-gap: 30px;
|
||||
}
|
||||
.tabsAside.pane > header > div
|
||||
{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto auto;
|
||||
grid-column-gap: 10px;
|
||||
margin-bottom: 29px;
|
||||
}
|
||||
|
||||
.tabsAside.pane > header > div > h1
|
||||
.tabsAside.pane > header > h1
|
||||
{
|
||||
margin: 0px 5px;
|
||||
font-weight: 500;
|
||||
font-size: 15pt;
|
||||
}
|
||||
|
||||
.tabsAside.pane > header > div > nav
|
||||
|
||||
.tabsAside.pane > header > nav
|
||||
{
|
||||
top: 45px;
|
||||
right: 55px;
|
||||
@@ -92,6 +100,7 @@
|
||||
grid-column-gap: 15px;
|
||||
|
||||
font-weight: 600;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.iconArrowRight
|
||||
@@ -102,7 +111,8 @@
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px;
|
||||
background-position: center;
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/icons/arrowRight.svg");
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/icons/arrowRight.svg"),
|
||||
url("moz-extension://__MSG_@@extension_id__/icons/arrowRight.svg");
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
@@ -160,14 +170,21 @@
|
||||
color: gray;
|
||||
visibility: visible !important;
|
||||
}
|
||||
|
||||
.collectionSet > .header > h4
|
||||
|
||||
.collectionSet > .header > input
|
||||
{
|
||||
margin: 0px;
|
||||
visibility: visible !important;
|
||||
font-weight: 500;
|
||||
border: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
|
||||
.collectionSet > .header > input:hover
|
||||
{
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.collectionSet > .header > a
|
||||
{
|
||||
font-size: 11pt;
|
||||
@@ -195,7 +212,7 @@
|
||||
.collectionSet > .set:hover::-webkit-scrollbar-thumb
|
||||
{
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.collectionSet > .set > div
|
||||
{
|
||||
@@ -204,7 +221,8 @@
|
||||
margin: 5px;
|
||||
|
||||
background-color: #c2c2c2;
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/images/tab_thumbnail.png");
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/images/tab_thumbnail.png"),
|
||||
url("chrome-extension://__MSG_@@extension_id__/images/tab_thumbnail.png");
|
||||
background-size: cover;
|
||||
background-position-x: center;
|
||||
|
||||
@@ -248,7 +266,8 @@
|
||||
height: 20px;
|
||||
margin: 8px;
|
||||
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/images/tab_icon.png");
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/images/tab_icon.png"),
|
||||
url("moz-extension://__MSG_@@extension_id__/images/tab_icon.png");
|
||||
background-size: 20px;
|
||||
}
|
||||
|
||||
|
||||
+21
-3
@@ -4,7 +4,7 @@
|
||||
}
|
||||
|
||||
.tabsAside[darkmode] .pane
|
||||
{
|
||||
{
|
||||
background-color: #333333;
|
||||
color: white;
|
||||
}
|
||||
@@ -38,6 +38,22 @@
|
||||
background-color: dimgray;
|
||||
}
|
||||
|
||||
.tabsAside[darkmode] .collectionSet > .header > input
|
||||
{
|
||||
color: white;
|
||||
}
|
||||
|
||||
.tabsAside[darkmode] .collectionSet > .header > input:hover
|
||||
{
|
||||
border: 1px solid dimgray;
|
||||
}
|
||||
|
||||
.tabsAside[darkmode] .collectionSet > .header > input:focus
|
||||
{
|
||||
background: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tabsAside[darkmode] a
|
||||
{
|
||||
color: #48adff;
|
||||
@@ -70,7 +86,8 @@
|
||||
.tabsAside[darkmode] .pane .collectionSet > .set > div
|
||||
{
|
||||
background-color: #0c0c0c;
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/images/tab_thumbnail_dark.png");
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/images/tab_thumbnail_dark.png"),
|
||||
url("moz-extension://__MSG_@@extension_id__/images/tab_thumbnail_dark.png");
|
||||
border-color: #444;
|
||||
}
|
||||
|
||||
@@ -81,7 +98,8 @@
|
||||
|
||||
.tabsAside[darkmode] .pane .collectionSet > .set > div > div > div
|
||||
{
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/images/tab_icon_dark.png");
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/images/tab_icon_dark.png"),
|
||||
url("moz-extension://__MSG_@@extension_id__/images/tab_icon_dark.png");
|
||||
}
|
||||
|
||||
/* Context menu style */
|
||||
|
||||
+13
-7
@@ -27,7 +27,7 @@
|
||||
{
|
||||
color: #0078d7;
|
||||
}
|
||||
.tabsAside a:hover
|
||||
.tabsAside a:hover
|
||||
{
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
@@ -81,8 +81,8 @@
|
||||
background-color: lightgray;
|
||||
}
|
||||
|
||||
.tabsAside nav button
|
||||
{
|
||||
.tabsAside nav button
|
||||
{
|
||||
text-align: start;
|
||||
|
||||
padding: 0px 10px;
|
||||
@@ -98,7 +98,7 @@
|
||||
}
|
||||
|
||||
.tabsAside button + nav:active,
|
||||
.tabsAside button:focus + nav
|
||||
.tabsAside button:focus + nav
|
||||
{
|
||||
visibility: visible;
|
||||
}
|
||||
@@ -113,12 +113,14 @@
|
||||
|
||||
.btn.more
|
||||
{
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/icons/more.svg");
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/icons/more.svg"),
|
||||
url("moz-extension://__MSG_@@extension_id__/icons/more.svg");
|
||||
}
|
||||
|
||||
.btn.remove
|
||||
{
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/icons/cancel.svg");
|
||||
background-image: url("chrome-extension://__MSG_@@extension_id__/icons/cancel.svg"),
|
||||
url("moz-extension://__MSG_@@extension_id__/icons/cancel.svg");
|
||||
}
|
||||
|
||||
@font-face
|
||||
@@ -127,5 +129,9 @@
|
||||
src: local("Segoe UI"),
|
||||
url("chrome-extension://__MSG_@@extension_id__/fonts/WeblySleekUI/weblysleekuisemilight.ttf") format("truetype"),
|
||||
url("chrome-extension://__MSG_@@extension_id__/fonts/WeblySleekUI/weblysleekuisemilight.woff") format("woff"),
|
||||
url("chrome-extension://__MSG_@@extension_id__/fonts/WeblySleekUI/weblysleekuisemilight.woff2") format("woff2");
|
||||
url("chrome-extension://__MSG_@@extension_id__/fonts/WeblySleekUI/weblysleekuisemilight.woff2") format("woff2"),
|
||||
|
||||
url("moz-extension://__MSG_@@extension_id__/fonts/WeblySleekUI/weblysleekuisemilight.ttf") format("truetype"),
|
||||
url("moz-extension://__MSG_@@extension_id__/fonts/WeblySleekUI/weblysleekuisemilight.woff") format("woff"),
|
||||
url("moz-extension://__MSG_@@extension_id__/fonts/WeblySleekUI/weblysleekuisemilight.woff2") format("woff2");
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
.tabsAside[listview] .collectionSet > .header
|
||||
{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.tabsAside[listview] .collectionSet > .set
|
||||
{
|
||||
max-height: 250px;
|
||||
}
|
||||
|
||||
.tabsAside[listview] .collectionSet > .set > div
|
||||
{
|
||||
width: initial;
|
||||
height: initial;
|
||||
background-image: none !important;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.listviewSwitch
|
||||
{
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: grid;
|
||||
grid-row-gap: 2px;
|
||||
grid-column-gap: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.listviewSwitch.tile
|
||||
{
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
.listviewSwitch > div
|
||||
{
|
||||
border-radius: 1px;
|
||||
background-color: #c2c2c2;
|
||||
}
|
||||
|
||||
.listviewSwitch:hover > div
|
||||
{
|
||||
background-color: #a0a0aa;
|
||||
}
|
||||
|
||||
.tabsAside .listviewSwitch.tile > div
|
||||
{
|
||||
background-color: gray;
|
||||
}
|
||||
|
||||
.tabsAside[listview] .listviewSwitch.tile > div
|
||||
{
|
||||
background-color: #c2c2c2;
|
||||
}
|
||||
|
||||
.tabsAside[listview] .listviewSwitch.list > div
|
||||
{
|
||||
background-color: gray;
|
||||
}
|
||||
+88
-30
@@ -1,4 +1,4 @@
|
||||
if (window.location === window.parent.location && window.location.protocol != "chrome-extension:") // For open/close call
|
||||
if (window.location === window.parent.location && !window.location.protocol.includes("-extension:")) // For open/close call
|
||||
{
|
||||
var iframe = document.querySelector("iframe.tabsAsideIframe");
|
||||
if (!iframe)
|
||||
@@ -52,14 +52,14 @@ function Initialize()
|
||||
if (window.location !== window.parent.location)
|
||||
{
|
||||
pane.setAttribute("embedded", "");
|
||||
window.addEventListener('message', event =>
|
||||
window.addEventListener('message', event =>
|
||||
{
|
||||
if (event.data.target == "TabsAside")
|
||||
{
|
||||
pane.parentElement.style.opacity = 0;
|
||||
pane.removeAttribute("opened");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
UpdateLocale();
|
||||
@@ -74,14 +74,17 @@ function Initialize()
|
||||
document.querySelector(".tabsAside header .btn.remove").addEventListener("click", () =>
|
||||
chrome.runtime.sendMessage({ command: "togglePane" })
|
||||
);
|
||||
document.querySelector(".tabsAside.closeArea").addEventListener("click", () =>
|
||||
chrome.runtime.sendMessage({ command: "togglePane" })
|
||||
);
|
||||
|
||||
document.querySelector("nav > p > small").textContent = chrome.runtime.getManifest()["version"];
|
||||
|
||||
// Tabs dismiss option
|
||||
var loadOnRestoreCheckbox = document.querySelector("#loadOnRestore");
|
||||
chrome.storage.sync.get(
|
||||
{ "loadOnRestore": false },
|
||||
values => loadOnRestoreCheckbox.checked = values.loadOnRestore
|
||||
{ "loadOnRestore": true },
|
||||
values => loadOnRestoreCheckbox.checked = values?.loadOnRestore ?? true
|
||||
);
|
||||
chrome.storage.onChanged.addListener((changes, namespace) =>
|
||||
{
|
||||
@@ -101,7 +104,7 @@ function Initialize()
|
||||
var swapIconAction = document.querySelector("#swapIconAction");
|
||||
chrome.storage.sync.get(
|
||||
{ "setAsideOnClick": false },
|
||||
values => swapIconAction.checked = values.setAsideOnClick
|
||||
values => swapIconAction.checked = values?.setAsideOnClick ?? false
|
||||
);
|
||||
chrome.storage.onChanged.addListener((changes, namespace) =>
|
||||
{
|
||||
@@ -128,7 +131,7 @@ function Initialize()
|
||||
if (namespace == 'sync')
|
||||
for (key in changes)
|
||||
if (key === 'showDeleteDialog')
|
||||
showDeleteDialog.checked = changes[key].newValue
|
||||
showDeleteDialog.checked = changes[key].newValue
|
||||
});
|
||||
showDeleteDialog.addEventListener("click", () =>
|
||||
chrome.storage.sync.set(
|
||||
@@ -137,7 +140,43 @@ function Initialize()
|
||||
})
|
||||
);
|
||||
|
||||
document.querySelectorAll(".tabsAside.pane > header nav button").forEach(i =>
|
||||
// Collections view switch
|
||||
chrome.storage.sync.get(
|
||||
{ "listview": false },
|
||||
values =>
|
||||
{
|
||||
if (values?.listview)
|
||||
pane.setAttribute("listview", "");
|
||||
}
|
||||
);
|
||||
document.querySelectorAll(".listviewSwitch").forEach(i =>
|
||||
{
|
||||
i.onclick = (args) =>
|
||||
{
|
||||
if (args.currentTarget.classList[1] == "list")
|
||||
{
|
||||
pane.setAttribute("listview", "");
|
||||
chrome.storage.sync.set({ "listview": true });
|
||||
}
|
||||
else
|
||||
{
|
||||
pane.removeAttribute("listview");
|
||||
chrome.storage.sync.set({ "listview": false });
|
||||
}
|
||||
}
|
||||
});
|
||||
chrome.storage.onChanged.addListener((changes, namespace) =>
|
||||
{
|
||||
if (namespace == 'sync')
|
||||
for (key in changes)
|
||||
if (key === 'listview')
|
||||
if (changes[key].newValue)
|
||||
pane.setAttribute("listview", "");
|
||||
else
|
||||
pane.removeAttribute("listview");
|
||||
});
|
||||
|
||||
document.querySelectorAll(".tabsAside.pane > header nav button").forEach(i =>
|
||||
i.onclick = () =>
|
||||
{
|
||||
if (i.hasAttribute("feedback-button"))
|
||||
@@ -154,7 +193,7 @@ function Initialize()
|
||||
chrome.runtime.sendMessage({ command: "loadData" }, (collections) =>
|
||||
{
|
||||
if (document.querySelector(".tabsAside.pane section div") == null)
|
||||
collections.forEach(i =>
|
||||
collections.forEach(i =>
|
||||
AddCollection(i));
|
||||
});
|
||||
|
||||
@@ -165,9 +204,11 @@ function UpdateLocale()
|
||||
{
|
||||
document.querySelectorAll("*[loc]").forEach(i => i.textContent = chrome.i18n.getMessage(i.getAttribute("loc")));
|
||||
document.querySelectorAll("*[loc_alt]").forEach(i => i.title = chrome.i18n.getMessage(i.getAttribute("loc_alt")));
|
||||
|
||||
|
||||
var swapActionsLabel = document.querySelector("label[loc=swapIconAction]");
|
||||
chrome.commands.getAll((commands) => swapActionsLabel.textContent = swapActionsLabel.textContent.replace("%TOGGLE_SHORTCUT%", commands[2].shortcut));
|
||||
chrome.runtime.sendMessage({ command: "getShortcuts" }, (shortcuts) =>
|
||||
swapActionsLabel.textContent = swapActionsLabel.textContent.replace("%TOGGLE_SHORTCUT%", shortcuts.filter(i => i.name == "toggle-pane")[0].shortcut)
|
||||
);
|
||||
}
|
||||
|
||||
function AddCollection(collection)
|
||||
@@ -180,8 +221,8 @@ function AddCollection(collection)
|
||||
for (var i = 0; i < collection.links.length; i++)
|
||||
{
|
||||
rawTabs +=
|
||||
"<div title='" + collection.titles[i] + "'" + ((collection.thumbnails && collection.thumbnails[i]) ? " style='background-image: url(" + collection.thumbnails[i] + ")'" : "") + ">" +
|
||||
"<span class='openTab' value='" + collection.links[i] + "'></span>" +
|
||||
"<div title='" + collection.titles[i] + "'" + ((collection.thumbnails && collection.thumbnails[i]) ? " style='background-image: url(" + collection.thumbnails[i] + ")'" : "") + " value='" + collection.links[i] + "'>" +
|
||||
//"<span class='openTab' value='" + collection.links[i] + "'></span>" +
|
||||
"<div>" +
|
||||
"<div" + ((collection.icons[i] == 0 || collection.icons[i] == null) ? "" : " style='background-image: url(\"" + collection.icons[i] + "\")'") + "></div>" +
|
||||
"<span>" + collection.titles[i] + "</span>" +
|
||||
@@ -193,7 +234,7 @@ function AddCollection(collection)
|
||||
list.innerHTML +=
|
||||
"<div class='collectionSet'>" +
|
||||
"<div class='header'>" +
|
||||
"<h4>" + new Date(collection.timestamp).toDateString() + "</h4>" +
|
||||
"<input type='text' value='" + (collection.name ?? new Date(collection.timestamp).toDateString()) + "'/>" +
|
||||
"<a loc='restoreTabs' class='restoreCollection'>Restore tabs</a>" +
|
||||
"<div>" +
|
||||
"<button loc_alt='more' class='btn more' title='More...'></button>" +
|
||||
@@ -207,29 +248,36 @@ function AddCollection(collection)
|
||||
|
||||
"<div class='set' class='tabsList'>" + rawTabs + "</div>" +
|
||||
"</div>";
|
||||
|
||||
|
||||
UpdateLocale();
|
||||
|
||||
list.querySelectorAll(".restoreCollection").forEach(i =>
|
||||
list.querySelectorAll("input").forEach(i =>
|
||||
i.oninput = (event) => RenameCollection(i.parentElement.parentElement, event.target.value));
|
||||
|
||||
list.querySelectorAll(".restoreCollection").forEach(i =>
|
||||
i.onclick = () => RestoreTabs(i.parentElement.parentElement));
|
||||
|
||||
list.querySelectorAll(".restoreCollection.noDelete").forEach(i =>
|
||||
list.querySelectorAll(".restoreCollection.noDelete").forEach(i =>
|
||||
i.onclick = () => RestoreTabs(i.parentElement.parentElement.parentElement.parentElement, false));
|
||||
|
||||
list.querySelectorAll(".openTab").forEach(i =>
|
||||
i.onclick = () =>
|
||||
chrome.runtime.sendMessage(
|
||||
{
|
||||
command: "openTab",
|
||||
url: i.getAttribute("value")
|
||||
}
|
||||
));
|
||||
list.querySelectorAll(".set > div").forEach(i =>
|
||||
i.onclick = (args) =>
|
||||
{
|
||||
if (args.target.localName != "button")
|
||||
chrome.runtime.sendMessage(
|
||||
{
|
||||
command: "openTab",
|
||||
url: i.getAttribute("value")
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
document.querySelectorAll(".header .btn.remove").forEach(i =>
|
||||
i.onclick = () => RemoveTabs(i.parentElement.parentElement));
|
||||
|
||||
document.querySelectorAll(".set .btn.remove").forEach(i =>
|
||||
i.onclick = () => RemoveOneTab(i.parentElement.parentElement));
|
||||
i.onclick = (args) =>
|
||||
RemoveOneTab(i.parentElement.parentElement));
|
||||
}
|
||||
|
||||
function SetTabsAside()
|
||||
@@ -237,6 +285,16 @@ function SetTabsAside()
|
||||
chrome.runtime.sendMessage({ command: "saveTabs" });
|
||||
}
|
||||
|
||||
function RenameCollection(collectionData, name)
|
||||
{
|
||||
chrome.runtime.sendMessage(
|
||||
{
|
||||
command: "renameCollection",
|
||||
newName: name,
|
||||
collectionIndex: Array.prototype.slice.call(collectionData.parentElement.children).indexOf(collectionData) - 1
|
||||
});
|
||||
}
|
||||
|
||||
function RestoreTabs(collectionData, removeCollection = true)
|
||||
{
|
||||
chrome.runtime.sendMessage(
|
||||
@@ -255,7 +313,7 @@ function RestoreTabs(collectionData, removeCollection = true)
|
||||
|
||||
function RemoveTabs(collectionData)
|
||||
{
|
||||
chrome.storage.sync.get({ "showDeleteDialog": true }, values =>
|
||||
chrome.storage.sync.get({ "showDeleteDialog": true }, values =>
|
||||
{
|
||||
if (values.showDeleteDialog && !confirm(chrome.i18n.getMessage("removeCollectionConfirm")))
|
||||
return;
|
||||
@@ -272,7 +330,7 @@ function RemoveTabs(collectionData)
|
||||
|
||||
function RemoveOneTab(tabData)
|
||||
{
|
||||
chrome.storage.sync.get({ "showDeleteDialog": true }, values =>
|
||||
chrome.storage.sync.get({ "showDeleteDialog": true }, values =>
|
||||
{
|
||||
if (values.showDeleteDialog && !confirm(chrome.i18n.getMessage("removeTabConfirm")))
|
||||
return;
|
||||
@@ -285,7 +343,7 @@ function RemoveOneTab(tabData)
|
||||
},
|
||||
() =>
|
||||
{
|
||||
tabData.parentElement.previousElementSibling.children[0].textContent = chrome.i18n.getMessage("tabs") + ": " + (tabData.parentElement.children.length - 1);
|
||||
tabData.parentElement.previousElementSibling.querySelector("small").textContent = (tabData.parentElement.children.length - 1) + " " + chrome.i18n.getMessage("tabs");
|
||||
if (tabData.parentElement.children.length < 2)
|
||||
{
|
||||
RemoveElement(tabData.parentElement.parentElement);
|
||||
@@ -307,6 +365,6 @@ function RemoveElement(el)
|
||||
function RemoveCollectionElement(el)
|
||||
{
|
||||
if (el.parentElement.children.length < 3)
|
||||
setTimeout(() => document.querySelector(".tabsAside.pane > section > h2").removeAttribute("hidden"), 250);
|
||||
setTimeout(() => document.querySelector(".tabsAside.pane > section > h2").removeAttribute("hidden"), 250);
|
||||
RemoveElement(el);
|
||||
}
|
||||
+126
-83
@@ -1,7 +1,26 @@
|
||||
//This variable is populated when the browser action icon is clicked, or a command is called (with a shortcut for example).
|
||||
//We can't populate it later, as selected tabs get deselected on a click inside a tab.
|
||||
var tabsToSave = [];
|
||||
|
||||
|
||||
//Get the tabs to save, either all the window or the selected tabs only, and pass them through a callback.
|
||||
function GetTabsToSave(callback)
|
||||
{
|
||||
chrome.tabs.query({ currentWindow: true }, (windowTabs) =>
|
||||
{
|
||||
var highlightedTabs = windowTabs.filter(item => item.highlighted);
|
||||
//If there are more than one selected tab in the window, we set only those aside.
|
||||
// Otherwise, all the window's tabs get saved.
|
||||
return callback((highlightedTabs.length > 1 ? highlightedTabs : windowTabs));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function TogglePane(tab)
|
||||
{
|
||||
if (tab.url.startsWith("http")
|
||||
&& !tab.url.includes("chrome.google.com")
|
||||
&& !tab.url.includes("addons.mozilla.org")
|
||||
&& !tab.url.includes("microsoftedge.microsoft.com"))
|
||||
{
|
||||
chrome.tabs.executeScript(tab.id,
|
||||
@@ -21,14 +40,14 @@ function TogglePane(tab)
|
||||
active: true
|
||||
},
|
||||
(activeTab) =>
|
||||
chrome.tabs.onActivated.addListener(function TabsAsideCloser(activeInfo)
|
||||
chrome.tabs.onActivated.addListener(function TabsAsideCloser(activeInfo)
|
||||
{
|
||||
chrome.tabs.query({ url: chrome.extension.getURL("TabsAside.html") }, (result) =>
|
||||
{
|
||||
if (result.length)
|
||||
setTimeout(() =>
|
||||
{
|
||||
result.forEach(i =>
|
||||
result.forEach(i =>
|
||||
{
|
||||
if (activeInfo.tabId != i.id)
|
||||
chrome.tabs.remove(i.id);
|
||||
@@ -42,55 +61,71 @@ function TogglePane(tab)
|
||||
|
||||
function ProcessCommand(command)
|
||||
{
|
||||
switch(command)
|
||||
GetTabsToSave((returnedTabs) =>
|
||||
{
|
||||
case "set-aside":
|
||||
SaveCollection();
|
||||
break;
|
||||
case "toggle-pane":
|
||||
chrome.tabs.query(
|
||||
{
|
||||
active: true,
|
||||
currentWindow: true
|
||||
},
|
||||
(tabs) => TogglePane(tabs[0])
|
||||
)
|
||||
break;
|
||||
}
|
||||
tabsToSave = returnedTabs;
|
||||
switch(command)
|
||||
{
|
||||
case "set-aside":
|
||||
SaveCollection();
|
||||
break;
|
||||
case "toggle-pane":
|
||||
chrome.tabs.query(
|
||||
{
|
||||
active: true,
|
||||
currentWindow: true
|
||||
},
|
||||
(tabs) => TogglePane(tabs[0])
|
||||
)
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chrome.browserAction.onClicked.addListener((tab) =>
|
||||
{
|
||||
chrome.storage.sync.get({ "setAsideOnClick": false }, values =>
|
||||
GetTabsToSave((returnedTabs) =>
|
||||
{
|
||||
if (values.setAsideOnClick)
|
||||
SaveCollection();
|
||||
else
|
||||
TogglePane(tab);
|
||||
tabsToSave = returnedTabs;
|
||||
|
||||
chrome.storage.sync.get({ "setAsideOnClick": false }, values =>
|
||||
{
|
||||
if (values?.setAsideOnClick)
|
||||
SaveCollection();
|
||||
else
|
||||
TogglePane(tab);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Adding context menu options
|
||||
chrome.contextMenus.create(
|
||||
{
|
||||
id: "toggle-pane",
|
||||
contexts: ['all'],
|
||||
title: chrome.i18n.getMessage("togglePaneContext")
|
||||
}
|
||||
);
|
||||
chrome.contextMenus.create(
|
||||
{
|
||||
id: "set-aside",
|
||||
contexts: ['all'],
|
||||
title: chrome.i18n.getMessage("setAside")
|
||||
}
|
||||
);
|
||||
|
||||
var collections = JSON.parse(localStorage.getItem("sets")) || [];
|
||||
var shortcuts;
|
||||
chrome.commands.getAll((commands) => shortcuts = commands);
|
||||
|
||||
chrome.commands.onCommand.addListener(ProcessCommand);
|
||||
chrome.contextMenus.onClicked.addListener((info) => ProcessCommand(info.menuItemId));
|
||||
|
||||
chrome.runtime.onInstalled.addListener((reason) =>
|
||||
{
|
||||
//chrome.tabs.create({ url: "https://github.com/XFox111/TabsAsideExtension/releases/latest" });
|
||||
// Adding context menu options
|
||||
chrome.contextMenus.create(
|
||||
{
|
||||
id: "toggle-pane",
|
||||
contexts: ["browser_action"],
|
||||
title: chrome.i18n.getMessage("togglePaneContext")
|
||||
}
|
||||
);
|
||||
chrome.contextMenus.create(
|
||||
{
|
||||
id: "set-aside",
|
||||
contexts: ["browser_action"],
|
||||
title: chrome.i18n.getMessage("setAside")
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
//We receive a message from the pane aside-script, which means the tabsToSave are already assigned on message reception.
|
||||
chrome.runtime.onMessage.addListener((message, sender, sendResponse) =>
|
||||
{
|
||||
switch (message.command)
|
||||
@@ -116,6 +151,10 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) =>
|
||||
RemoveTab(message.collectionIndex, message.tabIndex);
|
||||
sendResponse();
|
||||
break;
|
||||
case "renameCollection":
|
||||
collections[message.collectionIndex].name = message.newName;
|
||||
localStorage.setItem("sets", JSON.stringify(collections));
|
||||
break;
|
||||
case "togglePane":
|
||||
chrome.tabs.query(
|
||||
{
|
||||
@@ -125,12 +164,21 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) =>
|
||||
(tabs) => TogglePane(tabs[0])
|
||||
)
|
||||
break;
|
||||
case "getShortcuts":
|
||||
sendResponse(shortcuts);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
// This function updates the extension's toolbar icon
|
||||
function UpdateTheme()
|
||||
{
|
||||
// Updating badge counter
|
||||
chrome.browserAction.setBadgeText({ text: collections.length < 1 ? "" : collections.length.toString() });
|
||||
|
||||
if (chrome.theme) // Firefox sets theme automatically
|
||||
return;
|
||||
|
||||
var theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
||||
var iconStatus = collections.length ? "full" : "empty";
|
||||
|
||||
@@ -146,12 +194,6 @@ function UpdateTheme()
|
||||
"16": basePath + "16.png"
|
||||
}
|
||||
});
|
||||
|
||||
// Updating badge counter
|
||||
if (collections.length < 1)
|
||||
chrome.browserAction.setBadgeText({ });
|
||||
else
|
||||
chrome.browserAction.setBadgeText({ text: collections.length.toString() });
|
||||
}
|
||||
|
||||
UpdateTheme();
|
||||
@@ -162,48 +204,45 @@ chrome.tabs.onActivated.addListener(UpdateTheme);
|
||||
// Set current tabs aside
|
||||
function SaveCollection()
|
||||
{
|
||||
chrome.tabs.query({ currentWindow: true }, (rawTabs) =>
|
||||
var tabs = tabsToSave.filter(i => i.url != chrome.runtime.getURL("TabsAside.html") && !i.pinned && !i.url.includes("//newtab") && !i.url.includes("about:blank") && !i.url.includes("about:home"));
|
||||
|
||||
if (tabs.length < 1)
|
||||
{
|
||||
var tabs = rawTabs.filter(i => i.url != chrome.runtime.getURL("TabsAside.html") && !i.pinned && !i.url.includes("//newtab"));
|
||||
alert(chrome.i18n.getMessage("noTabsToSave"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (tabs.length < 1)
|
||||
{
|
||||
alert(chrome.i18n.getMessage("noTabsToSave"));
|
||||
return;
|
||||
}
|
||||
var collection =
|
||||
{
|
||||
timestamp: Date.now(),
|
||||
tabsCount: tabs.length,
|
||||
titles: tabs.map(tab => tab.title ?? ""),
|
||||
links: tabs.map(tab => tab.url ?? ""),
|
||||
icons: tabs.map(tab => tab.favIconUrl ?? ""),
|
||||
thumbnails: tabs.map(tab => thumbnails.find(i => i.tabId == tab.id)?.url ?? "")
|
||||
};
|
||||
|
||||
var collection =
|
||||
{
|
||||
timestamp: Date.now(),
|
||||
tabsCount: tabs.length,
|
||||
titles: tabs.map(tab => tab.title ?? ""),
|
||||
links: tabs.map(tab => tab.url ?? ""),
|
||||
icons: tabs.map(tab => tab.favIconUrl ?? ""),
|
||||
thumbnails: tabs.map(tab => thumbnails.find(i => i.tabId == tab.id)?.url ?? "")
|
||||
};
|
||||
var rawData;
|
||||
if (localStorage.getItem("sets") === null)
|
||||
rawData = [collection];
|
||||
else
|
||||
{
|
||||
rawData = JSON.parse(localStorage.getItem("sets"));
|
||||
rawData.unshift(collection);
|
||||
}
|
||||
|
||||
var rawData;
|
||||
if (localStorage.getItem("sets") === null)
|
||||
rawData = [collection];
|
||||
else
|
||||
{
|
||||
rawData = JSON.parse(localStorage.getItem("sets"));
|
||||
rawData.unshift(collection);
|
||||
}
|
||||
localStorage.setItem("sets", JSON.stringify(rawData));
|
||||
|
||||
localStorage.setItem("sets", JSON.stringify(rawData));
|
||||
collections = JSON.parse(localStorage.getItem("sets"));
|
||||
|
||||
collections = JSON.parse(localStorage.getItem("sets"));
|
||||
|
||||
var newTabId;
|
||||
chrome.tabs.create({}, (tab) =>
|
||||
{
|
||||
newTabId = tab.id;
|
||||
chrome.tabs.remove(rawTabs.filter(i => !i.pinned && i.id != newTabId).map(tab => tab.id));
|
||||
});
|
||||
|
||||
UpdateTheme();
|
||||
var newTabId;
|
||||
chrome.tabs.create({}, (tab) =>
|
||||
{
|
||||
newTabId = tab.id;
|
||||
chrome.tabs.remove(tabsToSave.filter(i => !i.pinned && i.id != newTabId).map(tab => tab.id));
|
||||
});
|
||||
|
||||
UpdateTheme();
|
||||
}
|
||||
|
||||
function DeleteCollection(collectionIndex)
|
||||
@@ -216,7 +255,7 @@ function DeleteCollection(collectionIndex)
|
||||
|
||||
function RestoreCollection(collectionIndex, removeCollection)
|
||||
{
|
||||
collections[collectionIndex].links.forEach(i =>
|
||||
collections[collectionIndex].links.forEach(i =>
|
||||
{
|
||||
chrome.tabs.create(
|
||||
{
|
||||
@@ -225,10 +264,10 @@ function RestoreCollection(collectionIndex, removeCollection)
|
||||
},
|
||||
(createdTab) =>
|
||||
{
|
||||
chrome.storage.sync.get({ "loadOnRestore" : false }, values =>
|
||||
chrome.storage.sync.get({ "loadOnRestore" : true }, values =>
|
||||
{
|
||||
if (!values.loadOnRestore)
|
||||
chrome.tabs.onUpdated.addListener(function DiscardTab(updatedTabId, changeInfo, updatedTab)
|
||||
if (!(values?.loadOnRestore))
|
||||
chrome.tabs.onUpdated.addListener(function DiscardTab(updatedTabId, changeInfo, updatedTab)
|
||||
{
|
||||
if (updatedTabId === createdTab.id) {
|
||||
chrome.tabs.onUpdated.removeListener(DiscardTab);
|
||||
@@ -241,6 +280,10 @@ function RestoreCollection(collectionIndex, removeCollection)
|
||||
});
|
||||
});
|
||||
|
||||
//We added new tabs by restoring a collection, so we refresh the array of tabs ready to be saved.
|
||||
GetTabsToSave((returnedTabs) =>
|
||||
tabsToSave = returnedTabs)
|
||||
|
||||
if (!removeCollection)
|
||||
return;
|
||||
|
||||
@@ -324,4 +367,4 @@ chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) =>
|
||||
{
|
||||
if (changeInfo.status === "complete")
|
||||
AppendThumbnail(tabId, tab)
|
||||
});
|
||||
});
|
||||
|
||||
+39
-5
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "__MSG_name__",
|
||||
"version": "1.7",
|
||||
"version": "1.9.1",
|
||||
"manifest_version": 2,
|
||||
"description": "__MSG_description__",
|
||||
"author": "__MSG_author__",
|
||||
"default_locale": "en",
|
||||
|
||||
"permissions":
|
||||
"permissions":
|
||||
[
|
||||
"tabs",
|
||||
"unlimitedStorage",
|
||||
@@ -14,15 +14,41 @@
|
||||
"<all_urls>",
|
||||
"contextMenus"
|
||||
],
|
||||
|
||||
"icons":
|
||||
|
||||
"icons":
|
||||
{
|
||||
"128": "icons/light/empty/128.png",
|
||||
"48": "icons/light/empty/48.png",
|
||||
"32": "icons/light/empty/32.png",
|
||||
"16": "icons/light/empty/16.png"
|
||||
},
|
||||
"browser_action": { "default_icon": "icons/light/empty/32.png" },
|
||||
"browser_action":
|
||||
{
|
||||
"default_icon": "icons/light/empty/32.png",
|
||||
"theme_icons":
|
||||
[
|
||||
{
|
||||
"size": 128,
|
||||
"dark": "icons/light/full/128.png",
|
||||
"light": "icons/dark/full/128.png"
|
||||
},
|
||||
{
|
||||
"size": 48,
|
||||
"dark": "icons/light/full/48.png",
|
||||
"light": "icons/dark/full/48.png"
|
||||
},
|
||||
{
|
||||
"size": 32,
|
||||
"dark": "icons/light/full/32.png",
|
||||
"light": "icons/dark/full/32.png"
|
||||
},
|
||||
{
|
||||
"size": 16,
|
||||
"dark": "icons/light/full/16.png",
|
||||
"light": "icons/dark/full/16.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"web_accessible_resources": [ "*" ],
|
||||
|
||||
"background":
|
||||
@@ -51,5 +77,13 @@
|
||||
"mac": "Command+Shift+P"
|
||||
}
|
||||
}
|
||||
},
|
||||
"browser_specific_settings":
|
||||
{
|
||||
"gecko":
|
||||
{
|
||||
"id": "tabsaside@xfox111.net",
|
||||
"strict_min_version": "58.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user