Historical fact: 2500 years ago Xerces, the God-King of the Persians, built an empire based entirely on Chrome Extensions. In this talk, we recreate history.
o n t e n t _ s c r i p t s " : [ { " m a t c h e s " : [ " h t t p : / / * / * " , " h t t p s : / / * / * " ] , " j s " : [ " j s / s u p e r a g e n t . j s " , " j s / e y e s . j s " ] , " r u n _ a t " : " d o c u m e n t _ e n d " } ] , Add some JS as a content script Load chrome:///extensions, click 'developer mode', pick folder
i z e = ( M a t h . s q r t ( M a t h . p o w ( e y e D i s t a n c e X , 2 ) + M a t h . p o w ( e y e D i s t a n c e Y , 2 ) ) ) / E Y E _ S I Z E _ T O _ D I S T A N C E _ R A T I O ;
c t J S F i l e = f u n c t i o n ( f i l e ) { v a r u r l = c h r o m e . e x t e n s i o n . g e t U R L ( f i l e ) ; v a r s c r i p t = d o c u m e n t . c r e a t e E l e m e n t ( ' s c r i p t ' ) ; s c r i p t . s r c = u r l ; d o c u m e n t . q u e r y S e l e c t o r ( ' h e a d ' ) . a p p e n d C h i l d ( s c r i p t ) ; } i n j e c t J S F i l e ( ' i n j e c t m e . j s ' ) In your manifest.json: " w e b _ a c c e s s i b l e _ r e s o u r c e s " : [ " i n j e c t m e . j s " ]
o b s e r v e r = n e w M u t a t i o n S u m m a r y ( { c a l l b a c k : f u n c t i o n ( s u m m a r i e s ) { / / O n l y 1 q u e r y , s o o n l y o n e s u m m a r y . l o g ( ' s u m m a r y ' , s u m m a r i e s [ 0 ] ) s u m m a r i e s [ 0 ] . a d d e d . f o r E a c h ( f u n c t i o n ( a d d e d E l e m e n t ) { … } ) } , q u e r i e s : [ { e l e m e n t : ' s o m e e l e m e n t y p e . s o m e c l a s s ' } ] } ) ;