History

BUGZ-1365: Ensure that by default web views can't access local content

Brad Davis committed 7 years ago

Commit 428a5871 parent 36be00b9 files · +41 −19Browse files

Showing the changes to interface/src/scripting/DesktopScriptingInterface.cpp (1 of 9 files). Show all

Unified · Split

interface/src/scripting/DesktopScriptingInterface.cpp+5−2
@@ -52,6 +52,9 @@ static const QVariantMap DOCK_AREA { · 51 unmodified lines
5252 { "RIGHT", DockArea::RIGHT }
5353 };
5454
55+DesktopScriptingInterface::DesktopScriptingInterface(QObject* parent, bool restricted)
56+ : QObject(parent), _restricted(restricted) { }
57+
5558 int DesktopScriptingInterface::getWidth() {
5659 QSize size = qApp->getWindow()->windowHandle()->screen()->virtualSize();
5760 return size.width();
@@ -128,7 +131,7 @@ InteractiveWindowPointer DesktopScriptingInterface::createWindow(const QString& · 70 unmodified lines
128131 return nullptr;
129132 }
130133
131− return new InteractiveWindow(sourceUrl, properties);
134+ return new InteractiveWindow(sourceUrl, properties, _restricted);
132135 }
133136
134137 InteractiveWindowPointer DesktopScriptingInterface::createWindowOnThread(const QString& sourceUrl, const QVariantMap& properties, QThread* targetThread) {
@@ -139,7 +142,7 @@ InteractiveWindowPointer DesktopScriptingInterface::createWindowOnThread(const Q · 4 unmodified lines
139142 if (!urlValidator(sourceUrl)) {
140143 return nullptr;
141144 }
142− InteractiveWindowPointer window = new InteractiveWindow(sourceUrl, properties);
145+ InteractiveWindowPointer window = new InteractiveWindow(sourceUrl, properties, _restricted);
143146 window->moveToThread(targetThread);
144147 return window;
145148 }