Skip to content

Commit 703b129

Browse files
committed
Fix
1 parent 9dbd1a5 commit 703b129

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

js/popup.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
1818
customCSS.replace(/(\r\n|\n|\r)/gm, '') +
1919
"'; document.head.appendChild(style);",
2020
});
21-
document.getElementById('custom-css').value = customCSS;
2221
editor.getDoc().setValue(css_beautify(customCSS));
2322
}
2423
});
@@ -59,13 +58,12 @@ chrome.tabs.onCreated.addListener(function (tab) {
5958
});
6059

6160
// Insert custom CSS into textarea
62-
document.getElementById('custom-css').value = customCSS;
6361
editor.getDoc().setValue(css_beautify(customCSS));
6462

6563
// Save button click event
6664
document.getElementById('save-button').addEventListener('click', function () {
6765
// Get the custom CSS from the textarea
68-
customCSS = document.getElementById('custom-css').value;
66+
customCSS = editor.getDoc().getValue();
6967
// Save the custom CSS to storage using the current tab URL as the key
7068
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
7169
let data = {};
@@ -87,7 +85,6 @@ document.getElementById('save-button').addEventListener('click', function () {
8785
document
8886
.getElementById('beautify-button')
8987
.addEventListener('click', function () {
90-
let css = document.getElementById('custom-css').value;
91-
document.getElementById('custom-css').value = css_beautify(css);
92-
editor.getDoc().setValue(css_beautify(customCSS));
88+
let css = editor.getDoc().getValue();
89+
editor.getDoc().setValue(css_beautify(css));
9390
});

0 commit comments

Comments
 (0)