Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Use noScript state per site instead of blocking scripts #3205

Merged
merged 1 commit into from
Aug 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion js/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ class Main extends ImmutableComponent {
enableNoScript={this.enableNoScript(activeSiteSettings)}
settings={this.props.appState.get('settings')}
noScriptIsVisible={noScriptIsVisible}
blockedScripts={activeFrame && activeFrame.getIn(['noScript', 'blocked'])}
/>
{
siteInfoIsVisible
Expand Down
2 changes: 1 addition & 1 deletion js/components/navigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class NavigationBar extends ImmutableComponent {
endLoadTime={this.props.endLoadTime}
titleMode={this.titleMode}
urlbar={this.props.navbar.get('urlbar')}
isBlockingScripts={this.props.blockedScripts && this.props.blockedScripts.size > 0}
enableNoScript={this.props.enableNoScript}
/>
{
isSourceAboutUrl(this.props.location)
Expand Down
5 changes: 3 additions & 2 deletions js/components/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ class UrlBar extends ImmutableComponent {
location = location.replace(replaceRE, '')
searchUrl = this.searchSelectEntry.search.replace('{searchTerms}', encodeURIComponent(location))
}

if ((defaultEngine === 'DuckDuckGo' ||
(this.searchSelectEntry && this.searchSelectEntry.name === 'DuckDuckGo')) &&
this.props.isBlockingScripts) {
this.props.enableNoScript) {
searchUrl = searchUrl.replace('?q=', 'html?q=')
}
location = isLocationUrl ? location : searchUrl
Expand Down Expand Up @@ -462,7 +463,7 @@ class UrlBar extends ImmutableComponent {
urlPreview={this.props.urlbar.get('urlPreview')}
searchSelectEntry={this.searchSelectEntry}
previewActiveIndex={this.props.previewActiveIndex || 0}
isBlockingScripts={this.props.isBlockingScripts} />
enableNoScript={this.props.enableNoScript} />
: null
}
</form>
Expand Down
2 changes: 1 addition & 1 deletion js/components/urlBarSuggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class UrlBarSuggestions extends ImmutableComponent {
let searchURL = this.props.searchSelectEntry
? this.props.searchSelectEntry.search : this.props.searchDetail.get('searchURL')
if (getSetting(settings.DEFAULT_SEARCH_ENGINE) === 'DuckDuckGo' &&
this.props.isBlockingScripts) {
this.props.enableNoScript) {
searchURL = searchURL.replace('?q=', 'html?q=')
}
return searchURL.replace('{searchTerms}', encodeURIComponent(searchTerms))
Expand Down