autodetection of newgrounds.com login

This commit is contained in:
Haze Weathers 2023-10-13 18:17:52 -04:00
parent 5610401840
commit a415f4158a

View file

@ -66,6 +66,14 @@ func load_saved_session() -> bool:
if err != OK:
session = EMPTY_SESSION
session.id = ini.get_value("ngio", "session_id", "")
#const url = new URL(location.href);
#this.session_id = url.searchParams.get('ngio_session_id');
if OS.has_feature('JavaScript'):
var sp_session = JavaScript.eval("""
new URL(window.location.href).searchParams.get('ngio_session_id')
""")
if sp_session != null:
session.id = sp_session
# check session is valid
var response = yield(request_execute("App.checkSession"), "completed")
if has_result(response):