Skip to content

Commit

Permalink
cleanup code and provide Vingester version in user agent string
Browse files Browse the repository at this point in the history
  • Loading branch information
rse committed Oct 3, 2021
1 parent d29a592 commit 4b9fd90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The following is a detailed list of all changes to **Vingester** in
reverse chronological order (newer first), grouped by the release
versions and prefixed with the kind of change.

- 2.6.6
- IMPROVEMENT: attach "Vingester/M.N.K" string to user agent identifier
- CLEANUP: cleaned up handling of zoom factor

- 2.6.5
- BUGFIX: fix handling of tranparent background for "headless" mode

Expand Down
12 changes: 6 additions & 6 deletions vingester-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const electron = require("electron")
const contextMenu = require("electron-context-menu")
const bluebird = require("bluebird")
const util = require("./vingester-util.js")
const pkg = require("./package.json")

/* browser abstraction */
module.exports = class Browser {
Expand Down Expand Up @@ -430,7 +431,9 @@ module.exports = class Browser {
})

/* determine user-agent identifier */
const ua = content.webContents.getUserAgent()
let ua = content.webContents.getUserAgent()
ua += ` Vingester/${pkg.version}`
content.webContents.setUserAgent(ua)
this.log.info(`browser: content: user-agent: "${ua}"`)

/* allow insecure HTTPS connections */
Expand All @@ -444,7 +447,7 @@ module.exports = class Browser {
callback(-3)
})

/* control audio (for desktop window we unmute, for NDI we mute) */
/* control audio (we unmute for "frameless" window and "headless" with no audio channels) */
if (this.cfg.D || (this.cfg.N && this.cfg.C === 0))
content.webContents.setAudioMuted(false)
else
Expand Down Expand Up @@ -612,10 +615,7 @@ module.exports = class Browser {

/* force zoom level (sometimes Chromium keeps old factors if
just the "zoomFactor" attribute is used) */
if (this.cfg.D)
content.webContents.setZoomFactor(this.cfg.z / factor)
else
content.webContents.setZoomFactor(this.cfg.z / factor)
content.webContents.setZoomFactor(this.cfg.z / factor)
})

/* finally load the Web Content */
Expand Down

0 comments on commit 4b9fd90

Please sign in to comment.