{"record":{"id":"b811c941b272c920","repo":"GopeedLab/gopeed","slug":"element-is-readonly-selector","errorCode":null,"errorMessage":"element is readonly: ${selector}","messagePattern":"element is readonly: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"pkg/download/engine/webview/runtime.go","lineNumber":238,"sourceCode":"func (p *PageHandle) Type(selector string, text string, opts ...map[string]any) error {\n\ttypeOpts := parseTypeOptions(firstMap(opts))\n\t_, err := p.Execute(`(selector, text, delayMS) => {\n\t\tconst element = document.querySelector(selector);\n\t\tif (!element) {\n\t\t\tthrow new Error(\"element not found: \" + selector);\n\t\t}\n\t\tif (typeof element.focus === \"function\") {\n\t\t\telement.focus();\n\t\t}\n\t\tconst emitInput = () => {\n\t\t\telement.dispatchEvent(new Event(\"input\", { bubbles: true }));\n\t\t};\n\t\tconst insertIntoInput = (chunk) => {\n\t\t\tif (element.disabled) {\n\t\t\t\tthrow new Error(\"element is disabled: \" + selector);\n\t\t\t}\n\t\t\tif (element.readOnly) {\n\t\t\t\tthrow new Error(\"element is readonly: \" + selector);\n\t\t\t}\n\t\t\tconst value = typeof element.value === \"string\" ? element.value : \"\";\n\t\t\tconst hasSelection = typeof element.selectionStart === \"number\" && typeof element.selectionEnd === \"number\";\n\t\t\tconst start = hasSelection ? element.selectionStart : value.length;\n\t\t\tconst end = hasSelection ? element.selectionEnd : value.length;\n\t\t\telement.value = value.slice(0, start) + chunk + value.slice(end);\n\t\t\tconst caret = start + chunk.length;\n\t\t\tif (typeof element.setSelectionRange === \"function\") {\n\t\t\t\telement.setSelectionRange(caret, caret);\n\t\t\t}\n\t\t\temitInput();\n\t\t};\n\t\tconst insertIntoEditable = (chunk) => {\n\t\t\tif (element.isContentEditable) {\n\t\t\t\telement.textContent = (element.textContent || \"\") + chunk;\n\t\t\t\temitInput();\n\t\t\t\treturn;\n\t\t\t}","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/GopeedLab/gopeed/blob/7b7327ffb30816273a74b142cccc0bc10c5a4c67/pkg/download/engine/webview/runtime.go#L220-L256","documentation":"Error \"element is readonly: ${selector}\" thrown in GopeedLab/gopeed.","triggerScenarios":"Thrown at pkg/download/engine/webview/runtime.go:238 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b7327ffb30816273a74b142cccc0bc10c5a4c67","analyzedAt":"2026-08-16T02:51:03.250Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}