-
-
Save Vlasterx/b244b9b27ade8a6dd7eb2ffd3aae8d99 to your computer and use it in GitHub Desktop.
(() => { | |
let speedMs = 500 | |
setInterval(() => { | |
let dropdown = document.querySelector('.feed-shared-update-v2__control-menu .artdeco-dropdown button') | |
dropdown.click() | |
setTimeout(() => { | |
let optionDel = dropdown.parentElement.parentElement.parentElement.querySelector('.option-delete .tap-target') | |
if (optionDel === null) { | |
setTimeout(() => { window.scrollTo(0,document.body.scrollHeight) }, speedMs * 4) | |
} else { | |
optionDel.click() | |
setTimeout(() => { | |
document.querySelector('.artdeco-modal .feed-shared-decision-modal__confirm-button').click() | |
}, speedMs) | |
} | |
}, speedMs) | |
}, speedMs) | |
})() |
It's 2025 and just wanna confirm that the latest version by @rustrider works like a charm. Thank you and Happy New year.
any web fren could do comments
too?
https://www.linkedin.com/in/{user_id}/recent-activity/comments/
any web fren could do
comments
too? https://www.linkedin.com/in/{user_id}/recent-activity/comments/
Delete LinkedIn comments AND unlike posts
I used to use this one, while I was on LinkedIn. I don't know if it works today.
Open a profile page with your comments and run this bookmarklet. It will delete your comments AND unlike other posts at the same time. You can watch in console log how it goes.
Just be sure to change accountHref
and accountName
.
(() => {
let speedMs = 500
let accountHref = '/in/your-account-url/' // Change this to your account URL
let accountName = 'Your Account Name' // Change this to your account name
let nameMatch = new RegExp(accountName, 'gi')
let commentNo = 0
let likeNo = 0
window.scrollTo(0, document.body.scrollHeight)
setInterval(() => {
setTimeout(() => {
window.scrollTo(0, document.body.scrollHeight)
}, speedMs * 4)
let dropdown = document
.querySelector(`.comments-post-meta a[href="${accountHref}"]`)
.parentElement.parentElement.parentElement.querySelector(
'.social-details-social-activity .artdeco-dropdown button'
)
let liked1 = document.querySelector('[aria-label^="Unlike"]')
let liked2 = document.querySelector(
'[aria-label^="Like"][aria-pressed="true"]'
)
if (dropdown !== null || liked1 !== null || liked2 !== null) {
if (dropdown !== null && nameMatch.test(dropdown.innerHTML)) {
dropdown.click()
setTimeout(() => {
let openDropdown =
dropdown.parentElement.parentElement.parentElement.querySelectorAll(
'.artdeco-dropdown__content ul li .option-button'
)
let deleteBtn = Array.from(openDropdown).filter(
(item) => item.innerText === 'Delete'
)
setTimeout(() => {
deleteBtn[0].click()
setTimeout(() => {
let modalButtons = document.querySelectorAll(
'.artdeco-modal__actionbar button'
)
let modalDeleteBtn = Array.from(modalButtons).filter(
(item) => item.innerText === 'Delete'
)
modalDeleteBtn[0].click()
commentNo++
console.log(`Deleted comment ${commentNo}`)
}, speedMs)
}, speedMs)
}, speedMs)
}
if (liked1) {
setTimeout(() => {
liked1.click()
liked1.remove()
likeNo++
console.info(`Unliked comment ${likeNo}`)
}, speedMs)
}
if (liked2) {
setTimeout(() => {
liked2.click()
liked2.remove()
likeNo++
console.info(`Unliked comment ${likeNo}`)
}, speedMs)
}
} else {
setTimeout(() => {
window.scrollTo(0, document.body.scrollHeight)
}, speedMs * 4)
}
}, speedMs)
})()
When you change this, minimize JS and then put that code in here and add it to bookmark URL.
javascript:/* PLACE MINIMIZED CODE HERE */;
You will need to run this several times, because LinkedIn doesn't display all of your content at once.
Added Step: