File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 11chrome . runtime . onMessage . addListener ( ( request ) => {
22 if ( request . action === 'updateDescription' ) {
3+
4+ // testing some stuff
5+
6+ let descriptionContainer = document . querySelectorAll ( 'div.px-5.pt-4' )
7+ console . log ( descriptionContainer )
8+ // end testing
9+
10+
311 chrome . storage . local . get ( [ 'hideTags' ] , ( result ) => {
412 let canShowCompanyTags = true ;
513 canShowCompanyTags = ! result . hideTags ;
614 if ( canShowCompanyTags ) {
715 const title = request . title . split ( '-' ) [ 0 ] . trim ( ) ;
816 addCompanyTags ( title ) ;
917 }
18+ else {
19+ let buttonContainer = document . getElementById ( 'companyButtonContainer' ) ;
20+ if ( buttonContainer ) {
21+ buttonContainer . remove ( ) ;
22+ }
23+ }
1024 } ) ;
1125
1226 const details = document . querySelectorAll ( 'div.mt-3.flex.space-x-4' ) [ 0 ] ;
Original file line number Diff line number Diff line change @@ -26,11 +26,15 @@ fontSizeSelect!.onchange = function () {
2626} ;
2727
2828document . getElementById ( 'hide-tags-btn' ) ! . addEventListener ( 'click' , function ( ) {
29- chrome . runtime . sendMessage ( { message : 'updateDescription' } )
3029 chrome . storage . local . get ( [ 'hideTags' ] , ( result ) => {
3130 const newHideTags = ! result . hideTags ;
3231 chrome . storage . local . set ( { hideTags : newHideTags } , ( ) => {
3332 document . getElementById ( 'toggle-show-tags-text' ) ! . textContent = newHideTags ? '❌' : '✅' ;
33+
34+ // Manually trigger the update description after toggling 'hideTags'
35+ chrome . tabs . query ( { active : true , currentWindow : true } , ( tabs ) => {
36+ chrome . tabs . sendMessage ( tabs [ 0 ] . id ! , { action : 'updateDescription' , title : tabs [ 0 ] . title || 'title' } ) ;
37+ } ) ;
3438 } ) ;
3539 } ) ;
3640} ) ;
You can’t perform that action at this time.
0 commit comments