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.
style.getPropertyValue("--scale-select-container-width"),
        10
      ),
      scaleSelectOverflow = parseInt(
        style.getPropertyValue("--scale-select-overflow"),
        10
      );
    
    const canvas = document.createElement("canvas");
    const ctx = canvas.getContext("2d", { alpha: false });
    ctx.font = `${style.fontSize} ${style.fontFamily}`;
    let maxWidth = 0;
    for (const predefinedValue of await predefinedValuesPromise) {
      const { width } = ctx.measureText(predefinedValue);
      if (width > maxWidth) {
        maxWidth = width;
      }
    }
    maxWidth += 2 * scaleSelectOverflow;
    if (maxWidth > scaleSelectContainerWidth) {
      docStyle.setProperty("--scale-select-container-width", `${maxWidth}px`);
    }
    
    
    canvas.width = 0;
    canvas.height = 0;
  }
}
export { Toolbar };