add report malicious plugin link to installer detail view

Add a "Report malicious plugin" link to the plugin detail view that generates a GitHub report-content URL for plugins with a GitHub source. The link extracts the username from the GitHub URL and pre-fills GitHub's abuse report form. Style the link in error-text color to distinguish it from other developer links.

frdel committed Mar 16, 2026 at 16:45 UTC 7ee5dac78e9db3876dd877010a657146330381d7
2 files changed +32
plugins/_plugin_installer/webui/install-detail.html
+13
@@ -245,6 +245,12 @@
245 <span>Plugin Index</span>
246 </a>
247 </template>
248 + <template x-if="$store.pluginInstallStore.getReportUrl($store.pluginInstallStore.selectedPlugin)">
249 + <a :href="$store.pluginInstallStore.getReportUrl($store.pluginInstallStore.selectedPlugin)" target="_blank" class="pi-dev-link pi-report-link">
250 + <span class="material-symbols-outlined">report</span>
251 + <span>Report malicious plugin</span>
252 + </a>
253 + </template>
254 </div>
255 </div>
256 </div>
@@ -796,6 +802,13 @@
802 color: var(--color-highlight);
803 }
804
805 + .pi-dev-link.pi-report-link,
806 + .pi-dev-link.pi-report-link:hover,
807 + .pi-dev-link.pi-report-link .material-symbols-outlined,
808 + .pi-dev-link.pi-report-link:hover .material-symbols-outlined {
809 + color: var(--color-error-text);
810 + }
811 +
812 .pi-footer .buttons-container {
813 width: 100%;
814 }
plugins/_plugin_installer/webui/pluginInstallStore.js
+19
@@ -705,6 +705,25 @@ const model = {
705 });
706 },
707
708 + getReportUrl(plugin) {
709 + const githubUrl = plugin?.github;
710 + if (!githubUrl || typeof githubUrl !== "string") return "";
711 + try {
712 + const url = new URL(githubUrl.trim().replace(/\.git$/i, ""));
713 + if (!url.hostname.includes("github.com")) return "";
714 + const parts = url.pathname.split("/").filter(Boolean);
715 + if (parts.length >= 1) {
716 + const username = parts[0];
717 + const contentUrl = encodeURIComponent(githubUrl);
718 + const report = encodeURIComponent(`${username} (user)`);
719 + return `https://github.com/contact/report-content?content_url=${contentUrl}&report=${report}`;
720 + }
721 + } catch (e) {
722 + // ignore
723 + }
724 + return "";
725 + },
726 +
727 // ── Shared ───────────────────────────────────
728
729 resetZip() {