Skip to content

Commit be5f61c

Browse files
committed
feat: only reload when change the config of menu, popup, clear
1 parent 3b4e677 commit be5f61c

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
"manifest_version": 3,
1414
"name": "Textarea Cache BETA",
15-
"version": "5.0.1",
15+
"version": "5.0.2",
1616

1717
"default_locale": "en",
1818
"description": "THIS EXTENSION IS FOR BETA TESTING\n Allows to save automatically the content in a text input field.",
@@ -22,7 +22,7 @@
2222
"48": "icons/icon.png"
2323
},
2424

25-
"permissions": ["storage", "clipboardWrite", "menus", "alarms", "tabs", "activeTab"],
25+
"permissions": ["storage", "clipboardWrite", "menus", "tabs", "activeTab"],
2626

2727
"action": {
2828
"default_title": "View your saved data (Textarea Cache)",

ta_bg.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ ta_bg.listenMessageFromContentScript = () => {
2929
break;
3030
case 'set_options':
3131
ta_database.setOptions(request).then( () => {
32-
if (request.key == 'popupType') ta_bg.setupCacheList()
32+
const r = request
33+
if (r.key == 'popupType') ta_bg.setupCacheList()
3334
sendBack({ msg: 'done'});
3435
// attach listener according to new config
36+
const rl = 'popupType showContextMenu shouldAutoClear'
37+
if (rl.split(' ').indexOf(r.key) == -1) return
3538
setTimeout(() => browser.runtime.reload(), 300)
3639
});
3740
break;

view/lite/lite.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ var panel = {
4949
},
5050

5151
showPreview: (isWYSIWYG, val) => {
52-
// val is used to show preview of WYSIWYG,
53-
// so it should not be escaped.
54-
//
55-
// for security issues, I will remove all <script> & </script> tag
5652
var me = panel;
5753

5854
if (isWYSIWYG) {

0 commit comments

Comments
 (0)