From 2484c63d77e05fff384cc08b6ea46a29a22a62ec Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Tue, 5 Oct 2021 16:46:55 +0200 Subject: chore: repo maintenance (#732) --- recipes/NewsBlur/webview.js | 3 +- recipes/basecamp/webview.js | 25 +++++++++------ recipes/box/webview.js | 3 +- recipes/devRant/index.js | 3 +- recipes/devdocs/webview.js | 3 +- recipes/easy-redmine/webview.js | 3 +- recipes/feedbin/webview.js | 5 +-- recipes/figma/webview.js | 3 +- recipes/franz-custom-website/index.js | 11 ++++--- recipes/franz-custom-website/webview.js | 4 ++- recipes/google-voice/webview.js | 15 ++++++--- recipes/googlecalendar/webview-unsafe.js | 13 ++++++-- recipes/iCloud/webview.js | 3 +- recipes/icloud-reminders/webview.js | 3 +- recipes/keybase.io/webview.js | 3 +- recipes/line-me/webview.js | 3 +- recipes/mastodon/index.js | 4 +-- recipes/mastodon/webview.js | 8 ++--- recipes/messenger/webview.js | 37 ++++++++++++++-------- recipes/misskey/index.js | 54 +++++++++++++++++--------------- recipes/misskey/webview.js | 6 ++-- recipes/netatmo-energy/webview.js | 3 +- recipes/odoo/webview.js | 9 ++++-- recipes/paymo/webview.js | 3 +- recipes/pinterest/webview.js | 3 +- recipes/plan/webview.js | 3 +- recipes/pleroma/webview.js | 42 +++++++++++++++---------- recipes/pushbullet/index.js | 36 +++++++++++++-------- recipes/reddit/webview.js | 18 ++++++----- recipes/redditchat/webview.js | 1 + recipes/snapdrop/webview.js | 2 +- recipes/tawk/webview.js | 3 +- recipes/teamweek/webview.js | 2 +- recipes/toggl/webview.js | 3 +- recipes/tweetdeck/index.js | 36 +++++++++++++-------- recipes/zimbra/index.js | 11 ++++--- 36 files changed, 225 insertions(+), 162 deletions(-) (limited to 'recipes') diff --git a/recipes/NewsBlur/webview.js b/recipes/NewsBlur/webview.js index 7e19dff..23607bd 100644 --- a/recipes/NewsBlur/webview.js +++ b/recipes/NewsBlur/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/basecamp/webview.js b/recipes/basecamp/webview.js index e7b7dde..16eced3 100644 --- a/recipes/basecamp/webview.js +++ b/recipes/basecamp/webview.js @@ -1,9 +1,10 @@ const _path = _interopRequireDefault(require('path')); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} -module.exports = (Ferdi) => { - let updates = 0; +module.exports = Ferdi => { const modal = document.createElement('div'); const waitFor = (condition, callback) => { @@ -16,13 +17,11 @@ module.exports = (Ferdi) => { function showModal(text) { show(modal); modal.querySelector('p').innerHTML = text; - updates += 1; } function hideModal() { hide(modal); modal.querySelector('p').innerHTML = ''; - updates -= 1; } // Replace window.alert to hide alerts in Ferdi @@ -41,11 +40,19 @@ module.exports = (Ferdi) => { } modal.id = 'franz-modal'; - modal.innerHTML = ''; + modal.innerHTML = + ''; modal.querySelector('.close').addEventListener('click', hideModal); - waitFor(() => document.body, () => document.body.appendChild(modal)); - - document.addEventListener('keydown', (e) => { if (e.keyCode === 27) { hideModal(); } }); + waitFor( + () => document.body, + () => document.body.appendChild(modal), + ); + + document.addEventListener('keydown', e => { + if (e.key === 'Escape') { + hideModal(); + } + }); Ferdi.injectCSS(_path.default.join(__dirname, 'css', 'modal.css')); }; diff --git a/recipes/box/webview.js b/recipes/box/webview.js index 7e19dff..23607bd 100644 --- a/recipes/box/webview.js +++ b/recipes/box/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/devRant/index.js b/recipes/devRant/index.js index 7e19dff..23607bd 100644 --- a/recipes/devRant/index.js +++ b/recipes/devRant/index.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/devdocs/webview.js b/recipes/devdocs/webview.js index 7e19dff..23607bd 100644 --- a/recipes/devdocs/webview.js +++ b/recipes/devdocs/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/easy-redmine/webview.js b/recipes/easy-redmine/webview.js index 7e19dff..23607bd 100644 --- a/recipes/easy-redmine/webview.js +++ b/recipes/easy-redmine/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/feedbin/webview.js b/recipes/feedbin/webview.js index 5c08892..197814e 100644 --- a/recipes/feedbin/webview.js +++ b/recipes/feedbin/webview.js @@ -1,8 +1,9 @@ -module.exports = (Ferdi) => { +module.exports = Ferdi => { const getMessages = () => { + // eslint-disable-next-line no-undef const count = feedbin.count_data.unread_entries.length || 0; Ferdi.setBadge(count); - } + }; Ferdi.loop(getMessages); }; diff --git a/recipes/figma/webview.js b/recipes/figma/webview.js index 7e19dff..23607bd 100644 --- a/recipes/figma/webview.js +++ b/recipes/figma/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/franz-custom-website/index.js b/recipes/franz-custom-website/index.js index c0f91cb..6e4f228 100644 --- a/recipes/franz-custom-website/index.js +++ b/recipes/franz-custom-website/index.js @@ -1,5 +1,6 @@ -module.exports = Ferdi => class CustomWebsite extends Ferdi { - async validateUrl(url) { - return true; - } -}; +module.exports = Ferdi => + class CustomWebsite extends Ferdi { + async validateUrl() { + return true; + } + }; diff --git a/recipes/franz-custom-website/webview.js b/recipes/franz-custom-website/webview.js index ca6a9f7..9eec086 100644 --- a/recipes/franz-custom-website/webview.js +++ b/recipes/franz-custom-website/webview.js @@ -1,6 +1,8 @@ const _path = _interopRequireDefault(require('path')); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} module.exports = Ferdi => { Ferdi.injectCSS(_path.default.join(__dirname, 'style.css')); diff --git a/recipes/google-voice/webview.js b/recipes/google-voice/webview.js index 7cada87..eb3004d 100644 --- a/recipes/google-voice/webview.js +++ b/recipes/google-voice/webview.js @@ -9,16 +9,23 @@ module.exports = Ferdi => { let count; if (el) { + // eslint-disable-next-line no-useless-escape count = Ferdi.safeParseInt(el.innerHTML.replace(/[\(\) ]/gi, '')); } else { - const count_messages = parseQuery('gv-nav-tab[tooltip="Messages"] div[aria-label="Unread count"]'); - const count_calls = parseQuery('gv-nav-tab[tooltip="Calls"] div[aria-label="Unread count"]'); - const count_voicemails = parseQuery('gv-nav-tab[tooltip="Voicemail"] div[aria-label="Unread count"]'); + const count_messages = parseQuery( + 'gv-nav-tab[tooltip="Messages"] div[aria-label="Unread count"]', + ); + const count_calls = parseQuery( + 'gv-nav-tab[tooltip="Calls"] div[aria-label="Unread count"]', + ); + const count_voicemails = parseQuery( + 'gv-nav-tab[tooltip="Voicemail"] div[aria-label="Unread count"]', + ); count = count_messages + count_calls + count_voicemails; } Ferdi.setBadge(count); - } + }; Ferdi.loop(getMessages); }; diff --git a/recipes/googlecalendar/webview-unsafe.js b/recipes/googlecalendar/webview-unsafe.js index c47f572..54a7338 100644 --- a/recipes/googlecalendar/webview-unsafe.js +++ b/recipes/googlecalendar/webview-unsafe.js @@ -26,7 +26,8 @@ const hideModal = () => { const createModal = () => { const modalDialog = document.createElement('div'); modalDialog.setAttribute('id', 'franz-modal'); - modalDialog.innerHTML = ''; + modalDialog.innerHTML = + ''; modalDialog.querySelector('.close').addEventListener('click', hideModal); return modalDialog; @@ -35,5 +36,11 @@ const createModal = () => { window.alert = showModal; modal = createModal(); -waitFor(() => document.body, () => document.body.appendChild(modal)); -document.addEventListener('keydown', event => event.keyCode === 27 && hideModal()); +waitFor( + () => document.body, + () => document.body.appendChild(modal), +); +document.addEventListener( + 'keydown', + event => event.key === 'Escape' && hideModal(), +); diff --git a/recipes/iCloud/webview.js b/recipes/iCloud/webview.js index 7e19dff..23607bd 100644 --- a/recipes/iCloud/webview.js +++ b/recipes/iCloud/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/icloud-reminders/webview.js b/recipes/icloud-reminders/webview.js index 7e19dff..23607bd 100644 --- a/recipes/icloud-reminders/webview.js +++ b/recipes/icloud-reminders/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/keybase.io/webview.js b/recipes/keybase.io/webview.js index 7e19dff..23607bd 100644 --- a/recipes/keybase.io/webview.js +++ b/recipes/keybase.io/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/line-me/webview.js b/recipes/line-me/webview.js index 7e19dff..23607bd 100644 --- a/recipes/line-me/webview.js +++ b/recipes/line-me/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/mastodon/index.js b/recipes/mastodon/index.js index 1dd93cc..9be0938 100644 --- a/recipes/mastodon/index.js +++ b/recipes/mastodon/index.js @@ -1,9 +1,9 @@ -module.exports = (Ferdi) => { +module.exports = Ferdi => { class Mastodon extends Ferdi { validateServer(URL) { const api = `${URL}`; return new Promise((resolve, reject) => { - $.get(api, (resp) => { + $.get(api, () => { resolve(); }).fail(reject); }); diff --git a/recipes/mastodon/webview.js b/recipes/mastodon/webview.js index 4b450a1..8fb448f 100644 --- a/recipes/mastodon/webview.js +++ b/recipes/mastodon/webview.js @@ -1,11 +1,11 @@ -module.exports = (Ferdi) => { +module.exports = Ferdi => { let latestStatement = $('.status time').attr('datetime'); let latestNotify = $($('.notification__message span').get(0)).text(); - $($('div.column div.scrollable').get(0)).on('scroll', (ev) => { + $($('div.column div.scrollable').get(0)).on('scroll', () => { latestStatement = $('.status time').attr('datetime'); }); - $($('div.column div.scrollable').get(1)).on('scroll', (ev) => { + $($('div.column div.scrollable').get(1)).on('scroll', () => { latestNotify = $($('.notification__message span').get(0)).text(); }); @@ -22,7 +22,7 @@ module.exports = (Ferdi) => { } Ferdi.setBadge(reply, unread); - } + }; Ferdi.loop(getMessages); }; diff --git a/recipes/messenger/webview.js b/recipes/messenger/webview.js index 954f843..5b2f2ad 100644 --- a/recipes/messenger/webview.js +++ b/recipes/messenger/webview.js @@ -8,18 +8,23 @@ module.exports = Ferdi => { * Notification case for group chats, workaround by tamas646 * see https://github.com/getferdi/ferdi/issues/1113#issuecomment-783409154 */ - if (isNotification) { + if (isNotification) { count = Ferdi.safeParseInt(/^\((\d+)\)/.exec(document.title)[1]); } else { /* - * Notification case for direct messages, workaround by manavortex - * see https://github.com/getferdi/ferdi/issues/1113#issuecomment-846611765 - */ - count = document.querySelectorAll('._5fx8:not(._569x),._1ht3:not(._569x)').length; + * Notification case for direct messages, workaround by manavortex + * see https://github.com/getferdi/ferdi/issues/1113#issuecomment-846611765 + */ + count = document.querySelectorAll( + '._5fx8:not(._569x),._1ht3:not(._569x)', + ).length; if (count === 0) { - count = document.querySelectorAll('.pq6dq46d.is6700om.qu0x051f.esr5mh6w.e9989ue4.r7d6kgcz.s45kfl79.emlxlaya.bkmhp75w.spb7xbtv.cyypbtt7.fwizqjfa').length; + count = document.querySelectorAll( + '.pq6dq46d.is6700om.qu0x051f.esr5mh6w.e9989ue4.r7d6kgcz.s45kfl79.emlxlaya.bkmhp75w.spb7xbtv.cyypbtt7.fwizqjfa', + ).length; } - if (count === 0) { // might be obsolete, not sure - never ran into this case + if (count === 0) { + // might be obsolete, not sure - never ran into this case count = document.querySelectorAll('[aria-label="Mark as read"]').length; } } @@ -36,19 +41,25 @@ module.exports = Ferdi => { Ferdi.loop(getMessages); - localStorage.setItem('_cs_desktopNotifsEnabled', JSON.stringify({ - __t: new Date().getTime(), - __v: true, - })); + localStorage.setItem( + '_cs_desktopNotifsEnabled', + JSON.stringify({ + __t: new Date().getTime(), + __v: true, + }), + ); if (typeof Ferdi.onNotify === 'function') { Ferdi.onNotify(notification => { if (typeof notification.title !== 'string') { - notification.title = ((notification.title.props || {}).content || [])[0] || 'Messenger'; + notification.title = + ((notification.title.props || {}).content || [])[0] || 'Messenger'; } if (typeof notification.options.body !== 'string') { - notification.options.body = (((notification.options.body || {}).props || {}).content || [])[0] || ''; + notification.options.body = + (((notification.options.body || {}).props || {}).content || [])[0] || + ''; } return notification; diff --git a/recipes/misskey/index.js b/recipes/misskey/index.js index 3f51bf9..5805c37 100644 --- a/recipes/misskey/index.js +++ b/recipes/misskey/index.js @@ -1,28 +1,30 @@ -module.exports = Ferdi => class Misskey extends Ferdi { - constructor(...args) { - let _temp; - return _temp = super(...args), this.events = { - }, _temp; - } +module.exports = Ferdi => + class Misskey extends Ferdi { + constructor(...args) { + let _temp; + // eslint-disable-next-line constructor-super + return (_temp = super(...args)), (this.events = {}), _temp; + } - async validateUrl(url) { - try { - const res = await window.fetch(`${url}/api/stats`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }); - const data = await res.json(); - // check any field in API response - return [ - 'originalUsersCount', 'usersCount', 'notesCount', 'originalNotesCount' - ].reduce((r, key) => ( - r && Object.hasOwnProperty.call(data, 'uri') - ), true); - } catch (err) { - console.error(err); + async validateUrl(url) { + try { + const res = await window.fetch(`${url}/api/stats`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }); + const data = await res.json(); + // check any field in API response + return [ + 'originalUsersCount', + 'usersCount', + 'notesCount', + 'originalNotesCount', + ].reduce(r => r && Object.hasOwnProperty.call(data, 'uri'), true); + } catch (err) { + console.error(err); + } + return false; } - return false; - } -}; + }; diff --git a/recipes/misskey/webview.js b/recipes/misskey/webview.js index c174266..65fa237 100644 --- a/recipes/misskey/webview.js +++ b/recipes/misskey/webview.js @@ -1,7 +1,9 @@ -module.exports = (Ferdi) => { +module.exports = Ferdi => { const getMessages = () => { // check notification badge for Ferdi badge - let hasNotification = !!document.querySelector('#app div.notifications > button > i.circle'); + let hasNotification = !!document.querySelector( + '#app div.notifications > button > i.circle', + ); Ferdi.setBadge(0, hasNotification ? 1 : 0); }; diff --git a/recipes/netatmo-energy/webview.js b/recipes/netatmo-energy/webview.js index 7e19dff..23607bd 100644 --- a/recipes/netatmo-energy/webview.js +++ b/recipes/netatmo-energy/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/odoo/webview.js b/recipes/odoo/webview.js index 8f02c8f..453b3fc 100644 --- a/recipes/odoo/webview.js +++ b/recipes/odoo/webview.js @@ -1,4 +1,9 @@ -module.exports = (Ferdi) => { +const _path = _interopRequireDefault(require('path')); - Ferdi.injectCSS(_path.default.join(__dirname, "service.css")); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +module.exports = Ferdi => { + Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); }; diff --git a/recipes/paymo/webview.js b/recipes/paymo/webview.js index 7e19dff..23607bd 100644 --- a/recipes/paymo/webview.js +++ b/recipes/paymo/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/pinterest/webview.js b/recipes/pinterest/webview.js index 7e19dff..23607bd 100644 --- a/recipes/pinterest/webview.js +++ b/recipes/pinterest/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/plan/webview.js b/recipes/plan/webview.js index 7e19dff..23607bd 100644 --- a/recipes/plan/webview.js +++ b/recipes/plan/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/pleroma/webview.js b/recipes/pleroma/webview.js index da76955..2ba184e 100644 --- a/recipes/pleroma/webview.js +++ b/recipes/pleroma/webview.js @@ -1,6 +1,6 @@ const titleRegex = /^\((\d+)\)/; -const getJson = async (relativeUri) => { +const getJson = async relativeUri => { const req = await window.fetch(`${window.origin}${relativeUri}`, { Accept: 'application/json', }); @@ -8,10 +8,11 @@ const getJson = async (relativeUri) => { }; const getInstanceConfig = async () => { - const origin = window.origin; const staticConfig = await getJson('/static/config.json'); try { - const frontendConfig = await getJson('/api/pleroma/frontend_configurations'); + const frontendConfig = await getJson( + '/api/pleroma/frontend_configurations', + ); const pleromaFeConfig = frontendConfig.pleroma_fe || {}; return { ...staticConfig, ...pleromaFeConfig }; } catch (e) { @@ -33,8 +34,12 @@ const getInstanceLogo = async () => { logoMask: config.logoMask, }); }); - img.addEventListener('error', (event) => { - reject(new Error(`${event.type} error loading ${config.logo}: ${event.message}`)); + img.addEventListener('error', event => { + reject( + new Error( + `${event.type} error loading ${config.logo}: ${event.message}`, + ), + ); }); img.src = `${origin}${config.logo}`; }); @@ -146,16 +151,19 @@ module.exports = Ferdi => { Ferdi.setBadge(directCount); }; - getInstanceLogo().then(({ logo, logoMask }) => { - const updater = new LogoUpdater(logo, logoMask); - Ferdi.loop(() => { - getMessages(); - if (updater.update()) { - Ferdi.setAvatarImage(updater.toDataURL()); - } - }); - }, (e) => { - console.log('Failed to load instance logo', e); - Ferdi.loop(getMessages); - }); + getInstanceLogo().then( + ({ logo, logoMask }) => { + const updater = new LogoUpdater(logo, logoMask); + Ferdi.loop(() => { + getMessages(); + if (updater.update()) { + Ferdi.setAvatarImage(updater.toDataURL()); + } + }); + }, + e => { + console.log('Failed to load instance logo', e); + Ferdi.loop(getMessages); + }, + ); }; diff --git a/recipes/pushbullet/index.js b/recipes/pushbullet/index.js index 556cab6..ace403b 100644 --- a/recipes/pushbullet/index.js +++ b/recipes/pushbullet/index.js @@ -1,16 +1,26 @@ -module.exports = Ferdi => class PushBullet extends Ferdi { - constructor(...args) { - let _temp; +module.exports = Ferdi => + class PushBullet extends Ferdi { + constructor(...args) { + let _temp; - return _temp = super(...args), this.events = { - 'did-get-redirect-request': '_redirectFix', - }, _temp; - } + return ( + // eslint-disable-next-line constructor-super + (_temp = super(...args)), + (this.events = { + 'did-get-redirect-request': '_redirectFix', + }), + _temp + ); + } - _redirectFix(event) { - if (event.newURL !== undefined && event.oldURL !== undefined && event.isMainFrame) { - setTimeout(() => this.send('redirect-url', event.newURL), 100); - event.preventDefault(); + _redirectFix(event) { + if ( + event.newURL !== undefined && + event.oldURL !== undefined && + event.isMainFrame + ) { + setTimeout(() => this.send('redirect-url', event.newURL), 100); + event.preventDefault(); + } } - } -}; + }; diff --git a/recipes/reddit/webview.js b/recipes/reddit/webview.js index 327bd89..5095ba1 100644 --- a/recipes/reddit/webview.js +++ b/recipes/reddit/webview.js @@ -1,10 +1,14 @@ const _path = _interopRequireDefault(require('path')); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} -module.exports = (Ferdi) => { +module.exports = Ferdi => { const getMessages = () => { - const elements = document.querySelectorAll('#HeaderUserActions--Messages > a > span'); + const elements = document.querySelectorAll( + '#HeaderUserActions--Messages > a > span', + ); let count = 0; if (elements[0]) { @@ -15,7 +19,7 @@ module.exports = (Ferdi) => { }; if (document.querySelectorAll('.promotedlink').length > 0) { - document.querySelectorAll('.promotedlink').forEach((sponsoredLink) => { + document.querySelectorAll('.promotedlink').forEach(sponsoredLink => { sponsoredLink.parentElement.parentElement.style.display = 'none'; }); } @@ -25,17 +29,17 @@ module.exports = (Ferdi) => { // Use CSS to hide Google Ads Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); - Ferdi.handleDarkMode((isEnabled, config) => { + Ferdi.handleDarkMode(isEnabled => { // Open dropdown menu if not already open const menu = document.querySelector('#USER_DROPDOWN_ID'); - if (menu.getAttribute('aria-expanded') === 'false') { + if (menu && menu.getAttribute('aria-expanded') === 'false') { menu.click(); } setTimeout(() => { // Check if service is already in right mode const btn = document.querySelector('[role=menu] button button'); - const checked = btn.getAttribute('aria-checked') === 'true'; + const checked = btn && btn.getAttribute('aria-checked') === 'true'; if ((checked && !isEnabled) || (!checked && isEnabled)) { // Click the button to switch between modes diff --git a/recipes/redditchat/webview.js b/recipes/redditchat/webview.js index 7000e53..14f7f6c 100644 --- a/recipes/redditchat/webview.js +++ b/recipes/redditchat/webview.js @@ -1,5 +1,6 @@ module.exports = Ferdi => { // Regular expression for (*) or (1), will extract the asterisk or the number + // eslint-disable-next-line no-useless-escape const titleRegEx = /^\(([\*\d])\)/; const getMessages = function unreadCount() { let directCount = 0; diff --git a/recipes/snapdrop/webview.js b/recipes/snapdrop/webview.js index 22ca24c..23607bd 100644 --- a/recipes/snapdrop/webview.js +++ b/recipes/snapdrop/webview.js @@ -1 +1 @@ -module.exports = (Ferdi) => {}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/tawk/webview.js b/recipes/tawk/webview.js index 7e19dff..23607bd 100644 --- a/recipes/tawk/webview.js +++ b/recipes/tawk/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/teamweek/webview.js b/recipes/teamweek/webview.js index 22ca24c..23607bd 100644 --- a/recipes/teamweek/webview.js +++ b/recipes/teamweek/webview.js @@ -1 +1 @@ -module.exports = (Ferdi) => {}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/toggl/webview.js b/recipes/toggl/webview.js index 7e19dff..23607bd 100644 --- a/recipes/toggl/webview.js +++ b/recipes/toggl/webview.js @@ -1,2 +1 @@ -module.exports = Ferdi => { -}; +module.exports = Ferdi => Ferdi; diff --git a/recipes/tweetdeck/index.js b/recipes/tweetdeck/index.js index 3dc2463..f54a64a 100644 --- a/recipes/tweetdeck/index.js +++ b/recipes/tweetdeck/index.js @@ -1,16 +1,26 @@ -module.exports = Ferdi => class Tweetdeck extends Ferdi { - constructor(...args) { - let _temp; +module.exports = Ferdi => + class Tweetdeck extends Ferdi { + constructor(...args) { + let _temp; - return _temp = super(...args), this.events = { - 'did-get-redirect-request': '_redirectFix', - }, _temp; - } + return ( + // eslint-disable-next-line constructor-super + (_temp = super(...args)), + (this.events = { + 'did-get-redirect-request': '_redirectFix', + }), + _temp + ); + } - _redirectFix(event) { - if (event.newURL !== undefined && event.oldURL !== undefined && event.isMainFrame) { - setTimeout(() => this.send('redirect-url', event.newURL), 100); - event.preventDefault(); + _redirectFix(event) { + if ( + event.newURL !== undefined && + event.oldURL !== undefined && + event.isMainFrame + ) { + setTimeout(() => this.send('redirect-url', event.newURL), 100); + event.preventDefault(); + } } - } -}; + }; diff --git a/recipes/zimbra/index.js b/recipes/zimbra/index.js index 1b0a47f..50c3cf2 100644 --- a/recipes/zimbra/index.js +++ b/recipes/zimbra/index.js @@ -1,5 +1,6 @@ -module.exports = Ferdi => class Zimbra extends Ferdi { - async validateUrl(url) { - return true; - } -}; +module.exports = Ferdi => + class Zimbra extends Ferdi { + async validateUrl() { + return true; + } + }; -- cgit v1.2.3-54-g00ecf