2017-08-02 6 views

答えて

1

最終的にnavigator.permissions.queryがこれをサポートします。しかしWeb Bluetooth Specification

navigator.permissions.query({ 
    name: "bluetooth", 
    deviceId: sessionStorage.lastDevice, 
}).then(result => { 
    if (result.devices.length == 1) { 
    return result.devices[0]; 
    } else { 
    throw new DOMException("Lost permission", "NotFoundError"); 
    } 
}).then(...); 

no browser currently implements thisからのサンプルコード。

Q3 2017現在、クロムの実装はウェブのBluetoothには積極的に取り組んでいますが、この機能ではありません。

関連する問題