Skip to content

Commit

Permalink
Escaped backslashes in CSS class list conversion to prevent injection…
Browse files Browse the repository at this point in the history
… attacks ↞ [auto-sync from `adamlui/chatgpt-widescreen/greasemonkey`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Jun 16, 2024
1 parent 87220f1 commit eb4dde6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chatgpt-widescreen/chrome/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
headerSelector = /chatgpt|openai/.test(site) ? 'main .sticky' : ''
let footerSelector = 'footer'
try { footerSelector = /chatgpt|openai/.test(site) ?
chatgpt.getFooterDiv()?.classList.toString().replace(/([:[\]])/g, '\\$1').replace(/^| /g, '.') : ''
chatgpt.getFooterDiv()?.classList.toString().replace(/([:[\]\\])/g, '\\$1').replace(/^| /g, '.') : ''
} catch (err) {}

// AUTO-FOCUS ChatGPT chatbar if enabled
Expand Down
2 changes: 1 addition & 1 deletion chatgpt-widescreen/edge/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
headerSelector = /chatgpt|openai/.test(site) ? 'main .sticky' : ''
let footerSelector = 'footer'
try { footerSelector = /chatgpt|openai/.test(site) ?
chatgpt.getFooterDiv()?.classList.toString().replace(/([:[\]])/g, '\\$1').replace(/^| /g, '.') : ''
chatgpt.getFooterDiv()?.classList.toString().replace(/([:[\]\\])/g, '\\$1').replace(/^| /g, '.') : ''
} catch (err) {}

// AUTO-FOCUS ChatGPT chatbar if enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
// @description:zu Engeza izinhlobo zezimodi ze-Widescreen + Fullscreen ku-ChatGPT ukuze kube nokubonakala + ukuncitsha ukusukela
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.6.15.3
// @version 2024.6.16
// @license MIT
// @compatible chrome
// @compatible firefox
Expand Down Expand Up @@ -753,7 +753,7 @@
headerSelector = /chatgpt|openai/.test(site) ? 'main .sticky' : ''
let footerSelector = 'footer'
try { footerSelector = /chatgpt|openai/.test(site) ?
chatgpt.getFooterDiv()?.classList.toString().replace(/([:[\]])/g, '\\$1').replace(/^| /g, '.') : ''
chatgpt.getFooterDiv()?.classList.toString().replace(/([:[\]\\])/g, '\\$1').replace(/^| /g, '.') : ''
} catch (err) {}

// AUTO-FOCUS ChatGPT chatbar if enabled
Expand Down
2 changes: 1 addition & 1 deletion chatgpt-widescreen/opera/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
headerSelector = /chatgpt|openai/.test(site) ? 'main .sticky' : ''
let footerSelector = 'footer'
try { footerSelector = /chatgpt|openai/.test(site) ?
chatgpt.getFooterDiv()?.classList.toString().replace(/([:[\]])/g, '\\$1').replace(/^| /g, '.') : ''
chatgpt.getFooterDiv()?.classList.toString().replace(/([:[\]\\])/g, '\\$1').replace(/^| /g, '.') : ''
} catch (err) {}

// AUTO-FOCUS ChatGPT chatbar if enabled
Expand Down

0 comments on commit eb4dde6

Please sign in to comment.