Skip to content

Instantly share code, notes, and snippets.

@raxityo
Last active August 6, 2023 03:14
Show Gist options
  • Save raxityo/11b3d53afcc65d0746184df4374bac79 to your computer and use it in GitHub Desktop.
Save raxityo/11b3d53afcc65d0746184df4374bac79 to your computer and use it in GitHub Desktop.
Tweaks on Bing Chat
// ==UserScript==
// @name Bing Tamper
// @namespace Violentmonkey Scripts
// @match https://www.bing.com/search
// @grant none
// @version 1.0
// @author -
// @description 3/17/2023, 11:59:35 AM
// ==/UserScript==
// Disable going up on scroll
window.addEventListener('wheel', (e) => {
if (e.target.className.includes('cib-serp-main'))
e.stopPropagation()
});
const textAreaElement = () => document.querySelector('cib-serp').shadowRoot.querySelector('cib-action-bar').shadowRoot.querySelector('cib-text-input').shadowRoot.querySelector('textarea')
const tweak = () => {
try {
// Remove character limit on the text area
textAreaElement().removeAttribute('maxlength')
// Restore draft before leaving the page
textAreaElement().value = window.localStorage.monkey_banana__prev_value ?? ''
document.querySelector('#b_header').style.display = 'none'
} catch (error) {
if (confirm('Error modifying textarea. Try again?')) {
window.setTimeout(tweak, 1000)
} else {
console.log(error)
}
}
}
window.setTimeout(tweak, 1000)
// Store draft before leaving the page
window.onunload = () => {
try {
window.localStorage.setItem('monkey_banana__prev_value', textAreaElement().value)
} catch(error) {
// NOOP
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment