From 8feff92e81a94cbccc209f9107bdae7afd950fa4 Mon Sep 17 00:00:00 2001 From: Renato Pozzi Date: Wed, 25 Sep 2024 16:14:46 +0200 Subject: [PATCH] fix: helpscout integrations (#2335) * fix: helpscout integrations * chore(helpscout): add header * Update origins.js --- src/content/helpscout.js | 39 ++++++++++++++++++++++----------------- src/origins.js | 3 ++- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/content/helpscout.js b/src/content/helpscout.js index 3adba4010..fa4deb0f7 100644 --- a/src/content/helpscout.js +++ b/src/content/helpscout.js @@ -1,22 +1,27 @@ -'use strict'; +/** + * @name Helpscout + * @urlAlias secure.helpscout.net + * @urlRegex *://secure.helpscout.net/* + */ -togglbutton.render('.convo-actions:not(.toggl)', { observe: true }, function () { - const description = - '#' + - $('#tkHeader strong').textContent + - ' ' + - $('#subjectLine').textContent; +'use strict' - const link = togglbutton.createTimerLink({ - className: 'helpscout', - description: description, - buttonType: 'minimal' - }); +togglbutton.render( + '[data-cy="ConversationHeader.Actions"]:not(.toggl)', + { observe: true }, + function () { + const id = $('[data-cy="Text"]').textContent + const content = $('[data-cy="EditableTextarea"]').textContent + const description = [id, content].join(' ') - link.setAttribute('style', 'margin-top: 10px'); + const link = togglbutton.createTimerLink({ + className: 'helpscout', + description: description, + buttonType: 'minimal', + }) - const listItem = document.createElement('li'); - listItem.appendChild(link); + link.setAttribute('style', 'margin-top: 10px') - $('.convo-actions').appendChild(listItem); -}); + $('[data-cy="ConversationHeader.Actions"]').appendChild(link) + }, +) diff --git a/src/origins.js b/src/origins.js index 9e811da3d..50771f725 100644 --- a/src/origins.js +++ b/src/origins.js @@ -288,7 +288,8 @@ export default { }, 'secure.helpscout.net': { url: '*://secure.helpscout.net/*', - name: 'Helpscout' + name: 'Helpscout', + file: 'helpscout.js' }, 'hubspot.com': { url: '*://app.hubspot.com/*',