Skip to content

Commit

Permalink
feat(scripting): module.onBeforeApplicationLoad
Browse files Browse the repository at this point in the history
  • Loading branch information
rhunk committed Dec 5, 2023
1 parent 35016b5 commit 440c35e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class SnapEnhance {
bridgeClient.registerMessagingBridge(messagingBridge)
features.init()
scriptRuntime.connect(bridgeClient.getScriptingInterface())
scriptRuntime.eachModule { callFunction("module.onBeforeApplicationLoad", androidContext) }
syncRemote()
}
}
Expand Down

0 comments on commit 440c35e

Please sign in to comment.