Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: third_party/WebKit/LayoutTests/nfc/resources/push-from-iframe.html

Issue 2657023005: [webnfc] Allow access to WebNFC API only from main frame (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script>
3 'use strict';
4
5 window.onmessage = message => {
6 if (message.data === 'Ready') {
7 let onSuccess = () => { parent.postMessage('Failure', '*'); };
8 let onError = error => {
9 if (error.name == 'SecurityError') {
10 parent.postMessage('Success', '*');
11 } else {
12 parent.postMessage('Failure', '*');
13 }
14 }
15 navigator.nfc.push('Test').then(onSuccess, onError);
16 }
17 };
18
19 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/nfc/resources/nfc-helpers.js ('k') | third_party/WebKit/Source/modules/nfc/NFC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698