DinoDevs / GladiatusCrazyAddon

This was "A browser addon for the Gladiatus browser game."
https://gladiatus.dinodevs.com
GNU General Public License v3.0
41 stars 30 forks source link

Closing the chat breaks the addon (cookie fail) #415

Closed FrutyX closed 1 year ago

FrutyX commented 2 years ago

How to reproduce: You open the chat, and you close it, after closing it the addon will get broken, but thankfully, once you refresh the page, GCA will be back again.

overview.js?4.3.6&built=1662039112112:124 Uncaught TypeError: Cannot read properties of null (reading 'substring')
    at Object.updateData (overview.js?4.3.6&built=1662039112112:124:57)
    at Object.inject (overview.js?4.3.6&built=1662039112112:17:8)
    at fireLoad (overview.js?4.3.6&built=1662039112112:1847:16)

gcabug

Conclusion: The URL after closing the chat is https://s51-en.gladiatus.gameforge.com/game/index.php?mod=overview, it does not have an sh=.

FrutyX commented 1 year ago

Thanos, isn't this an easy fix? For you, I mean.

Basically if GCA detects that are is no sh= you could try to redirect it to a valid URL with sh=, this would work even for everything else, not only the chat (be warned that if you have the chat opened, all pages does not contain an sh=, but the addon still works).

Another approach would be to catch the "substring" null error and redirect you to a valid URL, however I was unable to catch the error, I am kinda too short for these fixes, but from what I saw, it should be a child's play for Thanos.

FrutyX commented 1 year ago

Ah! Finally someone capable, I was missing you, Apo 😄

FrutyX commented 1 year ago

Hm, I was testing it before, but today, when I tried it, GCA again broke and:

overview.js?4.3.8&built=1663957221750:138 Failed to detect player's id.

FrutyX commented 1 year ago

Idea: Without touching the detection, you could modify the href attribute of the close chat icon by it's class chat_icon_disable and when it's clicked, it redirects you to a valid URL link with an sh=.

I was trying it, but in the end, I had some troubles, nothing you wouldn't handle.

FrutyX commented 1 year ago

Not breaking the addon anymore, thanks to Thanos, closing.