@@ -18,7 +18,6 @@ chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
18
18
customCSS . replace ( / ( \r \n | \n | \r ) / gm, '' ) +
19
19
"'; document.head.appendChild(style);" ,
20
20
} ) ;
21
- document . getElementById ( 'custom-css' ) . value = customCSS ;
22
21
editor . getDoc ( ) . setValue ( css_beautify ( customCSS ) ) ;
23
22
}
24
23
} ) ;
@@ -59,13 +58,12 @@ chrome.tabs.onCreated.addListener(function (tab) {
59
58
} ) ;
60
59
61
60
// Insert custom CSS into textarea
62
- document . getElementById ( 'custom-css' ) . value = customCSS ;
63
61
editor . getDoc ( ) . setValue ( css_beautify ( customCSS ) ) ;
64
62
65
63
// Save button click event
66
64
document . getElementById ( 'save-button' ) . addEventListener ( 'click' , function ( ) {
67
65
// Get the custom CSS from the textarea
68
- customCSS = document . getElementById ( 'custom-css' ) . value ;
66
+ customCSS = editor . getDoc ( ) . getValue ( ) ;
69
67
// Save the custom CSS to storage using the current tab URL as the key
70
68
chrome . tabs . query ( { active : true , currentWindow : true } , function ( tabs ) {
71
69
let data = { } ;
@@ -87,7 +85,6 @@ document.getElementById('save-button').addEventListener('click', function () {
87
85
document
88
86
. getElementById ( 'beautify-button' )
89
87
. 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 ) ) ;
93
90
} ) ;
0 commit comments