Chrome – How to disable Chrome extensions without disabling them across multiple synced devices

google-chrome-extensions

I use Chrome across 4 different workstations and I have my extensions synced across all of them.

The problem I have is that one of the extensions (Gestures for Chrome) works great if you've got an actual mouse, but on a trackpad on Ubuntu, it just gets in the way.

If I disable it on the Ubuntu machine, it gets disabled on all Chrome installations due to its internal sync mechanism.

Q: Can I selectively disable an extension on just a single machine?

Best Answer

Based on the security concern, Chrome doesn't sync any extension which contains an NPAPI plugin.

Source

What is a NPAPI plugin?

Code running in an NPAPI plugin has the full permissions of the current user and is not sandboxed or shielded from malicious input by Google Chrome in any way. You should be especially cautious when processing input from untrusted sources, such as when working with content scripts or XMLHttpRequest.

Source

Theory

If we modify your extension in a way that Chrome recognize the extension using NPAPI, you should be fine.

How to

  1. First, you need a dummy .dll from any NPAPI extension like Screen Capture (by Google). The extension was removed from Google Play store in the meantime because Google decided to drop NPAPI support. But this doesn't matter for our scenario. Fortunately the official Screen Capture wiki still contains the source code. We don't need the complete extension, only the NPAPI .dll screen_capture.dll. Download it directly

  2. Second, go to the extensions folder that should not be synced. In your case Gestures for Chrome.
    ..\profile\Default\Extensions\jpkfjicglakibpenojifdiepckckakgk\1.12.1_0

  3. Modify the manifest.json file and add the NPAPI plugin as described on Stackoverflow or even better on developer.chrome.com

    {
      "name": "My extension",
      ...
      "plugins": [
        { "path": "screen_capture.dll" }
      ],
      ...
    }
    
  4. Modify the background.html file of your extension you don't want to sync, also described on the Stackoverflow answer above.

    <embed type="application/x-my-extension" id="pluginId">
    <script>
      var plugin = document.getElementById("pluginId");
      var result = plugin.myPluginMethod();  // call a method in your plugin
      console.log("my plugin returned: " + result);
    </script>
    
  5. It may be necessary to re-enable NPAPI support in the future via chrome://flags/#enable-npapi

From here you are on your own. I don't know enough about extension coding.
Thats why it's a theory :)