title: Send command 'Emulation.setDeviceMetricsOverride' does not work in chrome.debugger
body: <p>I writing an extension to emulate the mobile device whenever user click on extension icon. This is just the first version of extension so that everything was hardcoded.</p>
  
  <p>I basically attached successfully to Chrome current tab but I do not know why my commands does not work as expected. I using Chrome <strong>version 79</strong> with <strong>protocolversion command is 1.3</strong>. The steps I currently implemented are:</p>
  
  <ol>
  <li><strong>Attach</strong> to current chrome tab.</li>
  <li>Using <strong>Browser.getVersion</strong> to checking whether I am using correct protocol version</li>
  <li>Using <strong>Emulation.canEmulate</strong> to make sure chrome can emulate mobile device.</li>
  <li>Using <strong>Emulation.clearDeviceMetricsOverride</strong> to clear all of metrics if any.</li>
  <li>Using <strong>Emulation.setUserAgentOverride</strong> to override current user agent.</li>
  <li>Using <strong>Emulation.setDeviceMetricsOverride</strong> to emulate mobile device.</li>
  <li>Enable touch event using <strong>Emulation.setTouchEmulationEnabled</strong> to emulate mobile event.</li>
  </ol>
  
  <p>Here is code of above steps:</p>
  
  <pre><code>function EmulateMobileDevice(tabId) {
  
  var protocolVersion = '1.3';
  chrome.debugger.attach({
      tabId: tabId
  }, protocolVersion, function() {
      if (chrome.runtime.lastError) {
          alert(chrome.runtime.lastError.message);
          return;
      }
  
      // Browser.getVersion
      chrome.debugger.sendCommand({
          tabId: tabId
      }, "Browser.getVersion", {}, function(response) {
          console.log(response);
      });
  
      // Emulation.canEmulate
      chrome.debugger.sendCommand({
          tabId: tabId
      }, "Emulation.canEmulate", {}, function(response) {
          console.log(response);
      });
  
      // Emulation.clearDeviceMetricsOverride
      chrome.debugger.sendCommand({
          tabId: tabId
      }, "Emulation.clearDeviceMetricsOverride", {}, function(response) {
          console.log(response);
  
          // Emulation.setUserAgentOverride
          chrome.debugger.sendCommand({
              tabId: tabId
          }, "Emulation.setUserAgentOverride", {
              userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1',
              acceptLanguage: 'en',
              platform: 'mobile'
          }, function(response) {
              console.log(response);
              //Emulation.setDeviceMetricsOverride
              chrome.debugger.sendCommand({
                  tabId: tabId
              }, "Emulation.setDeviceMetricsOverride", {
                  width: 0,
                  height: 0,
                  deviceScaleFactor: 0,
                  mobile: true,
                  screenOrientation: { type: 'portraitPrimary', angle: 1}
              }, function(response) {
                  console.log(response);
  
                  // Emulation.setTouchEmulationEnabled
                  chrome.debugger.sendCommand({
                      tabId: tabId
                  }, "Emulation.setTouchEmulationEnabled", {
                      enabled: true
                  }, function(response) {
                      console.log(response);
                  }); 
              });
          });
      }); });}
  </code></pre>
  
  <p>I refered the same idea <a href="https://github.com/paulirish/emulation-popup-ext/blob/master/app/scripts/background.js" rel="nofollow noreferrer">here</a> implemented by @paulirish but he demonstrated in protocol version 1.1 which was deprecated for now. And I also read the document from <a href="https://chromedevtools.github.io/devtools-protocol/1-3/Emulation" rel="nofollow noreferrer">here</a> for protocol version 1.3.
  Unfortunately I can not get it work.</p>
  
  <p>Here is the screenshot I logged in background script of above method.</p>
  
  <p><a href="https://i.stack.imgur.com/2IsZp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2IsZp.png" alt="enter image description here"></a></p>
  
  <p>Many thanks.</p>