From 6861131bcefdb572871622cdbd2490fa690fada9 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Tue, 5 Mar 2019 10:03:15 +0200 Subject: [PATCH] Support new boot_data format --- src/get-slack-api-data.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/get-slack-api-data.js b/src/get-slack-api-data.js index 646bbd8..fc9d980 100644 --- a/src/get-slack-api-data.js +++ b/src/get-slack-api-data.js @@ -10,8 +10,8 @@ export default function getSlackApiData () { return; } - const apiTokenResult = /api_token\:\s\"(.*)\"/g.exec(script.innerText); - const versionUidResult = /version_uid\:\s\"(.*)\"/g.exec(script.innerText); + const apiTokenResult = /["]?api_token["]?\:\s*\"(.+?)\"/g.exec(script.innerText); + const versionUidResult = /["]?version_uid["]?\:\s*\"(.+?)\"/g.exec(script.innerText); if (apiTokenResult) { apiToken = apiTokenResult[1];