diff --git a/doric-Qt/example/doric/plugin/DoricNavigatorPlugin.cpp b/doric-Qt/example/doric/plugin/DoricNavigatorPlugin.cpp index 7f5b23e2..df7546a4 100644 --- a/doric-Qt/example/doric/plugin/DoricNavigatorPlugin.cpp +++ b/doric-Qt/example/doric/plugin/DoricNavigatorPlugin.cpp @@ -5,6 +5,7 @@ #include "loader/DoricJSLoaderManager.h" #include "utils/DoricUtils.h" +#include #include #include #include @@ -108,4 +109,15 @@ void DoricNavigatorPlugin::popToRoot(QString jsValueString, DoricThreadMode::JS); } -void DoricNavigatorPlugin::openUrl(QString jsValueString, QString callbackId) {} +void DoricNavigatorPlugin::openUrl(QString jsValueString, QString callbackId) { + getContext()->getDriver()->asyncCall( + [jsValueString] { QDesktopServices::openUrl(QUrl(jsValueString)); }, + DoricThreadMode::UI); + + getContext()->getDriver()->asyncCall( + [this, callbackId] { + QVariantList args; + DoricPromise::resolve(getContext(), callbackId, args); + }, + DoricThreadMode::JS); +}