Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/JavaScriptContextBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class JavaScriptContextBase:public IJavaScriptContext, public JavaScriptKeyListe
virtual bool runScript(const char *script, bool isModule=true, std::string name="", const char *args = nullptr, bool isApplication=false);
virtual bool runFile(const char *file, const char* args, bool isApplication=false);
std::string getUrl();
std::string setUrl(std::string url);
virtual void onKeyPress(struct JavaScriptKeyDetails& details);
virtual void onKeyRelease(struct JavaScriptKeyDetails& details);
ModuleSettings getModuleSettings();
Expand Down
5 changes: 5 additions & 0 deletions src/JavaScriptContextBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ std::string JavaScriptContextBase::getUrl()
return mApplicationUrl;
}

std::string JavaScriptContextBasr::setUrl(std::string url)
{
mApplicationUrl = url;
}

void JavaScriptContextBase::onKeyPress(struct JavaScriptKeyDetails& details)
{
processKeyEvent(details, true);
Expand Down
4 changes: 3 additions & 1 deletion src/NativeJSRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ void NativeJSRenderer::runApplicationInternal(ApplicationRequest& appRequest)
return ;
}
JavaScriptContext* context = (JavaScriptContext*)mContextMap[id].context;
context->setUrl(mContext[id].url);
if(context->getModuleSettings().enableJSDOM)
{
std::stringstream window;
Expand All @@ -344,7 +345,8 @@ void NativeJSRenderer::runApplicationInternal(ApplicationRequest& appRequest)
{
NativeJSLogger::log(INFO, "About to launch local app\n");
JavaScriptContext* context = (JavaScriptContext*)mContextMap[id].context;
if(context->getModuleSettings().enableJSDOM)
context->setUrl(mContext[id].url);
if(context->getModuleSettings().enableJSDOM)
{
std::stringstream window;
window<<"window.location = {\"href\":\"file:/" << url << "\"};";
Expand Down
3 changes: 2 additions & 1 deletion src/jsc/JavaScriptUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ class rtHttpRequestEx : public rtHttpRequest
metrics->method = this->method();
std::vector<rtString> headerValues = this->headers();
metrics->headers = headerValues;

metrics->statusCode = downloadRequest->httpStatusCode();

rtObjectRef timeMetrics = downloadRequest->downloadMetrics();
rtValue keys;
if (timeMetrics->Get("allKeys", &keys) == RT_OK) {
Expand Down
Loading