Skip to content

Commit

Permalink
storage sync
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperZombi committed Aug 27, 2024
1 parent 454869d commit ce716dd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


<p align="right">
<img align="left" src="https://shields.io/badge/версия-v5.0.0-blue">
<img align="left" src="https://shields.io/badge/версия-v5.1.0-blue">
<a href="#донат"><img src="https://shields.io/badge/💲-Поддержать-2ea043"></a>
</p>

Expand All @@ -16,11 +16,15 @@

### <img src="https://www.stevenskelton.ca/flag-icon/png/36/country-4x3/ua.png" height="16px"> У зв'язку з блокуванням Hdrezka в Україні, рекомендується використовувати VPN⚠️

### ❗️ТЕПЕР ПРАЦЮЄ І НА ЗЕРКАЛАХ
### ❗️ТЕПЕР ПРАЦЮЄ НА ЗЕРКАЛАХ

## Установка:

### [Магазин Chrome](https://chrome.google.com/webstore/detail/hdrezka-helper/dccbdaopjpaemaleakdlahglfbhkdldj)
### [Магазин Firefox](https://addons.mozilla.org/firefox/addon/hdrezka-helper/)

<hr>

### Chrome:
1. Скачайте последний **[Релиз](https://github.com/SuperZombi/HDrezka-downloader/releases)**.
2. Извлеките папку ```src``` в место для установки.
Expand Down
2 changes: 1 addition & 1 deletion chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 3,
"version": "5.0.1",
"version": "5.1.0",
"name": "HDrezka Helper",
"description": "__MSG_extDesc__",
"default_locale": "en",
Expand Down
2 changes: 1 addition & 1 deletion firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 3,
"version": "5.0.1",
"version": "5.1.0",
"name": "HDrezka Helper",
"description": "__MSG_extDesc__",
"default_locale": "en",
Expand Down
4 changes: 2 additions & 2 deletions src/background.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var urlList;
var browser = chrome || browser;

browser.storage.local.get("urlList").then((data) => {
browser.storage.sync.get("urlList").then((data) => {
urlList = data.urlList || ["https://hdrezka.ag", "https://hdrezka.cm", "https://hdrezka.ag", "https://hdrezka.me", "https://hdrezka.co"];

browser.storage.onChanged.addListener((changes) => {
Expand Down Expand Up @@ -35,7 +35,7 @@ browser.storage.local.get("urlList").then((data) => {


function executeScript(tabId){
browser.storage.local.get({ download: true,
browser.storage.sync.get({ download: true,
downloader_2: false,
filename_structure: "",
hideVK: true,
Expand Down
4 changes: 2 additions & 2 deletions src/menu/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function dinamic_input(init_value){
}
}

browser.storage.local.get({ download: true,
browser.storage.sync.get({ download: true,
downloader_2: false,
filename_structure: "",
subtitles: true,
Expand Down Expand Up @@ -280,7 +280,7 @@ browser.storage.local.get({ download: true,
})
settings['filename_structure'] = document.querySelector("#filename_structure").getAttribute("value")

browser.storage.local.set(settings, _ => {
browser.storage.sync.set(settings, _ => {
// Reload extension to make opt-out change immediate.
browser.runtime.reload();
window.close();
Expand Down
6 changes: 3 additions & 3 deletions src/menu/popup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var browser = chrome || browser;
var urlList;
browser.storage.local.get("urlList", (data) => {
browser.storage.sync.get("urlList", (data) => {
urlList = data.urlList || ["https://hdrezka.ag", "https://hdrezka.cm", "https://hdrezka.ag", "https://hdrezka.me", "https://hdrezka.co"];

urlList.forEach(url=>{
Expand Down Expand Up @@ -58,7 +58,7 @@ function setCurrentWebsite(url, icon){
function addNewUrl(url){
if (!urlList.includes(url)){
urlList.push(url)
browser.storage.local.set({ urlList: urlList });
browser.storage.sync.set({ urlList: urlList });
addWebsite(url)
}
}
Expand All @@ -67,7 +67,7 @@ function removeUrl(url){
if (index > -1) {
urlList.splice(index, 1);
}
browser.storage.local.set({ urlList: urlList });
browser.storage.sync.set({ urlList: urlList });
removeWebsite(url)
}

Expand Down

0 comments on commit ce716dd

Please sign in to comment.