Disable corp link warning for internal hosts
The warning only needs to show on public Gerrit hosts.
Bug: b/354060509
Change-Id: I3bcc83a9cfa6a05d59fc2be36ce7551b0fee7897
diff --git a/web/plugin.ts b/web/plugin.ts
index 81a99ea..e2e4deb 100644
--- a/web/plugin.ts
+++ b/web/plugin.ts
@@ -56,7 +56,8 @@
let onConfirmRevert;
let onRevert;
let onPostRevert;
- if (rubberStamperHosts.includes(getGerritHost(window.location.host))) {
+ const gerritHost = getGerritHost(window.location.host);
+ if (rubberStamperHosts.includes(gerritHost)) {
onConfirmRevert = installASCheckbox;
onRevert = interceptRevertMessage;
onPostRevert = approveAndSubmitRevert;
@@ -81,6 +82,8 @@
// Watch for any label value changes
installLabelValuesCallbackAutosubmit(plugin);
- // Warn on corp links in comments.
- installCorpWarner(plugin);
+ // Warn on corp links in comments for public hosts.
+ if (!gerritHost.endsWith('-internal')) {
+ installCorpWarner(plugin);
+ }
});