History

Merge pull request #9938 from kunalgosar/jsRenderBug

Stop WebEntities Running Files and Commands

Seth Alves committed 9 years ago

Commit 03065ee2 parents b9c7d63 874942812 files · +237 −28Browse files

Showing the changes to interface/src/Application.cpp (1 of 12 files). Show all

Unified · Split

interface/src/Application.cpp+9−2
@@ -142,6 +142,7 @@ · 141 unmodified lines
142#include "ModelPackager.h"142#include "ModelPackager.h"
143#include "networking/HFWebEngineProfile.h"143#include "networking/HFWebEngineProfile.h"
144#include "networking/HFTabletWebEngineProfile.h"144#include "networking/HFTabletWebEngineProfile.h"
145#include "networking/FileTypeProfile.h"
145#include "scripting/TestScriptingInterface.h"146#include "scripting/TestScriptingInterface.h"
146#include "scripting/AccountScriptingInterface.h"147#include "scripting/AccountScriptingInterface.h"
147#include "scripting/AssetMappingsScriptingInterface.h"148#include "scripting/AssetMappingsScriptingInterface.h"
@@ -218,6 +219,7 @@ static const QString FST_EXTENSION = ".fst"; · 70 unmodified lines
218static const QString FBX_EXTENSION = ".fbx";219static const QString FBX_EXTENSION = ".fbx";
219static const QString OBJ_EXTENSION = ".obj";220static const QString OBJ_EXTENSION = ".obj";
220static const QString AVA_JSON_EXTENSION = ".ava.json";221static const QString AVA_JSON_EXTENSION = ".ava.json";
222static const QString WEB_VIEW_TAG = "noDownload=true";
221 223
222static const float MIRROR_FULLSCREEN_DISTANCE = 0.389f;224static const float MIRROR_FULLSCREEN_DISTANCE = 0.389f;
223 225
@@ -1934,6 +1936,7 @@ void Application::initializeUi() { · 1710 unmodified lines
1934 1936
1935 qmlRegisterType<HFWebEngineProfile>("HFWebEngineProfile", 1, 0, "HFWebEngineProfile");1937 qmlRegisterType<HFWebEngineProfile>("HFWebEngineProfile", 1, 0, "HFWebEngineProfile");
1936 qmlRegisterType<HFTabletWebEngineProfile>("HFTabletWebEngineProfile", 1, 0, "HFTabletWebEngineProfile");1938 qmlRegisterType<HFTabletWebEngineProfile>("HFTabletWebEngineProfile", 1, 0, "HFTabletWebEngineProfile");
1939 qmlRegisterType<FileTypeProfile>("FileTypeProfile", 1, 0, "FileTypeProfile");
1937 1940
1938 auto offscreenUi = DependencyManager::get<OffscreenUi>();1941 auto offscreenUi = DependencyManager::get<OffscreenUi>();
1939 offscreenUi->create(_glWidget->qglContext());1942 offscreenUi->create(_glWidget->qglContext());
@@ -5545,7 +5548,9 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 3605 unmodified lines
5545 5548
5546bool Application::canAcceptURL(const QString& urlString) const {5549bool Application::canAcceptURL(const QString& urlString) const {
5547 QUrl url(urlString);5550 QUrl url(urlString);
5548 if (urlString.startsWith(HIFI_URL_SCHEME)) {5551 if (url.query().contains(WEB_VIEW_TAG)) {
5552 return false;
5553 } else if (urlString.startsWith(HIFI_URL_SCHEME)) {
5549 return true;5554 return true;
5550 }5555 }
5551 QHashIterator<QString, AcceptURLMethod> i(_acceptedExtensions);5556 QHashIterator<QString, AcceptURLMethod> i(_acceptedExtensions);
@@ -5653,7 +5658,9 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) { · 101 unmodified lines
5653 QUrl scriptURL { scriptFilenameOrURL };5658 QUrl scriptURL { scriptFilenameOrURL };
5654 5659
5655 if (scriptURL.host().endsWith(MARKETPLACE_CDN_HOSTNAME)) {5660 if (scriptURL.host().endsWith(MARKETPLACE_CDN_HOSTNAME)) {
5656 shortName = shortName.mid(shortName.lastIndexOf('/') + 1);5661 int startIndex = shortName.lastIndexOf('/') + 1;
5662 int endIndex = shortName.lastIndexOf('?');
5663 shortName = shortName.mid(startIndex, endIndex - startIndex);
5657 }5664 }
5658 5665
5659 QString message = "Would you like to run this script:\n" + shortName;5666 QString message = "Would you like to run this script:\n" + shortName;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t