We could use:
https://github.com/mozilla/pdf.js/blob/c3d08580627471432a6ad0b2fdb948df64126afa/src/display/api.js#L929

and look at bit 4.

The following pdf:
https://orimi.com/pdf-test.pdf
is not editable in neither Acrobat nor Edge nor Foxit and nor Okular.
next: document.getElementById("next"),
      zoomIn: document.getElementById("zoomIn"),
      zoomOut: document.getElementById("zoomOut"),
      viewFind: document.getElementById("viewFind"),
      openFile:
        typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
          ? document.getElementById("openFile")
          : null,
      print: document.getElementById("print"),
      editorModeButtons: document.getElementById("editorModeButtons"),
      editorNoneButton: document.getElementById("editorNone"),
      editorFreeTextButton: document.getElementById("editorFreeText"),
      editorInkButton: document.getElementById("editorInk"),
      presentationModeButton: document.getElementById("presentationMode"),
      download: document.getElementById("download"),
      viewBookmark: document.getElementById("viewBookmark"),
    },
    secondaryToolbar: {
      toolbar: document.getElementById("secondaryToolbar"),
      toggleButton: document.getElementById("secondaryToolbarToggle"),
      presentationModeButton: document.getElementById(
        "secondaryPresentationMode"
      ),
      openFileButton:
        typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
          ? document.getElementById("secondaryOpenFile")
          : null,
      printButton: document.getElementById("secondaryPrint"),
      downloadButton: document.getElementById("secondaryDownload"),
      viewBookmarkButton: document.getElementById("secondaryViewBookmark"),