feat(scripting): module.onBeforeApplicationLoad
This commit is contained in:
@@ -135,7 +135,11 @@ class JSModule(
|
||||
obj.get(key, obj) as? ScriptableObject ?: return@contextScope
|
||||
}.get(split.last(), moduleObject) as? Function ?: return@contextScope
|
||||
|
||||
function.call(this, moduleObject, moduleObject, args)
|
||||
runCatching {
|
||||
function.call(this, moduleObject, moduleObject, args)
|
||||
}.onFailure {
|
||||
scriptRuntime.logger.error("Error while calling function $name", it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@ class SnapEnhance {
|
||||
bridgeClient.registerMessagingBridge(messagingBridge)
|
||||
features.init()
|
||||
scriptRuntime.connect(bridgeClient.getScriptingInterface())
|
||||
scriptRuntime.eachModule { callFunction("module.onBeforeApplicationLoad", androidContext) }
|
||||
syncRemote()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user