chooseDesktopMedia use in extension, error with "URL scheme for the specified tab is not secure"

295 views
Skip to first unread message

bo liu

unread,
Dec 9, 2014, 12:22:10 AM12/9/14
to discuss...@googlegroups.com
hi, all

give me a help.

i use a web call extension for desktop share.

extension code is below:
chrome.runtime.onMessageExternal.addListener(
    function(request, sender, sendResponse) {
        console.log("Got request", request, sender);
        if(request.getVersion) {
            sendResponse({ version: chrome.runtime.getManifest().version});
            return false; // Dispose of sendResponse
        } else if(request.getStream) {
            // Gets chrome media stream token and returns it in the response.
            chrome.desktopCapture.chooseDesktopMedia(
                ["screen", "window"], sender.tab,
                function(streamId) {
                console.log("chooseDesktopMedia callback, streamId=", streamId);
                    sendResponse({ streamId: streamId});
                });
            return true; // Preserve sendResponse for future use
        } else {
            console.error("Unknown request");
            sendResponse({ error : "Unknown request" });
            return false;
        }
    }
);

web call is here:
chrome.runtime.sendMessage(extensionId,{getStream:true}, function (response){
      if (response==undefined){
        console.log("Access to screen denied");
        return;
      }
      var theId = response.streamId;
      console.log("Get StreamID.  theId="+theId);
    });

now getVersion is ok, but getStream is report error:
nchecked runtime.lastError while running desktopCapture.chooseDesktopMedia: URL scheme for the specified tab is not secure.
    at chrome-extension://gmbepelnoghhpjpmonpfpfolcnkaglkg/script.js:11:35

anyone give me a help!

thanks,
bob

Philipp Hancke

unread,
Dec 9, 2014, 4:51:56 PM12/9/14
to discuss...@googlegroups.com
You need https. Hopefully that should be mentioned in the docs soon :-)

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages