Fix previous posts links in own profile
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
diff --git a/src/content_scripts/console_inject.js b/src/content_scripts/console_inject.js
index f9565d4..78c97f4 100644
--- a/src/content_scripts/console_inject.js
+++ b/src/content_scripts/console_inject.js
@@ -609,8 +609,9 @@
// 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',
@@ -671,7 +672,9 @@
// 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);
}