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

Commit

Permalink
Work continues
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Apr 14, 2017
1 parent 8e9ab78 commit f29bc26
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ class Frame extends ImmutableComponent {
if (!this.props.allSiteSettings) {
return false
}
const activeSiteSettings = siteSettings.getSiteSettingsForHostPattern(this.props.allSiteSettings,
origin)
const activeSiteSettings = siteSettings.getSiteSettingsForHostPattern(this.props.allSiteSettings, origin)
if (activeSiteSettings && typeof activeSiteSettings.get('widevine') === 'number') {
return true
}
Expand All @@ -144,8 +143,7 @@ class Frame extends ImmutableComponent {
expireContentSettings (origin) {
// Expired Flash settings should be deleted when the webview is
// navigated or closed. Same for NoScript's allow-once option.
const activeSiteSettings = siteSettings.getSiteSettingsForHostPattern(this.props.allSiteSettings,
origin)
const activeSiteSettings = siteSettings.getSiteSettingsForHostPattern(this.props.allSiteSettings, origin)
if (!activeSiteSettings) {
return
}
Expand Down Expand Up @@ -174,12 +172,12 @@ class Frame extends ImmutableComponent {
updateWebview (cb, prevProps, newSrc) {
// lazy load webview
if (!this.webview && !this.props.isActive && !this.props.isPreview &&
// allow force loading of new frames
this.props.unloaded === true &&
// don't lazy load about pages
!aboutUrls.get(getBaseUrl(this.props.src)) &&
// pinned tabs don't serialize their state so the icon is lost for lazy loading
!this.props.pinnedLocation) {
// allow force loading of new frames
this.props.unloaded === true &&
// don't lazy load about pages
!aboutUrls.get(getBaseUrl(this.props.src)) &&
// pinned tabs don't serialize their state so the icon is lost for lazy loading
!this.props.pinnedLocation) {
return
}

Expand Down Expand Up @@ -313,7 +311,7 @@ class Frame extends ImmutableComponent {
// make sure the webview content updates to
// match the fullscreen state of the frame
if (prevProps.isFullScreen !== this.props.isFullScreen ||
(this.props.isFullScreen && !this.props.isActive)) {
(this.props.isFullScreen && !this.props.isActive)) {
if (this.props.isFullScreen && this.props.isActive) {
this.enterHtmlFullScreen()
} else {
Expand Down Expand Up @@ -1043,7 +1041,8 @@ class Frame extends ImmutableComponent {
? siteSettings.getSiteSettingsForURL(allSiteSettings, frame.get('location'))
: undefined
const contextMenu = currentWindow.get('contextMenuDetail')
const tab = tabState.getTabIndexByTabId(state, frame.tabId)
const tabId = frame.get('tabId')
const tab = tabId && tabId > -1 && tabState.getByTabId(state, tabId)

const props = {}
// used in renderer
Expand All @@ -1055,7 +1054,7 @@ class Frame extends ImmutableComponent {
props.location = frame.get('location')
props.hrefPreview = frame.get('hrefPreview')
props.showOnRight = frame.get('showOnRight')
props.tabId = frame.get('tabId')
props.tabId = tabId
props.showMessageBox = tab && tab.get('messageBoxDetail')

// used in other functions
Expand All @@ -1079,15 +1078,13 @@ class Frame extends ImmutableComponent {
props.pinnedLocation = frame.get('pinnedLocation')
props.src = frame.get('src')
props.guestInstanceId = frame.get('guestInstanceId')
props.tabId = frame.get('tabId')
props.aboutDetailsUrl = frame.getIn(['aboutDetails', 'url'])
props.aboutDetailsFrameKey = frame.getIn(['aboutDetails', 'frameKey'])
props.aboutDetailsErrorCode = frame.getIn(['aboutDetails', 'errorCode'])
props.unloaded = frame.get('unloaded')
props.isWidevineEnabled = state.get('widevine') && state.getIn(['widevine', 'enabled'])
props.siteZoomLevel = frameSiteSettings.get('zoomLevel')
props.siteZoomLevel = frameSiteSettings && frameSiteSettings.get('zoomLevel')
props.allSiteSettings = allSiteSettings // TODO remove
props.frameSiteSettings = frameSiteSettings // TODO remove

return Object.assign({}, ownProps, props)
}
Expand Down

0 comments on commit f29bc26

Please sign in to comment.