Skip to content
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

Merged
merged 4 commits into from
Oct 7, 2018

Conversation

nishanthkarthik
Copy link
Contributor

Follow up to #999

Implement isJavaScriptEnabled through Info.plist

Copy link
Member

@trollixx trollixx left a 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.

@@ -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);
Copy link
Member

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++ :)

@@ -163,6 +163,10 @@ Docset::Docset(const QString &path) :
}
}

// Set if javascript enabled
if (plist.contains(InfoPlist::IsJavaScriptEnabled))
Copy link
Member

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.

@@ -163,6 +163,10 @@ Docset::Docset(const QString &path) :
}
}

// Set if javascript enabled
Copy link
Member

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.

@@ -52,6 +52,7 @@ class WebViewTab : public QWidget

int zoomLevel() const;
void setZoomLevel(int level);
void setJavaScriptEnabled(bool isJavaScriptEnabled);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool enabled

@@ -70,6 +70,11 @@ void WebViewTab::setZoomLevel(int level)
m_webView->setZoomLevel(level);
}

void WebViewTab::setJavaScriptEnabled(bool isJavaScriptEnabled)
Copy link
Member

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.

@trollixx trollixx merged commit 8bfacd7 into zealdocs:master Oct 7, 2018
@trollixx trollixx added this to the 0.7.0 milestone Oct 7, 2018
@trollixx
Copy link
Member

trollixx commented Oct 7, 2018

Merged, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants