-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclaude_enlarge_custom_instruction_field.js
64 lines (53 loc) · 1.94 KB
/
claude_enlarge_custom_instruction_field.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
javascript:(function() {
/* Find the textarea with id from 1-10 */
let textarea = null;
for (let i = 1; i <= 10; i++) {
const candidate = document.getElementById(i.toString());
if (candidate && candidate.tagName === 'TEXTAREA') {
textarea = candidate;
break;
}
}
if (!textarea) {
alert('No textarea with id 1-10 found on this page. Ensure you are on a Claude Project page with the Custom Instructions dialog open');
return;
}
/* Make the textarea resizable */
textarea.style.resize = 'both';
/* Set optimal size that doesn't waste space */
textarea.style.width = '1265px';
textarea.style.height = '800px';
textarea.style.minHeight = '600px';
/* Force the textarea to maintain its size */
textarea.style.boxSizing = 'border-box';
/* Check if textarea is inside a dialog or modal */
let dialog = textarea.closest('dialog, .modal, [role="dialog"]');
if (dialog) {
/* Make dialog fit content more efficiently */
dialog.style.width = 'fit-content';
dialog.style.height = 'fit-content';
dialog.style.maxWidth = '95vw';
dialog.style.maxHeight = '95vh';
/* Add padding to dialog for better aesthetics */
dialog.style.padding = '20px';
/* Ensure overflow is properly handled */
dialog.style.overflow = 'auto';
/* Find any immediate parent containers that might need adjustment */
const dialogParent = dialog.parentElement;
if (dialogParent) {
dialogParent.style.display = 'flex';
dialogParent.style.justifyContent = 'center';
dialogParent.style.alignItems = 'center';
}
}
/* Check for any immediate container of the textarea */
const textareaParent = textarea.parentElement;
if (textareaParent) {
textareaParent.style.width = 'auto';
textareaParent.style.height = 'auto';
}
/* Force layout recalculation */
setTimeout(function() {
window.dispatchEvent(new Event('resize'));
}, 100);
})();