-
Notifications
You must be signed in to change notification settings - Fork 794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable JavaScript only when Info.plist specifies isJavaScriptEnabled #1003
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks! Just some nitpicking.
src/libs/ui/widgets/webviewtab.cpp
Outdated
@@ -70,6 +70,11 @@ void WebViewTab::setZoomLevel(int level) | |||
m_webView->setZoomLevel(level); | |||
} | |||
|
|||
void WebViewTab::setJavaScriptEnabled(bool isJavaScriptEnabled) | |||
{ | |||
this->m_webView->page()->settings()->setAttribute(QWebSettings::JavascriptEnabled, isJavaScriptEnabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need in this->
, it's C++ :)
src/libs/registry/docset.cpp
Outdated
@@ -163,6 +163,10 @@ Docset::Docset(const QString &path) : | |||
} | |||
} | |||
|
|||
// Set if javascript enabled | |||
if (plist.contains(InfoPlist::IsJavaScriptEnabled)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add curly brackets, I know they are still missing in many places, but I am trying to add them everywhere now.
src/libs/registry/docset.cpp
Outdated
@@ -163,6 +163,10 @@ Docset::Docset(const QString &path) : | |||
} | |||
} | |||
|
|||
// Set if javascript enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need in this comment, the block of code is pretty much self-explanatory.
src/libs/ui/widgets/webviewtab.h
Outdated
@@ -52,6 +52,7 @@ class WebViewTab : public QWidget | |||
|
|||
int zoomLevel() const; | |||
void setZoomLevel(int level); | |||
void setJavaScriptEnabled(bool isJavaScriptEnabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool enabled
src/libs/ui/widgets/webviewtab.cpp
Outdated
@@ -70,6 +70,11 @@ void WebViewTab::setZoomLevel(int level) | |||
m_webView->setZoomLevel(level); | |||
} | |||
|
|||
void WebViewTab::setJavaScriptEnabled(bool isJavaScriptEnabled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool enabled
to follow the convention around the code.
Merged, thank you! |
Follow up to #999
Implement
isJavaScriptEnabled
throughInfo.plist