Browse like Xerces the God King of the Persians

Browse like Xerces the God King of the Persians

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.

23fc4556be14017796d38579dd4778ab?s=128

Mike MacCana

March 07, 2014
Tweet

Transcript

  1. Browse like Xerces, the GOD KING OF THE PERSIANS

  2. This talk isn't: How to make a Chrome Extension

  3. This talk is: Controlling the world

  4. Creators not consumers Mould and shape the world in our

    image Even when we're not working
  5. None
  6. Chapter 1 Darius the Wizard Slayer

  7. "Darius was an active emperor, busy with building programs in

    Persepolis, Susa, Egypt, and writing many Extensions in the Chrome Web Store." Wikipedia (retrieved just now)
  8. The Story of Darius

  9. None
  10. Knowing what's real

  11. Shapeshifting wizard ✓ Dead King ✗

  12. None
  13. None
  14. Demo time

  15. None
  16. An extension Make a folder Make a manifest.js " c

    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
  17. Eye Size Calc v a r e y e S

    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 ;
  18. None
  19. Chapter 2 Xerces

  20. None
  21. Born of Darius Cyrus's Daughter

  22. King of Persia King of Media Great King King of

    Kings King of Nations Fastest Typist
  23. None
  24. Jumping the wall v a r i n j e

    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 " ]
  25. Demo time

  26. Chapter 3 Whipping the Sea

  27. Hellespont thwarted his ambitions

  28. None
  29. A Soft Murmur

  30. None
  31. Soon Chrome will have keyboard shortcuts for extensions So you

    can listen directly from the background app
  32. Demo time

  33. Chapter 4 Conquering

  34. None
  35. If only there was a programming language in the browser

  36. Thankyou

  37. Make an API for anything with MutationSummary v a r

    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 ' } ] } ) ;
  38. Demo time

  39. Browsing tips from 2500 year old Zoroastrians: Change what you

    don't like Automate the stuff that bores you Control your data online Extend and control the web apps you use
  40. Thanks. @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana

    @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana @mikemaccana