From 953c45f564cc8213cce8acbeb4a8acd6d56d549e Mon Sep 17 00:00:00 2001 From: Mahadevan Sreenivasan Date: Fri, 24 Apr 2020 19:31:33 +0530 Subject: Update Integration documentation - Update the possibility of overriding user-agent in ferdi recipes so that user's know this options is possible. --- docs/integration.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs') diff --git a/docs/integration.md b/docs/integration.md index 174ba02..ef9e2a5 100644 --- a/docs/integration.md +++ b/docs/integration.md @@ -99,6 +99,19 @@ module.exports = Ferdi => class RocketChat extends Ferdi { `validateServer` needs to return a [`Promise`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise), otherwise validation will fail. + +If you need to override the default user-agent in your service, you can do so like the following snippet of code + +``` + overrideUserAgent() { + return window.navigator.userAgent.replace( + /(Ferdi|Electron)\/\S+ \([^)]+\)/g, + "" + ); + } +``` + + ### webview.js The webview.js is the actual script that will be loaded into the webview. Here you can do whatever you want to do in order perfectly integrate the service into Ferdi. For convenience, we have provided a very simple set of functions to set unread message badges (`Ferdi.setBadge()`) and inject CSS files (`Ferdi.injectCSS()`). -- cgit v1.2.3-54-g00ecf