mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-29 02:17:45 -10:00
24 lines
809 B
HTML
24 lines
809 B
HTML
<!doctype html>
|
|
<script>
|
|
window.onmessage = (e) => {
|
|
const paymentArgs = [[{supportedMethods: ['foo']}], {total: {label: 'label', amount: {currency: 'USD', value: '5.00'}}}];
|
|
|
|
if (e.data === 'What is the result of new PaymentRequest(...)?') {
|
|
const result = {urlQuery: location.search.substring(1)}; // Used to distinguish subtests
|
|
try {
|
|
new PaymentRequest(...paymentArgs);
|
|
result.message = 'Success';
|
|
e.source.postMessage(result, '*');
|
|
} catch(ex) {
|
|
result.message = 'Exception';
|
|
result.details = [ex instanceof DOMException, ex.code, ex.name];
|
|
e.source.postMessage(result, '*');
|
|
}
|
|
} else {
|
|
result.message = 'Incorrect message';
|
|
e.source.postMessage(result, '*');
|
|
}
|
|
}
|
|
</script>
|
|
<p>This page echos the result of new PaymentRequest(...).</p>
|