TheZennou / STExtension-Snapshot

Takes a snapshot of the current chat and makes an image of it for easy sharing.
MIT License
1 stars 1 forks source link

[BUG] Can't capture more than 15 messages in Firefox 126 #1

Closed JomoJauhri closed 4 months ago

JomoJauhri commented 4 months ago

Problem: I was trying to capture a full log in Firefox (32 chats), but then the extension throwing me an error: Failed, Please check the browser console. Common issues are no internet, or CORS policy.

How to replicate: Use Firefox Capture anything beyond 15 messages

Scope: Tried Edge, it works without specifying 15 messages. Tried Firefox in debug mode / disable all extensions, still doesn't works. In Firefox, I tried changing to grid, different ranges (e.g 2-16) all works until I tried to generate more than 15 messages.

I want to throw the console log, but how do I do that? Copy all message in Dev tools and the unopened brackets still got cut.

Empty string passed to getElementById(). 3 LoginManager.shared.mjs:40:23
Character context menu initialized 
Object {  }
script.js:438:9
initializing Prompt Itemization Array on Startup script.js:446:9
START MOVING UI RossAscends-mods.js:698:17
dragElement called for sheld RossAscends-mods.js:449:13
dragElement escaped name: sheld RossAscends-mods.js:451:13
dragElement called for left-nav-panel RossAscends-mods.js:449:13
dragElement escaped name: left-nav-panel RossAscends-mods.js:451:13
dragElement called for right-nav-panel RossAscends-mods.js:449:13
dragElement escaped name: right-nav-panel RossAscends-mods.js:451:13
dragElement called for WorldInfo RossAscends-mods.js:449:13
dragElement escaped name: WorldInfo RossAscends-mods.js:451:13
dragElement called for floatingPrompt RossAscends-mods.js:449:13
dragElement escaped name: floatingPrompt RossAscends-mods.js:451:13
dragElement called for logprobsViewer RossAscends-mods.js:449:13
dragElement escaped name: logprobsViewer RossAscends-mods.js:451:13
dragElement called for cfgConfig RossAscends-mods.js:449:13
dragElement escaped name: cfgConfig RossAscends-mods.js:451:13
loading movingUI state power-user.js:1722:17
Unsupported language: en-us i18n.js:38:17
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments: 
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: May 20, 2024 2:21pm, _f: undefined, _strict: undefined, _locale: [object Object]
e/<@http://127.0.0.1:8000/lib/moment.min.js:1:3257
Nt@http://127.0.0.1:8000/lib/moment.min.js:1:21587
Pt@http://127.0.0.1:8000/lib/moment.min.js:1:22164
W@http://127.0.0.1:8000/lib/moment.min.js:1:22247
f@http://127.0.0.1:8000/lib/moment.min.js:1:207
parseTimestamp@http://127.0.0.1:8000/scripts/utils.js:644:15
timestampToMoment@http://127.0.0.1:8000/scripts/utils.js:623:34
addOneMessage@http://127.0.0.1:8000/script.js:2076:41
sendSystemMessage@http://127.0.0.1:8000/script.js:2472:18
firstLoadInit@http://127.0.0.1:8000/script.js:861:22
moment.min.js:1:2828
Event emitted: settings_loaded_before eventemitter.js:101:17
Preset samplers order: 6,0,1,2,3,4,5 kai-settings.js:343:13
Preset samplers order: 1,5,0,2,3,4 nai-settings.js:504:13
Preset samplers order: 5,6,0,1,3,4,2 textgen-settings.js:490:13
Preset samplers order:  
Array(12) [ "temperature", "dynamic_temperature", "quadratic_sampling", "top_k", "top_p", "typical_p", "epsilon_cutoff", "eta_cutoff", "tfs", "top_a", … ]
textgen-settings.js:511:13
Preset samplers order:  
Array(6) [ "top_k", "tfs_z", "typical_p", "top_p", "min_p", "temperature" ]
textgen-settings.js:501:13
Preset not found openai.js:3174:17
Claude model changed to claude-3-sonnet-20240229 openai.js:3655:17
Event emitted: chatcompletion_model_changed eventemitter.js:101:17
Event emitted: chatcompletion_source_changed eventemitter.js:101:17
poweruser.chat_display 0 power-user.js:1043:13
applying default chat power-user.js:1048:21
loading movingUI state power-user.js:1722:17
setting charlist state to... power-user.js:1706:17
..to list power-user.js:1710:26
Event emitted: settings_loaded_after eventemitter.js:101:17
value? openai script.js:5929:13
hiding settings? script.js:5931:17
returning full samplers array samplerSelect.js:310:17
Event emitted: worldinfo_settings_updated eventemitter.js:101:17
Event emitted: extensions_first_load eventemitter.js:101:17
Zoom: 0.91, X:1467, Y:772 power-user.js:2999:17
loading movingUI state power-user.js:1722:17
Loading URL synchronously scripts/extensions/third-party/Extension-Idle/dropdown.html templates.js:15:13
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help https://xhr.spec.whatwg.org/#sync-warning templates.js:17:13
dragElement called for notebookPanel RossAscends-mods.js:449:13
dragElement escaped name: notebookPanel RossAscends-mods.js:451:13
Loading URL synchronously scripts/extensions/third-party/Extension-WebSearch/settings.html templates.js:15:13
Summary set to:  Position: 0 Depth: 2 Role: 0 3 index.js line 18 > srcScript:807:13
dragElement called for expression-holder RossAscends-mods.js:449:13
dragElement escaped name: expression-holder RossAscends-mods.js:451:13
An AudioContext was prevented from starting automatically. It must be created or resumed after a user gesture on the page. pitch_shift.js line 18 > importedModule:42:16
An AudioContext was prevented from starting automatically. It must be created or resumed after a user gesture on the page. index.js line 18 > srcScript:34:20
Invalid URI. Load of media resource  failed. 2 127.0.0.1:8000
Settings not ready, aborting save script.js:6192:17
Using default TTS Provider settings system.js line 18 > importedModule:116:21
SystemTTS: Settings loaded system.js line 18 > importedModule:154:17
<Blip extension>  Updated voice map debug text to
 Saiki Aria: (10,0.5,1.5,250,500,100,30,file,assets/blip/st_blip_0.ogg,1,1,false),
