From ab94de44b9fbf8da261c98ab95b49cba2050df70 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Fri, 2 Oct 2020 23:43:34 +0200 Subject: Spoof Chrome plugins for Skype Skype for Web requires either Chrome or Edge, but refuses to cooperate with Chromium. The detection of (non-)Chromium is based on navigator.plugins: https://github.com/Eloston/ungoogled-chromium/issues/1010#issuecomment-643740388 Since we cannot rebuild Chromium to report a different plugin identity, we instead patch Plugins.prototype to do the spoofing. Closes https://github.com/getferdi/ferdi/issues/973 --- recipes/skype/package.json | 2 +- recipes/skype/webview.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'recipes/skype') diff --git a/recipes/skype/package.json b/recipes/skype/package.json index 93043cc..8d9d5af 100644 --- a/recipes/skype/package.json +++ b/recipes/skype/package.json @@ -1,7 +1,7 @@ { "id": "skype", "name": "Skype", - "version": "2.0.0", + "version": "2.1.0", "description": "Skype", "main": "index.js", "author": "Stefan Malzner ", diff --git a/recipes/skype/webview.js b/recipes/skype/webview.js index 4d5292d..2d2ba41 100644 --- a/recipes/skype/webview.js +++ b/recipes/skype/webview.js @@ -3,6 +3,15 @@ const { remote: { BrowserWindow } } = require("electron"); const path = require('path'); +const nameDescriptor = Object.getOwnPropertyDescriptor(Plugin.prototype, 'name'); +const getName = nameDescriptor.get; +Object.defineProperty(Plugin.prototype, 'name', { + ...nameDescriptor, + get() { + return getName.call(this).replace('Chromium', 'Chrome'); + } +}); + module.exports = (Franz, settings) => { const getMessages = function getMessages() { let count = 0; -- cgit v1.2.3-70-g09d2