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

Removes non-primitive props from Frame #9762

Closed
wants to merge 1 commit into from
Closed
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
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