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
142142 #include "ModelPackager.h"
143143 #include "networking/HFWebEngineProfile.h"
144144 #include "networking/HFTabletWebEngineProfile.h"
145+#include "networking/FileTypeProfile.h"
145146 #include "scripting/TestScriptingInterface.h"
146147 #include "scripting/AccountScriptingInterface.h"
147148 #include "scripting/AssetMappingsScriptingInterface.h"
@@ -218,6 +219,7 @@ static const QString FST_EXTENSION = ".fst"; · 70 unmodified lines
218219 static const QString FBX_EXTENSION = ".fbx";
219220 static const QString OBJ_EXTENSION = ".obj";
220221 static const QString AVA_JSON_EXTENSION = ".ava.json";
222+static const QString WEB_VIEW_TAG = "noDownload=true";
221223
222224 static const float MIRROR_FULLSCREEN_DISTANCE = 0.389f;
223225
@@ -1934,6 +1936,7 @@ void Application::initializeUi() { · 1710 unmodified lines
19341936
19351937 qmlRegisterType<HFWebEngineProfile>("HFWebEngineProfile", 1, 0, "HFWebEngineProfile");
19361938 qmlRegisterType<HFTabletWebEngineProfile>("HFTabletWebEngineProfile", 1, 0, "HFTabletWebEngineProfile");
1939+ qmlRegisterType<FileTypeProfile>("FileTypeProfile", 1, 0, "FileTypeProfile");
19371940
19381941 auto offscreenUi = DependencyManager::get<OffscreenUi>();
19391942 offscreenUi->create(_glWidget->qglContext());
@@ -5545,7 +5548,9 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 3605 unmodified lines
55455548
55465549 bool Application::canAcceptURL(const QString& urlString) const {
55475550 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)) {
55495554 return true;
55505555 }
55515556 QHashIterator<QString, AcceptURLMethod> i(_acceptedExtensions);
@@ -5653,7 +5658,9 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) { · 101 unmodified lines
56535658 QUrl scriptURL { scriptFilenameOrURL };
56545659
56555660 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);
56575664 }
56585665
56595666 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