Skip to content

Commit

Permalink
Fixed bug where contextual menu didn't appear
Browse files Browse the repository at this point in the history
  • Loading branch information
KabajSAH committed Dec 27, 2022
1 parent bca7702 commit 0718eb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version" : 3,
"name": "Remove Twitter Views",
"description": "Remove the Views button from Twitter",
"version": "1.2.1",
"version": "1.2.2",
"author" : "Kabaj",
"content_scripts": [
{
Expand Down
7 changes: 5 additions & 2 deletions scripts/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ function deleteBetterViews(){
const viewCountElements = document.querySelectorAll(Better_SEL);
if(viewCountElements){
viewCountElements.forEach(e => {
if(e.dataset.testid !== 'analyticsButton'){
if(e.dataset.testid !== 'analyticsButton'&& e.dataset.testid !== 'analytics'){
let elem = e;
while(!elem.nextSibling){
console.log(elem);
console.log(!(elem.nextSibling || elem.previousSibling))
while(!(elem.nextSibling || elem.previousSibling)){
elem = elem.parentNode;
console.log("dedans");
}
elem.remove();
}
Expand Down

0 comments on commit 0718eb3

Please sign in to comment.