|
7 | 7 | for (const resource of ['components/modals.js', 'lib/chatgpt.js', 'lib/dom.js', 'lib/settings.js']) |
8 | 8 | await import(chrome.runtime.getURL(resource)) |
9 | 9 |
|
10 | | - // Init ENV context |
11 | | - const env = { browser: { isMobile: chatgpt.browser.isMobile() }} |
12 | | - |
13 | 10 | // Import APP data |
14 | 11 | const { app } = await chrome.storage.sync.get('app') |
15 | 12 | modals.dependencies.import({ app, siteAlert }) |
|
76 | 73 |
|
77 | 74 | // CHILL a bit if your hacks depend on delayed DOM content |
78 | 75 | await chatgpt.isLoaded() |
79 | | - await new Promise(resolve => setTimeout(resolve, 500)) // sleep .5s |
80 | | - |
81 | | - // Add/update TWEAKS style |
82 | | - const tweaksStyleUpdated = 1732627011377 // timestamp of last edit for this file's tweaksStyle |
83 | | - let tweaksStyle = document.getElementById('tweaks-style') // try to select existing style (from your other extensions) |
84 | | - if (!tweaksStyle || parseInt(tweaksStyle.getAttribute('last-updated')) < tweaksStyleUpdated) { |
85 | | - if (!tweaksStyle) { // outright missing, create/id/attr/append it first |
86 | | - tweaksStyle = dom.create.elem('style', { |
87 | | - id: 'tweaks-style', 'last-updated': tweaksStyleUpdated.toString() }) |
88 | | - document.head.append(tweaksStyle) |
89 | | - } |
90 | | - tweaksStyle.innerText = ( |
91 | | - '[class$=-modal] { z-index: 13456 ; position: absolute }' // to be click-draggable |
92 | | - + ( chatgpt.isDarkMode() ? '.chatgpt-modal > div { border: 1px solid white }' : '' ) |
93 | | - + '.chatgpt-modal button {' |
94 | | - + 'font-size: 0.77rem ; text-transform: uppercase ;' // shrink/uppercase labels |
95 | | - + 'border-radius: 0 !important ;' // square borders |
96 | | - + 'transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out ;' // smoothen hover fx |
97 | | - + 'cursor: pointer !important ;' // add finger cursor |
98 | | - + 'padding: 5px !important ; min-width: 102px }' // resize |
99 | | - + '.chatgpt-modal button:hover {' // add zoom, re-scheme |
100 | | - + 'transform: scale(1.055) ; color: black !important ;' |
101 | | - + `background-color: #${ chatgpt.isDarkMode() ? '00cfff' : '9cdaff' } !important }` |
102 | | - + ( !env.browser.isMobile ? '.modal-buttons { margin-left: -13px !important }' : '' ) |
103 | | - ) |
104 | | - }; // eslint-disable-line |
| 76 | + await new Promise(resolve => setTimeout(resolve, 500)); // sleep .5s |
105 | 77 |
|
106 | 78 | // Add STARS styles for modals |
107 | 79 | ['black', 'white'].forEach(color => document.head.append( |
|
0 commit comments