1

OSX에서 Chrome Canary를 실행 중입니다.JS 확장 프로그램에서 chrome.bluetooth.AddProfile을 사용하여 권한이 거부되었습니다.

developer example for bluetooth application for Zephyr HXM bluetooth client을 수정하여 특정 UUID에 대해 Bluetooth를 통한 소켓을 수신하는 Android 앱에 연결하려고합니다.

dev 예제는 현재 프로필 기반 인 최신 버전의 Chrome과 일치하지 않는 API를 사용하고 있습니다.

는 나는 다음과 같은 오류 메시지가 서풍 클라이언트의 main.js에 chrome.bluetooth.addProfile({uuid: kUUID}, console.log)를 호출 할 때 :

bluetooth.addProfile: Permission to add profile denied.

Error in response to bluetooth.addProfile: TypeError: Illegal invocation 하였다.

addProfile을 호출 할 수있는 확장 프로그램 권한을 어떻게 부여합니까? manifest.json은 이미 블루투스 권한을 제공합니다.

테스트 목적으로 Chrome에서 전체적으로 사용 권한을 사용 중지 할 수 있나요?

감사합니다.

답변

3

당신은 당신의 manifest.json이 같은 블루투스 권한을 선언해야합니다

"permissions": [ 
    { 
    "bluetooth": [ 
     { 
     uuid: '<Your UUID>' 
     } 
    ] 
    } 
    ... 
] 
+0

감사합니다. "{" "권한": [{ "bluetooth": [{ "uuid": "00001101-0000-1000-8000-00805f9b34fb"}]}] 및 매니페스트가 Chrome에서 올바르게로드됩니다. 그러나 나는 여전히 같은 오류가 발생합니다 : 'bluetooth.addProfile : TypeError : Illegal invocation'에 대한 응답으로 오류가 발생했습니다. 나는 아직도 잘못하고 있니? – snap

+0

console.log는 콜백 기능으로 직접 사용될 수 없습니다. 'function() {console.log ('ok')}'로 교체하십시오. –

0

는 패키지 응용 프로그램이 아니라 확장 할 필요가 있기 때문에. 블루투스는 확장 기능을 사용하지 않습니다.

관련 문제