Skip to content

Commit a535002

Browse files
committed
Removed no-longer needed env + tweaksStyle ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js-chrome-starter]
1 parent 4505e25 commit a535002

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

starters/chrome/extension/content.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
for (const resource of ['components/modals.js', 'lib/chatgpt.js', 'lib/dom.js', 'lib/settings.js'])
88
await import(chrome.runtime.getURL(resource))
99

10-
// Init ENV context
11-
const env = { browser: { isMobile: chatgpt.browser.isMobile() }}
12-
1310
// Import APP data
1411
const { app } = await chrome.storage.sync.get('app')
1512
modals.dependencies.import({ app, siteAlert })
@@ -76,32 +73,7 @@
7673

7774
// CHILL a bit if your hacks depend on delayed DOM content
7875
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
10577

10678
// Add STARS styles for modals
10779
['black', 'white'].forEach(color => document.head.append(

0 commit comments

Comments
 (0)