std::string appid = runtime_cmd->GetAppIdFromCommandLine("/usr/bin/electron");
auto appdata_manager = common::ApplicationDataManager::GetInstance();
common::ApplicationData* app_data = appdata_manager->GetApplicationData(appid);
- std::string app_path = "file://" + app_data->application_path() + "index.html";
+ std::string app_path = "file://" + app_data->application_path() + app_data->content_src();
return app_path;
}
+bool PWRT::isTizenWebApp() {
+ LOG(INFO) << "PWRT::isTizenWebApp";
+ common::CommandLine* runtime_cmd = common::CommandLine::ForCurrentProcess();
+ std::string appid = runtime_cmd->GetAppIdFromCommandLine("/usr/bin/electron");
+ if (appid != "electron") { // TODO: Any better distinguishing feature?
+ return true;
+ } else {
+ return false;
+ }
+}
+
// static
mate::Handle<PWRT> PWRT::Create(v8::Isolate* isolate) {
LOG(INFO) << "PWRT::Create";
// TODO: Needs adding necessary interface methods
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("getMessage", &PWRT::GetMessage)
- .SetMethod("getPath", &PWRT::GetPath);
+ .SetMethod("getPath", &PWRT::GetPath)
+ .SetMethod("isTizenWebApp", &PWRT::isTizenWebApp);
}
} // namespace api
const std::string application_path() const { return application_path_; }
const std::string pkg_id() const;
const std::string app_id() const { return app_id_; }
+ const std::string content_src() { return (content_info_.get())->src(); }
ApplicationData::AppType app_type() { return app_type_; }
private:
path_debug('Check runType');
break;
}
+ let {pwrt} = require('electron');
+ if (pwrt.isTizenWebApp()) {
+ packageRealPath = pwrt.getPath();
+ }
args['packageRealPath'] = packageRealPath;
if (args.windowSize) {