Thank you for your submission, an automated scan of your plugin code's revealed the following issues:

### Required

[[1](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L85)][[2](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L98)][[3](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L118)][[4](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L130)][[5](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L141)][[6](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L182)][[7](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L183)][[8](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L190)][[9](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L191)][[10](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L220)][[11](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L221)][[12](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L222)][[13](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L223)][[14](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L224)][[15](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L229)][[16](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L236)][[17](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L239)][[18](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L240)][[19](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L251)][[20](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L252)][[21](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L253)][[22](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L254)][[23](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L258)][[24](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L259)][[25](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L260)][[26](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L261)][[27](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L262)][[28](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L263)][[29](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L274)][[30](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L275)] and more :You should avoid assigning styles via JavaScript or in HTML and instead move all these styles into CSS so that they are more easily adaptable by themes and snippets.


[[1](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L113)][[2](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L345)][[3](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L394)][[4](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L401)][[5](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L408)][[6](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ui/manage-models-modal.ts#L36)][[7](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ui/manage-models-modal.ts#L79)][[8](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/settings/settings-tab.ts#L427)][[9](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/settings/settings-tab.ts#L433)][[10](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/settings/settings-tab.ts#L439)][[11](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L214)][[12](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L264)][[13](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L306)][[14](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L326)][[15](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L342)][[16](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L530)][[17](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L534)][[18](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L569)][[19](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L584)][[20](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L600)][[21](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L615)][[22](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L657)][[23](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L864)][[24](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L905)][[25](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L917)][[26](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L920)][[27](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L927)][[28](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L955)][[29](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L965)][[30](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L975)] and more :Using `innerHTML`, `outerHTML` or similar API's is a security risk. Instead, use the DOM API or the Obsidian helper functions: <https://docs.obsidian.md/Plugins/User+interface/HTML+elements>

[[1](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L1815)][[2](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1101)]:You should not cast this, instead use a `instanceof` check to make sure that it's actually a file/folder.

[[1](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/utils/logger.ts#L16)][[2](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ui/manage-models-modal.ts#L144)][[3](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ui/manage-models-modal.ts#L147)][[4](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L457)][[5](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L466)][[6](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L467)][[7](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L468)][[8](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L521)][[9](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L540)][[10](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L549)][[11](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L573)][[12](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L574)][[13](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L576)][[14](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L601)][[15](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L610)][[16](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L611)][[17](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L612)][[18](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L643)][[19](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L661)][[20](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L670)][[21](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L858)]:You should consider limiting the number of `console.log`s in your code, to not pollute the dev console.



---

### Optional

[[1](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L161)][[2](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L162)][[3](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L163)][[4](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L171)][[5](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L172)][[6](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L211)][[7](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L307)][[8](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L308)][[9](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L315)][[10](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L316)][[11](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/managers/screenshot-manager.ts#L317)][[12](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L182)][[13](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L183)][[14](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L184)][[15](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L185)][[16](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L199)][[17](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L200)][[18](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L239)][[19](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L240)][[20](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L258)][[21](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L259)][[22](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L453)][[23](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L490)][[24](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L491)][[25](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L492)][[26](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L508)][[27](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L542)][[28](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L543)][[29](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L558)][[30](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/editors/image-editor.ts#L559)] and more :Casting to `any` should be avoided as much as possible.

[[1](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ui/set-keys-modal.ts#L1277-L1294)][[2](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ui/set-keys-modal.ts#L1298-L1316)][[3](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ui/set-keys-modal.ts#L1320-L1334)][[4](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ui/set-keys-modal.ts#L1338-L1357)][[5](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L683-L715)][[6](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L747-L755)][[7](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L798-L832)][[8](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1222-L1246)][[9](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1261-L1269)][[10](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1293-L1319)][[11](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1410-L1437)][[12](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1470-L1478)][[13](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1527-L1556)][[14](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1640-L1647)][[15](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1661-L1676)][[16](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-manager.ts#L1730-L1744)]:Obsidian provides the [`requestUrl`](https://docs.obsidian.md/Reference/TypeScript+API/requestUrl) method, it will make sure that network requests work on every plattform.

[[1](https://github.com/Do7and/obsidian-captureai/blob/2e721d27f2db09cb8272a2faca0c06a0454aa7e6/src/ai/ai-chat-view.ts#L4166)]:Use `app.fileManager.trashFile(file: TAbstractFile)` instead, this will make sure that the file is deleted according to the users preferences.



---



Do <b>NOT</b> open a new PR for re-validation.
Once you have pushed all of the required changes to your repo, the bot will update the labels on this PR within 6 hours.
If you think some of the required changes are incorrect, please comment with `/skip` and the reason why you think the results are incorrect.