Skip to content

Commit

Permalink
Removes non-primitive props from Frame
Browse files Browse the repository at this point in the history
Resolves brave#9760

Auditors: @bridiver @bsclifton

Test Plan:
  • Loading branch information
NejcZdovc committed Jun 28, 2017
1 parent 22c07e6 commit a752c33
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions app/renderer/components/frame/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,6 @@ class Frame extends React.Component {
windowActions.closeFrame(this.props.frameKey)
}

getFrameBraverySettings (props) {
props = props || this.props
const frameSiteSettings =
siteSettings.getSiteSettingsForURL(props.allSiteSettings, props.location)
return Immutable.fromJS(siteSettings.activeSettings(frameSiteSettings,
appStoreRenderer.state,
appConfig))
}

isAboutPage () {
return aboutUrls.get(getBaseUrl(this.props.location))
}
Expand Down Expand Up @@ -611,7 +602,7 @@ class Frame extends React.Component {
}
if (e.isMainFrame && !e.isErrorPage && !e.isFrameSrcDoc) {
if (e.url && e.url.startsWith(appConfig.noScript.twitterRedirectUrl) &&
this.getFrameBraverySettings(this.props).get('noScript') === true) {
this.props.frameBraveryNoScript === true) {
// This result will be canceled immediately by sitehacks, so don't
// update the load state; otherwise it will not show the security
// icon.
Expand Down Expand Up @@ -895,6 +886,7 @@ class Frame extends React.Component {
const contextMenu = currentWindow.get('contextMenuDetail')
const tabId = frame.get('tabId')
const tab = tabId && tabId > -1 && tabState.getByTabId(state, tabId)
const frameBraverySettings = siteSettings.activeSettings(frameSiteSettings, state, appConfig)

const props = {}
// used in renderer
Expand Down Expand Up @@ -936,6 +928,7 @@ class Frame extends React.Component {
props.allSiteSettings = allSiteSettings // TODO (nejc) can be improved even more
props.tabUrl = tab && tab.get('url')
props.partitionNumber = frame.get('partitionNumber')
props.frameBraveryNoScript = frameBraverySettings.noScript

return props
}
Expand Down

0 comments on commit a752c33

Please sign in to comment.