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

Commit

Permalink
Don't execute script for Dapp detection after being dismissed
Browse files Browse the repository at this point in the history
Fix #11537
  • Loading branch information
kjozwiak authored and bbondy committed Oct 15, 2017
1 parent 24b6cb9 commit b3f61ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/browser/reducers/dappReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getSetting = require('../../../js/settings').getSetting
const tabActions = require('../../common/actions/tabActions')
const tabState = require('../../common/state/tabState')
const config = require('../../../js/constants/config')
const {getOrigin} = require('../../../js/lib/urlutil')
const {getOrigin} = require('../../../js/state/siteUtil')

let notificationCallbacks = []

Expand Down
5 changes: 4 additions & 1 deletion app/extensions/brave/content/scripts/dappListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ const script =
})
}`

executeScript(script)
if (chrome.contentSettings.dappDetection == 'allow') {
executeScript(script)
}

setTimeout(function () {
console.log('checking now for toolbar')
const isDapp = document.querySelector('meta[name="web3-installed"]')
Expand Down
4 changes: 4 additions & 0 deletions js/state/contentSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ const getDefaultUserPrefContentSettings = (braveryDefaults, appSettings, appConf
setting: 'block',
primaryPattern: '*'
}],
dappDetection: [{
setting: getSetting(settings.METAMASK_PROMPT_DISMISSED) ? 'block' : 'allow',
primaryPattern: '*'
}],
popups: [{
setting: 'block',
primaryPattern: '*'
Expand Down

0 comments on commit b3f61ee

Please sign in to comment.