Skip to content

Commit

Permalink
Fix previous posts links in own profile
Browse files Browse the repository at this point in the history
In the current user's profile, the username is shown inside a
ec-display-name-editor tag instead of a span tag. We only looked for the
span tag, so the links weren't added in the current user's profile.

Fixes: #43
Change-Id: Id38e412d35917f2133fe92e0cecaebba1a4a63c5
  • Loading branch information
avm99963 committed May 15, 2021
1 parent 87ba0d2 commit b3e8986
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/content_scripts/console_inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,9 @@ const watchedNodesSelectors = [
// Load more bar (for the "load more"/"load all" buttons)
'.load-more-bar',

// Username span inside ec-user (user profile view)
// Username span/editor inside ec-user (user profile view)
'ec-user .main-card .header > .name > span',
'ec-user .main-card .header > .name > ec-display-name-editor',

// Rich text editor
'ec-movable-dialog',
Expand Down Expand Up @@ -671,7 +672,9 @@ function handleCandidateNode(node) {
// Show the "previous posts" links
// Here we're selecting the 'ec-user > div' element (unique child)
if (options.history &&
node.matches('ec-user .main-card .header > .name > span')) {
(node.matches('ec-user .main-card .header > .name > span') ||
node.matches(
'ec-user .main-card .header > .name > ec-display-name-editor'))) {
injectPreviousPostsLinks(node);
}

Expand Down

0 comments on commit b3e8986

Please sign in to comment.