Seraphina: (5,0.5,1.5,250,500,100,30,file,assets/blip/st_blip_0.ogg,1,1,false),
Shizuka: (5,1,1,0,0,100,30,file,assets/blip/st_blip_0.ogg,1,1,false),
index.js line 18 > srcScript:804:13
<Blip extension>  getting blip assets index.js line 18 > srcScript:1208:13
<Blip extension>  UDPATING char list 
Array []
index.js line 18 > srcScript:1437:13
<Blip extension>  UDPATING char list index.js line 18 > srcScript:1439:17
<Blip extension>  Finish loaded. index.js line 18 > srcScript:1433:13
Event emitted: undefined eventemitter.js:101:17
returning full samplers array samplerSelect.js:310:17
Event emitted: settings_loaded eventemitter.js:101:17
<Blip extension>  Found assets: 
Object { ambient: (11) […], bgm: (14) […], blip: (3) […], character: [], live2d: [], vrm: {…} }
index.js line 18 > srcScript:1216:17
<Blip extension>  updated blip assets to 
Array(3) [ "assets/blip/st_blip_0.ogg", "assets/blip/st_blip_1.ogg", "assets/blip/st_blip_2.ogg" ]
index.js line 18 > srcScript:1315:13
[QR2] sets:  
Array [ {…}, {…} ]
index.js line 18 > srcScript:17:51
[QR2] settings:  
Object { isEnabled: false, isCombined: false, isPopout: true, config: {…}, _chatConfig: {…}, onSave: onSave(), onRequestEditSet: onRequestEditSet(qrs) }
index.js line 18 > srcScript:17:51
Event emitted: character_page_loaded eventemitter.js:101:17
Chat Completions: loading token cache tokenizers.js:115:17
Registering preset manager for API: kobold preset-manager.js:91:21
Registering preset manager for API: novel preset-manager.js:91:21
Registering preset manager for API: openai preset-manager.js:91:21
Registering preset manager for API: textgenerationwebui preset-manager.js:91:21
Registering preset manager for API: context preset-manager.js:91:21
Registering preset manager for API: instruct preset-manager.js:91:21
setting pin class via checkbox state RossAscends-mods.js:815:17
setting pin class via checkbox state RossAscends-mods.js:825:17
LoadLocal -- userInput f-localStorage.js:8:13
Event emitted: app_ready eventemitter.js:101:17
[QR2] executing startup index.js line 18 > srcScript:17:51
[QR2] /executing startup index.js line 18 > srcScript:17:51
[QR2] executing queue (0 items) index.js line 18 > srcScript:17:51
[QR2] /executing queue index.js line 18 > srcScript:17:51
[QR2] READY index.js line 18 > srcScript:17:51
SaveLocal -- NavOpened : true f-localStorage.js:5:13
RA -- clicking left nav to open RossAscends-mods.js:407:21
SaveLocal -- LNavOpened : true f-localStorage.js:5:13
This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://firefox-source-docs.mozilla.org/performance/scroll-linked_effects.html for further details and to join the discussion on related tools and features! 127.0.0.1:8000
<Blip extension>  UDPATING char list index.js line 18 > srcScript:1439:17
<Blip extension>  Chat members 
Array [ "User", "SillyTavern System" ]
index.js line 18 > srcScript:1264:17
<Blip extension>  Updated character list to: 
Array [ "User", "SillyTavern System" ]
index.js line 18 > srcScript:1298:17
Event emitted: settings_updated eventemitter.js:101:17
saw no avatars script.js:1717:22
getRegexedString: Skipping script COT HIDE, LEAVE TEXT, DELETE SENT PROMPT because depth 2 is less than minDepth 3 engine.js:57:29
getRegexedString: Skipping script COT HIDE, LEAVE TEXT, DELETE SENT PROMPT because depth 1 is less than minDepth 3 engine.js:57:29
getRegexedString: Skipping script COT HIDE, LEAVE TEXT, DELETE SENT PROMPT because depth 0 is less than minDepth 3 engine.js:57:29
Event emitted: chat_id_changed eventemitter.js:101:17
Summary set to:  Position: 0 Depth: 2 Role: 0 index.js line 18 > srcScript:807:13
getting sprites list index.js:1212:13
<Blip extension>  Chat members 
Array [ "User", "Claude" ]
index.js line 18 > srcScript:1264:17
<Blip extension>  Moving to top Claude index.js line 18 > srcScript:1270:25
<Blip extension>  Updated character list to: 
Array [ "User", "Claude" ]
index.js line 18 > srcScript:1298:17
[QR2] calling 
Object { functionToCall: async onChatChanged(chatIdx), args: (1) […] }
index.js line 18 > srcScript:17:51
[QR2] CHAT_CHANGED Claude - 2024-5-20@01h51m43s index.js line 18 > srcScript:17:51
Preset already selected for API: openai, name: Claude preset-manager.js:57:17

    setFloatingPrompt entered
    ------
    lastMessageNumber = 16
    metadata_keys.interval = 1
    metadata_keys.position = 1
    metadata_keys.depth = 4
    metadata_keys.role = 0
    ------
    authors-note.js:295:13
