Skip to content

Instantly share code, notes, and snippets.

@Hansimov
Last active October 22, 2023 08:23
Show Gist options
  • Save Hansimov/80dbf424fb6df6834dad1b944739b4ef to your computer and use it in GitHub Desktop.
Save Hansimov/80dbf424fb6df6834dad1b944739b4ef to your computer and use it in GitHub Desktop.
Break the input character limits of Bing Chat
// ==UserScript==
// @name Break Bing Chat Input Limit
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Break the input character limits of Bing Chat
// @match https://www.bing.com/search*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let maxCount = 60000;
let cib_bar_main;
let textarea;
let counter;
function updateLetterCounter() {
textarea.maxLength = maxCount;
let currentCount = textarea.value.length;
counter.textContent = currentCount + '/' + maxCount;
}
function initLetterCounter() {
try {
cib_bar_main = document.querySelector(".cib-serp-main").shadowRoot.querySelector("#cib-action-bar-main").shadowRoot;
textarea = cib_bar_main.querySelector("cib-text-input").shadowRoot.querySelector("textarea");
counter = cib_bar_main.querySelector('.letter-counter');
textarea.addEventListener('input', updateLetterCounter);
textarea.addEventListener('paste', updateLetterCounter);
updateLetterCounter();
console.log(`Now Bing Chat Input Limits is up to ${maxCount}!`);
} catch {
setTimeout(initLetterCounter, 500);
}
}
initLetterCounter();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment