Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /webusb/insecure-context.any.html - WPT Dashboard Interop Dashboard
- /webusb/insecure-context.any.worker.html - WPT Dashboard Interop Dashboard
'use strict';
test(() => {
assert_false(isSecureContext);
assert_false('usb' in navigator);
}, '"usb" should not be present on navigator in an insecure context.');
[
'USB', 'USBAlternateInterface', 'USBConfiguration', 'USBConnectionEvent',
'USBDevice', 'USBEndpoint', 'USBInterface', 'USBInTransferResult',
'USBOutTransferResult', 'USBIsochronousInTransferResult',
'USBIsochronousOutTransferResult', 'USBIsochronousInTransferPacket',
'USBIsochronousOutTransferPacket',
].forEach((symbol) => {
test(() => {
assert_false(isSecureContext);
assert_false(symbol in this)
}, '"' + symbol + '" should not be visible in an insecure context.');
});
done();