anaclumos/bing-chat-for-all-browsers

increase maxlength of chat textarea

alexanderadam opened this issue · 4 comments

see this Tweet for more information

There is the need to inject js to change the textarea maxlenght, I can do it later.

@alexanderadam
I saw that this features is not something very related to this extension. But I made a tampermonkey script to set the maxLenght to 20k, just paste it to a tampermonkey script that executes on the bing chat url

`
(function() {
'use strict';
window.addEventListener('load', function() {
//call function to set max length until it returns true, at 500ms intervals, at most 20 times
var timesExecuted = 0;
var interval = setInterval(function(){
if (setMaxLenght() || timesExecuted > 20) {
clearInterval(interval);
}
timesExecuted++;
}
, 500);

},false);
})();

function setMaxLenght(){
try{
var firstElement = document.querySelector(".cib-serp-main").shadowRoot;
var secondElement = firstElement.querySelector("#cib-action-bar-main").shadowRoot;
var textArea = secondElement.querySelector("textarea");
textArea.maxLength = 20000;
}catch(e){
return false;
}
if (textArea!=null){
return true;
}
return false;
}
`

This issue is stale because it has been open for 30 days with no activity.