2016-04-06 9 views
0

イムをキャプチャするために、私はあなたが画面が小さなアプリをやって

問題は、今ということである「キャプチャ」されている画面を表示する方法があるかどうかを知りたいものを選択した後、立ち往生キャプチャする画面を選択した後、白いバーやそのようなものを「共有していない」と表示していない場合、キャプチャするフレームを選択していないだけです。私は何も記録できないので、これは私にとっては問題です。

chrome.runtime.onConnect.addListener(function(port){ 
    // listen for messages from the port 

    port.onMessage.addListener(function(message){ 
     // send back a "pending" answer on the port 
     port.postMessage({ 
      "answer": 1, 
      "state": "pending", 
      "requestId": message.requestId 
     }); 

     chrome.desktopCapture.chooseDesktopMedia(["screen", "window"], port.sender.tab, function(id){ 


      var response = { 
       "answer": 1, 
       "state": "completed", 
       "requestId": message.requestId, 
       "streamId": id 
      }; 

      // send back a "completed" answer on the port 
      port.postMessage(response); 
     }); 
    }); 
}); 

共有デスクトップの一部がスタックしているなぜ私が知ることができますデバッグするが方法です。

これは、コードはコードの一部ですか?

ありがとうございました!

答えて

0

inspecting it or using the debuggerで表示できます。

Inspect the popup

As long as your browser is in Developer mode, it's easy to inspect popups.

  1. Go to the Extensions page (chrome://extensions), and make sure Developer mode is still enabled. The Extensions page doesn't need to be open for the following to work. The browser remembers the setting, even when the page isn't shown.
  2. Right-click the extension and choose the Inspect popup menu item. The popup appears, and a Developer Tools window like the following should display the code for popup.html.
  3. If the Scripts button isn't already selected, click it.
  4. Click the console button (second from left, at the bottom of the Developer Tools window) so that you can see both the code and the console.

Use the debugger

  1. Set a breakpoint inside the code code for chrome.desktopCapture.chooseDesktopMedia
  2. Refresh the page and check the debugger.

また、拡張機能のJavaScriptコードでconsole.log()やconsole.error()などの広く使用可能なデバッグAPIを使用してみてください。

+0

エラーが何も起こっていないことがわかりましたが、何度かチェックした後、拡張機能にエラーがあります。エラー:接続されていないポートオブジェクトを使用しようとしましたが、ほとんどの時間コンソールに何も表示していません。 – AbdulHamid

+0

会話に問題があると予想よりも長くかかることがあります。 [long-lived connection](http://stackoverflow.com/questions/22943988/one-more-time-about-error-attempting-to-use-a-disconnected-port-object-how-to)を読んでみてください。 [接続を再確立する](http://stackoverflow.com/questions/22943988/one-more-time-about-error-attempting-to-use-a-disconnected-port-object-how-to)をこのエラーに関する回避策を確認してください。 –

関連する問題