Skip to content

Commit e3da655

Browse files
authored
client/site: Hide copy button on unsecure connection. (#3226)
1 parent 054c16e commit e3da655

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/webserver/site/src/js/forms.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,12 @@ export class DepositAddress {
18701870
const page = this.page = Doc.idDescendants(form)
18711871
Doc.cleanTemplates(page.unifiedReceiverTmpl)
18721872
Doc.bind(page.newDepAddrBttn, 'click', async () => { this.newDepositAddress() })
1873-
Doc.bind(page.copyAddressBtn, 'click', () => { this.copyAddress() })
1873+
// navigator.clipboard can only be accessed on localhost or over https.
1874+
if (window.isSecureContext) {
1875+
Doc.bind(page.copyAddressBtn, 'click', () => { this.copyAddress() })
1876+
} else {
1877+
Doc.hide(page.copyAddressBtn)
1878+
}
18741879
}
18751880

18761881
/* Display a deposit address. */

0 commit comments

Comments
 (0)