Using locked persona 1715505357473-Blank.png personas.js:762:17
Invalid URI. Load of media resource  failed. 127.0.0.1:8000
Event emitted: chatLoaded eventemitter.js:101:17
entered setExpressions index.js:1325:17
checking for expression images to show.. index.js:1332:17
setting default index.js:1426:21
Event emitted: settings_updated eventemitter.js:101:17
Generate entered script.js:3095:13
Event emitted: generation_started eventemitter.js:101:17
getRegexedString: Skipping script COT HIDE, LEAVE TEXT, DELETE SENT PROMPT because depth 2 is less than minDepth 3 engine.js:57:29
getRegexedString: Skipping script COT HIDE, LEAVE TEXT, DELETE SENT PROMPT because depth 1 is less than minDepth 3 engine.js:57:29
getRegexedString: Skipping script COT HIDE, LEAVE TEXT, DELETE SENT PROMPT because depth 0 is less than minDepth 3 engine.js:57:29
Skipping extension interceptors for dry run script.js:3334:17
Core/all messages: 33/33 script.js:3352:13

    setFloatingPrompt entered
    ------
    lastMessageNumber = 16
    metadata_keys.interval = 1
    metadata_keys.position = 1
    metadata_keys.depth = 4
    metadata_keys.role = 0
    ------
    authors-note.js:295:13
