Onshape 3D‑Mouse on Linux (in‑page patch)

Fake the platform property on 'navigator' to convince Onshape it's running under Windows. This causes it to ask for information on https://127.51.68.120:8181/3dconnexion/nlproxy so that a 3d mouse can be connected.

当前为 2025-04-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Onshape 3D‑Mouse on Linux (in‑page patch)
  3. // @description Fake the platform property on 'navigator' to convince Onshape it's running under Windows. This causes it to ask for information on https://127.51.68.120:8181/3dconnexion/nlproxy so that a 3d mouse can be connected.
  4. // @match https://cad.onshape.com/documents/*
  5. // @run-at document-start
  6. // @grant none
  7. // @version 0.0.1
  8. // @license MIT
  9. // @namespace https://greasyfork.org/users/1460506
  10. // ==/UserScript==
  11.  
  12. Object.defineProperty(Navigator.prototype, 'platform', {
  13. get: () => 'Win32'
  14. });
  15. console.log('[Onshape patch] navigator.platform →', navigator.platform);