blob: 145a069be73fadd236063b3fd2bbb9ee57b66812 [file] [log] [blame]
avm99963d0757252019-03-30 20:13:00 +01001chrome.storage.sync.get(null, function(items) {
2 if (items.history && document.querySelector(".user-profile__user-links") === null) {
3 var nameElement = document.querySelector(".user-profile__user-name");
4 if (nameElement !== null) {
5 var name = encodeURIComponent(nameElement.innerText);
avm9996330716122019-03-31 17:49:30 +02006 var link = document.location.pathname.split("/profile")[0]+"/threads?thread_filter=(creator:%22"+name+"%22+%7C+replier:%22"+name+"%22)";
avm99963a3d1ef32019-03-30 23:33:29 +01007 document.querySelector(".user-profile__user-details-container").insertAdjacentHTML('beforeend', '<div class="user-profile__user-links"><div class="user-profile__user-link-title">'+chrome.i18n.getMessage("inject_links")+'</div><ul><li class="user-profile__user-link"><a href="'+link+'" data-stats-id="my-posts-link">'+chrome.i18n.getMessage("inject_previousposts")+'</a></li></ul></div>');
avm99963d0757252019-03-30 20:13:00 +01008 }
9 }
10});