diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2022-04-18 06:51:50 -0500 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2022-04-18 06:51:50 -0500 |
commit | 18801ed0c02627e87639dc0848cab44dacc18be2 (patch) | |
tree | 15e56ba66c68bf7b4594e6c9fdef44e037b4be31 /docs/backend_api.md | |
parent | Remove deprecated webPreference flag (diff) | |
download | ferdium-recipes-18801ed0c02627e87639dc0848cab44dacc18be2.tar.gz ferdium-recipes-18801ed0c02627e87639dc0848cab44dacc18be2.tar.zst ferdium-recipes-18801ed0c02627e87639dc0848cab44dacc18be2.zip |
Rebranded from 'ferdi' to 'ferdium' (companion changes for the main repo PR #2)
Diffstat (limited to 'docs/backend_api.md')
-rw-r--r-- | docs/backend_api.md | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/backend_api.md b/docs/backend_api.md index a9d29ac..a46927b 100644 --- a/docs/backend_api.md +++ b/docs/backend_api.md | |||
@@ -1,8 +1,8 @@ | |||
1 | # Backend API | 1 | # Backend API |
2 | 2 | ||
3 | Provides a set of helper functions to integrate the recipe into [Ferdi](https://ferdium.org). | 3 | Provides a set of helper functions to integrate the recipe into [Ferdium](https://ferdium.org). |
4 | 4 | ||
5 | ## Ferdi Backend Class Methods | 5 | ## Ferdium Backend Class Methods |
6 | 6 | ||
7 | * [validateUrl](#validateurl) | 7 | * [validateUrl](#validateurl) |
8 | * [overrideUserAgent](#overrideuseragent) | 8 | * [overrideUserAgent](#overrideuseragent) |
@@ -29,7 +29,7 @@ Validate if the given URL is a valid service instance. | |||
29 | 29 | ||
30 | ```js | 30 | ```js |
31 | // RocketChat integration | 31 | // RocketChat integration |
32 | module.exports = Ferdi => class RocketChat extends Ferdi { | 32 | module.exports = Ferdium => class RocketChat extends Ferdium { |
33 | async validateUrl(url) { | 33 | async validateUrl(url) { |
34 | try { | 34 | try { |
35 | const resp = await window.fetch(`${url}/api/info`, { | 35 | const resp = await window.fetch(`${url}/api/info`, { |
@@ -61,11 +61,11 @@ Override the user agent used inside the service webview. | |||
61 | #### Usage | 61 | #### Usage |
62 | 62 | ||
63 | ```js | 63 | ```js |
64 | module.exports = Ferdi => class Discord extends Ferdi { | 64 | module.exports = Ferdium => class Discord extends Ferdium { |
65 | overrideUserAgent() { | 65 | overrideUserAgent() { |
66 | // Remove Ferdi's signature from the user agent | 66 | // Remove Ferdium's signature from the user agent |
67 | return window.navigator.userAgent.replace( | 67 | return window.navigator.userAgent.replace( |
68 | /(Ferdi|Electron)\/\S+ \([^)]+\)/g, | 68 | /(Ferdium|Electron)\/\S+ \([^)]+\)/g, |
69 | "" | 69 | "" |
70 | ); | 70 | ); |
71 | } | 71 | } |
@@ -73,7 +73,7 @@ module.exports = Ferdi => class Discord extends Ferdi { | |||
73 | ``` | 73 | ``` |
74 | 74 | ||
75 | ```js | 75 | ```js |
76 | module.exports = Ferdi => class Example extends Ferdi { | 76 | module.exports = Ferdium => class Example extends Ferdium { |
77 | overrideUserAgent() { | 77 | overrideUserAgent() { |
78 | // Use a completely different user agent | 78 | // Use a completely different user agent |
79 | return "Mozilla/2.02Gold (Win95; I)"; | 79 | return "Mozilla/2.02Gold (Win95; I)"; |
@@ -98,7 +98,7 @@ Valid URL patterns can be referred from [here](https://www.electronjs.org/docs/a | |||
98 | 98 | ||
99 | ```js | 99 | ```js |
100 | // Hangouts Chat integration | 100 | // Hangouts Chat integration |
101 | module.exports = Ferdi => class HangoutsChat extends Ferdi { | 101 | module.exports = Ferdium => class HangoutsChat extends Ferdium { |
102 | modifyRequestHeaders() { | 102 | modifyRequestHeaders() { |
103 | return [{ | 103 | return [{ |
104 | // Adding an origin header for all http requests from this recipe | 104 | // Adding an origin header for all http requests from this recipe |
@@ -123,7 +123,7 @@ Specify an array of known hosts from where certificates can be issued for this s | |||
123 | 123 | ||
124 | ```js | 124 | ```js |
125 | // msteams Chat integration | 125 | // msteams Chat integration |
126 | module.exports = Ferdi => class MicrosoftTeams extends Ferdi { | 126 | module.exports = Ferdium => class MicrosoftTeams extends Ferdium { |
127 | knownCertificateHosts() { | 127 | knownCertificateHosts() { |
128 | return [ | 128 | return [ |
129 | 'aka.ms', | 129 | 'aka.ms', |
@@ -152,14 +152,14 @@ module.exports = Ferdi => class MicrosoftTeams extends Ferdi { | |||
152 | 152 | ||
153 | ### Events | 153 | ### Events |
154 | 154 | ||
155 | Ferdi recipes can hook into the [electron webview events](https://electron.atom.io/docs/api/webview-tag/#dom-events) to trigger custom functions. | 155 | Ferdium recipes can hook into the [electron webview events](https://electron.atom.io/docs/api/webview-tag/#dom-events) to trigger custom functions. |
156 | 156 | ||
157 | This is necessary for services like TweetDeck where custom URL forwarding is needed during login. | 157 | This is necessary for services like TweetDeck where custom URL forwarding is needed during login. |
158 | 158 | ||
159 | #### Usage | 159 | #### Usage |
160 | 160 | ||
161 | ```js | 161 | ```js |
162 | module.exports = Ferdi => class Tweetdeck extends Ferdi { | 162 | module.exports = Ferdium => class Tweetdeck extends Ferdium { |
163 | events = { | 163 | events = { |
164 | 'did-get-redirect-request': '_redirectFix', | 164 | 'did-get-redirect-request': '_redirectFix', |
165 | } | 165 | } |