littlesera / LSCG

GNU General Public License v3.0
15 stars 13 forks source link

LSCG settings importing throws an error in firefox #472

Closed bananarama92 closed 8 months ago

bananarama92 commented 8 months ago

Hi there, stumbled upon an exception when trying to import LSCG settings due to navigator.clipboard.readText being undefined. Some quick googling suggests that firefox simply lacks support for the relevant readText function (ref1). Apparently there is something in the works for the firefox 122 nightlies (ref2), but it's not 100% clear to me if its all that useful for BC addons as they only ever make explicit mention of "Web extensions".

----- UNHANDLED ERROR -----
Message: TypeError: navigator.clipboard.readText is not a function
Source: https://littlesera.github.io/LSCG/bundle.js?v=1708216814352:20:265442
Click/<@https://littlesera.github.io/LSCG/bundle.js?v=1708216814352:20:265442

----- Current context (most recent first) -----
[None]

----- Debug report -----
Location: https://www.bondage-europe.com/R101/BondageClub/
UA: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0
BC Version: R101
ModSDK Version: 1.1.0
Mods:
  - Fantastic Ultimate Solution to Addon Management (FUSAM): 1432a83e
    repository: https://gitlab.com/Sidiousious/bc-addon-loader
  - Maid's Bondage Scripts (MBS): 1.3.7
    repository: https://github.com/bananarama92/MBS
  - For Better Club (FBC): 5.3
    repository: https://gitlab.com/Sidiousious/bce.git
  - Universal Remote (UniRemote): 7d688a01
    repository: https://gitlab.com/sidiousious/universal-remote
  - Bondage Club Tweaks (BCTweaks): 0.6.0
    repository: https://github.com/agicitag/BCTweaks
  - Bondage Club Extended (BCX): 0.9.9-32aa6b4a
    repository: https://github.com/Jomshir98/bondage-club-extended
  - Little Sera's Club Games (LSCG): 0.3.45
    repository: https://github.com/littlesera/LSCG
No known legacy mods detected.

----- BC state report -----
Mouse position: 1792 684
Connected to server: true
Local time: 1708217761151
Server time: 1708217768841.3577 (diff: 7690.36)
Screen: Character/Preference
In chatroom: true
GLVersion: webgl2
Last received message: AccountQueryResult (1708217757091)
Last sent message: AccountQuery (1708217756988)

----- ModSDK report -----
No warnings.
bananarama92 commented 8 months ago

Might it be an idea to use window.prompt instead and just let the user manually copy/paste the settings in the resulting text field?

littlesera commented 8 months ago

Fixed in #474