Skip to content

Commit

Permalink
Fixes after manual testing
Browse files Browse the repository at this point in the history
  • Loading branch information
matushorvath committed Nov 17, 2023
1 parent adb772b commit ca74908
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ browserOrChrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {

if (changeInfo.status == 'complete' && tab.url) {
const matches = tab.url.match(/\.com\/([0-9]{4})\/day\/([0-9]+)(\/answer)?/);
//const matches = tab.url.match(/file:\/\/\//) ? [, 2022, 3, '/answer'] : undefined;
if (matches) {
const [, year, day, answer] = matches;
if (!answer) {
Expand Down
4 changes: 2 additions & 2 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const onGetStopData = (sendResponse) => {
return;
}

const part = (document.getElementsByClassName('share') === null ? 1 : 2);
const part = (document.getElementsByClassName('share').length === 0 ? 1 : 2);
sendResponse({ userName, part });
};

Expand All @@ -54,5 +54,5 @@ const getUserName = () => {
return undefined;
}

return element.textContent.trim();
return element.firstChild.textContent.trim();
};

0 comments on commit ca74908

Please sign in to comment.