File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -162,10 +162,8 @@ export function processIcon(newIcon) {
162162 // ⚠️ icon.remove() causes issues with some websites
163163 // https://github.com/furybee/chrome-tab-modifier/issues/354
164164 // icon.remove();
165- // Instead, remove all attributes
166- icon . getAttributeNames ( ) . forEach ( ( attr ) => {
167- icon . removeAttribute ( attr ) ;
168- } ) ;
165+ // Instead, we'll just change the rel attribute
166+ icon . setAttribute ( 'rel' , 'old-icon' ) ;
169167 } ) ;
170168
171169 const iconUrl = / ^ ( h t t p s ? | d a t a ) : / . test ( newIcon )
Original file line number Diff line number Diff line change @@ -248,7 +248,9 @@ describe('Content', () => {
248248 processIcon ( 'new-icon.png' ) ;
249249 const oldIcon = document . querySelector ( 'link[href="old-icon.png"]' ) ;
250250 const newIcon = document . querySelector ( 'link[href*="new-icon.png"]' ) ;
251- expect ( oldIcon ) . toBeFalsy ( ) ;
251+
252+ expect ( oldIcon ) . toBeTruthy ( ) ;
253+ expect ( oldIcon . rel ) . toBe ( 'old-icon' ) ;
252254 expect ( newIcon ) . toBeTruthy ( ) ;
253255 } ) ;
254256 } ) ;
You can’t perform that action at this time.
0 commit comments