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

Commit

Permalink
Merge pull request #3205 from darkdh/3189
Browse files Browse the repository at this point in the history
Use noScript state per site instead of blocking scripts
  • Loading branch information
bbondy committed Aug 16, 2016
2 parents 0304281 + fb9709c commit cf76ac5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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

0 comments on commit cf76ac5

Please sign in to comment.