Context size: 49000; WI budget: 12250 (max% = 25%, cap = 0) world-info.js:2776:13
Global world info has 0 entries world-info.js:2675:13
Character Claude's base world could not be found or is empty! Skipping... world-info.js:2631:17
Sorted 0 world lore entries using strategy 1 world-info.js:2727:17
skipWIAN not active, adding WIAN script.js:3426:17
calling runGenerate script.js:3675:13
generating prompt script.js:3695:17
---calling setPromptString 0 script.js:3851:17
SaveLocal -- userInput : / f-localStorage.js:5:13
SaveLocal -- userInput : /snap f-localStorage.js:5:13
SaveLocal -- userInput : /snapshot f-localStorage.js:5:13
Generate entered script.js:3095:13
Event emitted: generation_started eventemitter.js:101:17
SaveLocal -- userInput : f-localStorage.js:5:13
**Error capturing chat log: 
error { target: img, isTrusted: true, srcElement: img, eventPhase: 0, bubbles: false, cancelable: false, returnValue: true, defaultPrevented: false, composed: false, timeStamp: 22186, … }**
index.js:157:17
expressions: SillyTavern is now hidden index.js:1909:21
expressions: SillyTavern is now visible index.js:1912:21
SaveLocal -- userInput : / f-localStorage.js:5:13
SaveLocal -- userInput : /snapshot f-localStorage.js:5:13
Generate entered script.js:3095:13
Event emitted: generation_started eventemitter.js:101:17
SaveLocal -- userInput : f-localStorage.js:5:13
**Error capturing chat log: 
error { target: img, isTrusted: true, srcElement: img, eventPhase: 0, bubbles: false, cancelable: false, returnValue: true, defaultPrevented: false, composed: false, timeStamp: 180703, … }
index.js:157:17
    captureChatLog http://127.0.0.1:8000/scripts/extensions/third-party/STExtension-Snapshot/index.js:157**
expressions: SillyTavern is now hidden index.js:1909:21
expressions: SillyTavern is now visible index.js:1912:21
expressions: SillyTavern is now hidden index.js:1909:21
expressions: SillyTavern is now visible index.js:1912:21
expressions: SillyTavern is now hidden index.js:1909:21
TheZennou commented 4 months ago

I'm surprised this never came up in my firefox testing, I always used a short log. I'm pretty sure this is related to blob nonsense, should be fixable. Will push a fix with the latest version. Also, make sure you're on the latest ST.

Edit: Wow, this is a very complex issue. I might have to completely refactor the extension... Edit2: I'll have to refactor the entire code...

TheZennou commented 4 months ago

Fixed. https://github.com/TheZennou/STExtension-Snapshot/commit/6ca8e1393b2186b9e2ed35ce2da7ad63f61a2d7f

JomoJauhri commented 4 months ago

Thanks for the hard works! Works perfectly now with the latest ST.