Skip to content

Commit

Permalink
update: make window resizable
Browse files Browse the repository at this point in the history
  • Loading branch information
maemaemae3 committed Mar 16, 2021
1 parent adb0ecf commit c7fd030
Show file tree
Hide file tree
Showing 7 changed files with 290 additions and 47 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lazy-translator",
"version": "1.4.0",
"version": "1.5.0",
"description": "extension that translates and lookup imported dictionary",
"author": "tempe",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $ npm install
```

## 開発中
ブラウザから `dist` ディレクトリを行うことで、ホットリロードしながら開発が行なえます
ブラウザから `dist` ディレクトリを読み込むことで、ホットリロードしながら開発することが出来ます
```shell
$ npm run serve
```
Expand Down
126 changes: 126 additions & 0 deletions src/assets/resize.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
browser.runtime.onInstalled.addListener(() => {
chrome.storage.local.set({ isExtensionOn: 1 });
chrome.storage.local.set({ LazyTranslator_isExtensionOn: 1 });
});

function sendMsg2AllTab(message) {
Expand All @@ -12,8 +12,8 @@ function sendMsg2AllTab(message) {

function getCurrentMode() {
return new Promise((resolve) => {
chrome.storage.local.get('isExtensionOn', (res) => {
resolve(res.isExtensionOn);
chrome.storage.local.get('LazyTranslator_isExtensionOn', (res) => {
resolve(res.LazyTranslator_isExtensionOn);
});
});
}
Expand All @@ -22,11 +22,11 @@ async function toggleMode() {
const currentMode = await getCurrentMode();
if (currentMode === 1) {
chrome.browserAction.setIcon({ path: './icons/icon_48_gray.png' });
chrome.storage.local.set({ isExtensionOn: 0 });
chrome.storage.local.set({ LazyTranslator_isExtensionOn: 0 });
sendMsg2AllTab({ func: 'toggleMode', data: { isEnabled: false } }); // disable content script
} else {
chrome.browserAction.setIcon({ path: './icons/icon_48.png' });
chrome.storage.local.set({ isExtensionOn: 1 });
chrome.storage.local.set({ LazyTranslator_isExtensionOn: 1 });
sendMsg2AllTab({ func: 'toggleMode', data: { isEnabled: true } }); // enable content script
}
}
Expand Down
Loading

0 comments on commit c7fd030

Please sign in to comment.