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/*',