Group: JavaScript Developers Task-Force/Reddit JavaScript Analysis

From LibrePlanet
Jump to: navigation, search
(Initial revision for reddit; waiting on some LibreJS details from Task Force)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= NOTE: The formatting looks wrong on this page because it is written in markdown to comply with the FSF's internal publication workflow. Please keep it like this. It makes sense if you view the source of the page in the editing interface.=
+
=== Essential Reddit functionality that doesn't work with LibreJS 6.0.5 enabled (as of 11/2014)
 +
There may be more, this is just from a preliminary look.
  
# Changes that need to be made for reddit's essential functions to work with LibreJS enabled
+
 
 +
* Login/out
 +
* Voting
 +
* Registering a new account is not possible, because the CAPTCHA is not displayed.
 +
 
 +
===  Changes that need to be made for reddit's essential functions to work with LibreJS enabledi ===
 
The majority of the scripts necessary for Reddit to function properly for the
 
The majority of the scripts necessary for Reddit to function properly for the
 
average user are, fortunately, free software. However, not all files are
 
average user are, fortunately, free software. However, not all files are
Line 10: Line 16:
 
repository.
 
repository.
  
## Comments Page, et. al.
+
=== Comments Page, et. al.i ===
### reddit-init.en.js
+
====  reddit-init.en.js ====
 
* The outer try/catch is added by r2/r2/lib/js.py:425
 
* The outer try/catch is added by r2/r2/lib/js.py:425
  * Its license is irrelevant because the JavaScript is trivial
+
** Its license is irrelevant because the JavaScript is trivial
 
* lib/json2.js
 
* lib/json2.js
  * It is in the public domain
+
** It is in the public domain
 
* lib/underscore-1.4.4.js
 
* lib/underscore-1.4.4.js
  * Expat
+
** Expat
 
* lib/store.js
 
* lib/store.js
  * Expat
+
** Expat
 
* lib/jed.js
 
* lib/jed.js
  * Some modifications made by reddit, as noted within the file
+
** Some modifications made by reddit, as noted within the file
  * WTFPL
+
** WTFPL
  * *Zak verified that the license is indeed free.*
+
** *Zak verified that the license is indeed free.*
 
* base.js
 
* base.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* preload.js
 
* preload.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:'''''Add license to source file
 
* logging.js
 
* logging.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* uibase.js
 
* uibase.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* i18n.js
 
* i18n.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* utils.js
 
* utils.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* analytics.js
 
* analytics.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* jquery.reddit.js
 
* jquery.reddit.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* reddit.js
 
* reddit.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* spotlight.js
 
* spotlight.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* adzerk
 
* adzerk
  * This code is not included in the repository; it is also proprietary
+
** This code is not included in the repository; it is also proprietary
  * **FIX:** This should be loaded in a separate JavaScript file, or delimited
+
** '''''FIX:''''' This should be loaded in a separate JavaScript file, or delimited in such a way that LibreJS will be able to disable it effectively.
    in such a way that LibreJS will be able to disable it effectively.
+
** Tools like NoScript can be used to prevent scripts from loading on the adzerk domain, but NoScript cannot prevent the proprietary JS contained within the minified file itself from loading (unless the entire minified file is disallowed).
  * Tools like NoScript can be used to prevent scripts from loading on the
+
** Loads from:
    adzerk domain, but NoScript cannot prevent the proprietary JS contained
+
*** az.turbobytes.net if https
    within the minified file itself from loading (unless the entire minified
+
*** otherwise static.adzerk.net
    file is disallowed).
+
*** Creates an iframe that loads additional content:
  * Loads from:
+
***** In the case of non-https: http://static.adzerk.net/reddit/ads-load.html?bust2
      * az.turbobytes.net if https
+
****** Includes jQuery
      * otherwise static.adzerk.net
+
****** Includes http://secure.adzerk.net/ados.js?q=43
  * Creates an iframe that loads additional content:
+
******* No license; presumably proprietary.
        * In the case of non-https: http://static.adzerk.net/reddit/ads-load.html?bust2
+
***** http://static.adzerk.net/reddit/ads.html?sr=linux&bust2#http://www.reddit.com
            * Includes jQuery
+
*** Sets up messaging hooks for cross-origin communication
            * Includes http://secure.adzerk.net/ados.js?q=43
+
**** See https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage if unfamiliar
              * No license; presumably proprietary.
+
*** All the above also ends up in these being loaded:
      * http://static.adzerk.net/reddit/ads.html?sr=linux&bust2#http://www.reddit.com
+
**** http://static.adzrk.net/Extensions/adFeedback.js
  * Sets up messaging hooks for cross-origin communication
 
      * See https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage if unfamiliar
 
  * All the above also ends up in these being loaded:
 
      * http://engine.adzerk.net/ados?t=1389329534461&request={%22Placements%22:[{%22A%22:5146,%22S%22:24950,%22D%22:%22main%22,%22AT%22:5},{%22A%22:5146,%22S%22:24950,%22D%22:%22sponsorship%22,%22AT%22:8}],%22Keywords%22:%22linux%22,%22Referrer%22:%22http%3A%2F%2Fwww.reddit.com%2Fr%2Flinux%2Fcomments%2F1ubbz4%2Ffsf_ask_reddit_to_upvote_user_freedom_by_serving%2F%22,%22IsAsync%22:true,%22WriteResults%22:true}
 
      * http://static.adzrk.net/Extensions/adFeedback.js
 
  
### reddit.en.js
+
====  reddit.en.js ====
 
Similar to above; ordered concatenation and subsequent minification:
 
Similar to above; ordered concatenation and subsequent minification:
  
 
* templates.js
 
* templates.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* ui.js
 
* ui.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* login.js
 
* login.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* flair.js
 
* flair.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* interestbar.js
 
* interestbar.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* visited.js
 
* visited.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* wiki.js
 
* wiki.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* apps.js
 
* apps.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* gold.js
 
* gold.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* multi.js
 
* multi.js
    * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* recommender.js
 
* recommender.js
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
 
* JSON generated from r2/r2/lib/permissions.py
 
* JSON generated from r2/r2/lib/permissions.py
  * License irrelevant; it is data. The Python file is under the Common Public Attribution License
+
** License irrelevant; it is data. The Python file is under the Common Public Attribution License
 
* Unknown r.config.cursed; not in the repository!
 
* Unknown r.config.cursed; not in the repository!
  * The JavaScript is small and it looks like it's just intended to be a fun toy
+
** The JavaScript is small and it looks like it's just intended to be a fun toy
      * It randomly positions elements that you mouse over, it looks like
+
*** It randomly positions elements that you mouse over, it looks like
      * But regardless, it's non-free JS
+
*** But regardless, it's non-free JS
  * **FIX:** Add to the repository with license information
+
** '''''FIX:''''' Add to the repository with license information
* Ends with a trivial line that does not appear to be in the repository
+
**Ends with a trivial line that does not appear to be in the repository
  * Simply adds an i18n message; code is 104 chars and would look no different if not minified
+
*** Simply adds an i18n message; code is 104 chars and would look no different if not minified
  * **FIX:** Add to the repository with license information
+
*** '''''FIX:''''' Add to the repository with license information
  
  
# Changes that would be good to make, but which are not necessary for the site's essential functions to work with LibreJS on
+
==  Changes that would be good to make, but which are not necessary for the site's essential functions to work with LibreJS on ==
 
This is not comprehensive, but would be an excellent start.
 
This is not comprehensive, but would be an excellent start.
  
## Privacy Policy
+
===  Privacy Policy ===
 
* policies.js
 
* policies.js
  * Used on http://www.reddit.com/help/useragreement
+
** Used on http://www.reddit.com/help/useragreement
  * The source file contains no license
+
** The source file contains no license
  * **FIX:** Add license to source file
+
*** '''''FIX:''''' Add license to source file
  
## Preferences
+
===  Preferencesi ===
 
* jquery.js
 
* jquery.js
  * Used on https://ssl.reddit.com/prefs/
+
** Used on https://ssl.reddit.com/prefs/
  * Already includes this header (just need to make LibreJS-compatible): /*! jQuery v1.7.2 jquery.com | jquery.org/license */
+
** Already includes this header (just need to make LibreJS-compatible): /*! jQuery v1.7.2 jquery.com | jquery.org/license */
  * **FIX:** Make aforementioned header LibreJS-compatible
+
** '''''FIX:''''' Make aforementioned header LibreJS-compatible
  
## ajax.googleapis.com/**/*.js
+
===  ajax.googleapis.com/**/*.js ===
 
* We obviously cannot add license headers to these files
 
* We obviously cannot add license headers to these files
  * **FIX:** Use a separate page to describe licenses (Web Labels)
+
** '''''FIX:''''' Use a separate page to describe licenses (Web Labels)
  
## Blog
+
=== Blog ===
 
The blog is a particular concern---it uses a great deal of JavaScript, but seems
 
The blog is a particular concern---it uses a great deal of JavaScript, but seems
 
to work fine without JavaScript enabled.
 
to work fine without JavaScript enabled.
  
### s.ytimg.com/yts/jsbin/*.js
+
==== s.ytimg.com/yts/jsbin/*.js ====
 
* www-embed-player.js
 
* www-embed-player.js
  * Proprietary YouTube JavaScript
+
** Proprietary YouTube JavaScript
  * Used for embedded video player
+
** Used for embedded video player
  * **FIX:** Perhaps they could use an HTML5 player with free codecs instead,
+
** '''''FIX:''''' Perhaps they could use an HTML5 player with free codecs instead, since YouTube serves up HML5-compatible content for many videos
    since YouTube serves up HTML5-compatible content for many videos
 
  
### www.youtube.com/embed/*
+
====  www.youtube.com/embed/* ====
 
* Used on blog.reddit.com
 
* Used on blog.reddit.com
  * **FIX:** They can provide us with the source code, or commit it to the repository
+
** '''''FIX:''''' They can provide us with the source code, or commit it to the repository
 
* Various embed stuff for iframes; includes above JS
 
* Various embed stuff for iframes; includes above JS
 
* Contains non-free JavaScript used as configuration for above YouTube include
 
* Contains non-free JavaScript used as configuration for above YouTube include
  * That said, it's primarily data; it may be trivial
+
** That said, it's primarily data; it may be trivial
 
* Loads http://www.google.com/js/bg/J3oN4k55bATX3riG5_bT7XUBXDr4fHU0iSqBW5OwyBU.js
 
* Loads http://www.google.com/js/bg/J3oN4k55bATX3riG5_bT7XUBXDr4fHU0iSqBW5OwyBU.js
  * Some Google anti-spam thing
+
** Some Google anti-spam thing
  * Proprietary JS
+
** Proprietary JS
  * **FIX:** Same as above---use HTML5 video player with free codecs, if possible
+
** '''''FIX:''''' Same as above---use HTML5 video player with free codecs, if possible
  
### https://accounts.google.com/o/oauth2/postmessageRelay?parent=http%3A%2F%2Fwww.blogger.com#rpctoken=378573301&forcesecure=1
+
==== https://accounts.google.com/o/oauth2/postmessageRelay?parent=http%3A%2F%2Fwww.blogger.com#rpctoken=378573301&forcesecure=1 ====
 
* Loads ssl.gstatic.com/accounts/o/1618667077-postmessagerelay.js
 
* Loads ssl.gstatic.com/accounts/o/1618667077-postmessagerelay.js
  * Proprietary JS
+
** Proprietary JS
  * **FIX:** Remove.
+
** '''''FIX:''''' Remove.
  
### http://www.google-analytics.com/ga.js
+
====  http://www.google-analytics.com/ga.js ====
 
* Proprietary JS
 
* Proprietary JS
* **FIX:** Remove.
+
* '''''FIX:''''' Remove.
  
### www.blogger.com/static/v1
+
==== www.blogger.com/static/v1 ====
 
* jsbin/3672639782-lbx.js
 
* jsbin/3672639782-lbx.js
  * 582kB of proprietary JS
+
** 582kB of proprietary JS
 
* widgets/3561504294-widgets.js
 
* widgets/3561504294-widgets.js
  * 85kB more proprietary JS
+
** 85kB more proprietary JS
 
* Loads over half a dozen more smaller scripts from apis.google.com on top of that
 
* Loads over half a dozen more smaller scripts from apis.google.com on top of that
* **FIX:** Remove.
+
* '''''FIX:''''' Remove.
  
### https://apis.google.com/js/plusone.js
+
====  https://apis.google.com/js/plusone.js ====
 
* The notorious Google+ +1 button!
 
* The notorious Google+ +1 button!
  * Can track users
+
** Can track users
* **FIX:** Remove; they can always share the link on their own
+
* '''''FIX:''''' Remove; they can always share the link on their own
  
### reddit.com
+
====  reddit.com ====
 
* static/button.js
 
* static/button.js
  * Combined, minified file
+
** Combined, minified file
  * lib/jquery.cookie.js
+
** lib/jquery.cookie.js
      * Dual Expat/GPL
+
*** Dual Expat/GPL
  * jquery.reddit.js
+
* jquery.reddit.js
      * The source file contains no license
+
** The source file contains no license
      * **FIX:** Add license to source file
+
** '''''FIX:''''' Add license to source file
  * blogbutton.js
+
** blogbutton.js
      * The source file contains no license
+
*** The source file contains no license
      * **FIX:** Add license to source file
+
*** '''''FIX:''''' Add license to source file
  
## About
+
=== About ===
### redditstatic.com
+
==== redditstatic.com ====
 
* about.js; concatenated, minified:
 
* about.js; concatenated, minified:
  * Custom modernizer configuration
+
** Custom modernizer configuration
      * See http://modernizr.com/download/
+
*** See http://modernizr.com/download/
      * Expat license (http://modernizr.com/license)
+
*** Expat license (http://modernizr.com/license)
      * Does not exist in repository!
+
*** Does not exist in repository!
      * **FIX:** Add to repository with license information
+
*** '''''FIX:''''' Add to repository with license information
 
* (minified blob)
 
* (minified blob)
  * Not in the repository!
+
** Not in the repository!
  * Might be part of Modernizr; looks to modify the Date object for consistency
+
** Might be part of Modernizr; looks to modify the Date object for consistency
  * No license and might be proprietary
+
** No license and might be proprietary
  * **FIX:** Add to repository with license information
+
** '''''FIX:''''' Add to repository with license information
 
* (minified blobs)
 
* (minified blobs)
  * Not in the repository!
+
** Not in the repository!
  * Some trivial hooks and stuff, on top of what's listed below (which is non-trivial and extensive)
+
** Some trivial hooks and stuff, on top of what's listed below (which is non-trivial and extensive)
  * The following Backbone views/models:
+
* The following Backbone views/models:
      * SlideShowView
+
** SlideShowView
        * AboutSlideshowView
+
*** AboutSlideshowView
      * TimelineEvent
+
** TimelineEvent
      * TimelineEventView
+
** TimelineEventView
      * TimelineView
+
** TimelineView
        * AboutTimelineView
+
*** AboutTimelineView
      * GridView
+
** GridView
        * PeopleGridView
+
*** PeopleGridView
      * AboutSlideshowView
+
** AboutSlideshowView
      * TeamRouter
+
** TeamRouter
      * DropdownView
+
** DropdownView
      * TeamMember
+
** TeamMember
      * SortableCollection
+
** SortableCollection
      * PersonDetailsPopup
+
** PersonDetailsPopup
      * PersonView
+
** PersonView
      * Postcard
+
** Postcard
      * PostcardCollection
+
** PostcardCollection
      * PostcardRouter
+
** PostcardRouter
      * PostcardOverlayView
+
** PostcardOverlayView
        * PostcardInfoView
+
*** PostcardInfoView
        * PostcardRedditView
+
*** PostcardRedditView
        * PostcardCloseView
+
*** PostcardCloseView
      * PostcardZoomView
+
** PostcardZoomView
      * PostcardView
+
** PostcardView
      * PostcardGridView
+
** PostcardGridView
  * No license and is therefore proprietary
+
* No license and is therefore proprietary
  * **FIX:** Add to repository with license information
+
* '''''FIX:''''' Add to repository with license information
 +
 
 +
== General ==
 +
=== Quick License Addition ===
 +
This simple shell/sed script can be used to add the license header to all source files in one go, assuming that such a header is contained within the file <tt>license_header</tt>:
 +
 
 +
<code>
 +
$ sed -i '
 +
  1{
 +
    r ./license_header
 +
    h;d
 +
  }
 +
  2{H;g}' r2/r2/public/static/js/*.js
 +
</code>

Latest revision as of 18:04, 11 November 2014

=== Essential Reddit functionality that doesn't work with LibreJS 6.0.5 enabled (as of 11/2014) There may be more, this is just from a preliminary look.


  • Login/out
  • Voting
  • Registering a new account is not possible, because the CAPTCHA is not displayed.

Changes that need to be made for reddit's essential functions to work with LibreJS enabledi

The majority of the scripts necessary for Reddit to function properly for the average user are, fortunately, free software. However, not all files are labelled as such. Additional efforts are also needed to ensure that LibreJS recognizes the distributed files as free.

Below, "source file" refers to the unminified source code in the Reddit repository.

Comments Page, et. al.i

reddit-init.en.js

  • The outer try/catch is added by r2/r2/lib/js.py:425
    • Its license is irrelevant because the JavaScript is trivial
  • lib/json2.js
    • It is in the public domain
  • lib/underscore-1.4.4.js
    • Expat
  • lib/store.js
    • Expat
  • lib/jed.js
    • Some modifications made by reddit, as noted within the file
    • WTFPL
    • *Zak verified that the license is indeed free.*
  • base.js
    • The source file contains no license
    • FIX: Add license to source file
  • preload.js
    • The source file contains no license
    • FIX:Add license to source file
  • logging.js
    • The source file contains no license
    • FIX: Add license to source file
  • uibase.js
    • The source file contains no license
    • FIX: Add license to source file
  • i18n.js
    • The source file contains no license
    • FIX: Add license to source file
  • utils.js
    • The source file contains no license
    • FIX: Add license to source file
  • analytics.js
    • The source file contains no license
    • FIX: Add license to source file
  • jquery.reddit.js
    • The source file contains no license
    • FIX: Add license to source file
  • reddit.js
    • The source file contains no license
    • FIX: Add license to source file
  • spotlight.js
    • The source file contains no license
    • FIX: Add license to source file
  • adzerk

reddit.en.js

Similar to above; ordered concatenation and subsequent minification:

  • templates.js
    • The source file contains no license
    • FIX: Add license to source file
  • ui.js
    • The source file contains no license
    • FIX: Add license to source file
  • login.js
    • The source file contains no license
    • FIX: Add license to source file
  • flair.js
    • The source file contains no license
    • FIX: Add license to source file
  • interestbar.js
    • The source file contains no license
    • FIX: Add license to source file
  • visited.js
    • The source file contains no license
    • FIX: Add license to source file
  • wiki.js
    • The source file contains no license
    • FIX: Add license to source file
  • apps.js
    • The source file contains no license
    • FIX: Add license to source file
  • gold.js
    • The source file contains no license
    • FIX: Add license to source file
  • multi.js
    • The source file contains no license
    • FIX: Add license to source file
  • recommender.js
    • The source file contains no license
    • FIX: Add license to source file
  • JSON generated from r2/r2/lib/permissions.py
    • License irrelevant; it is data. The Python file is under the Common Public Attribution License
  • Unknown r.config.cursed; not in the repository!
    • The JavaScript is small and it looks like it's just intended to be a fun toy
      • It randomly positions elements that you mouse over, it looks like
      • But regardless, it's non-free JS
    • FIX: Add to the repository with license information
    • Ends with a trivial line that does not appear to be in the repository
      • Simply adds an i18n message; code is 104 chars and would look no different if not minified
      • FIX: Add to the repository with license information


Changes that would be good to make, but which are not necessary for the site's essential functions to work with LibreJS on

This is not comprehensive, but would be an excellent start.

Privacy Policy

Preferencesi

  • jquery.js
    • Used on https://ssl.reddit.com/prefs/
    • Already includes this header (just need to make LibreJS-compatible): /*! jQuery v1.7.2 jquery.com | jquery.org/license */
    • FIX: Make aforementioned header LibreJS-compatible

ajax.googleapis.com/**/*.js

  • We obviously cannot add license headers to these files
    • FIX: Use a separate page to describe licenses (Web Labels)

Blog

The blog is a particular concern---it uses a great deal of JavaScript, but seems to work fine without JavaScript enabled.

s.ytimg.com/yts/jsbin/*.js

  • www-embed-player.js
    • Proprietary YouTube JavaScript
    • Used for embedded video player
    • FIX: Perhaps they could use an HTML5 player with free codecs instead, since YouTube serves up HML5-compatible content for many videos

www.youtube.com/embed/*

  • Used on blog.reddit.com
    • FIX: They can provide us with the source code, or commit it to the repository
  • Various embed stuff for iframes; includes above JS
  • Contains non-free JavaScript used as configuration for above YouTube include
    • That said, it's primarily data; it may be trivial
  • Loads http://www.google.com/js/bg/J3oN4k55bATX3riG5_bT7XUBXDr4fHU0iSqBW5OwyBU.js
    • Some Google anti-spam thing
    • Proprietary JS
    • FIX: Same as above---use HTML5 video player with free codecs, if possible

https://accounts.google.com/o/oauth2/postmessageRelay?parent=http%3A%2F%2Fwww.blogger.com#rpctoken=378573301&forcesecure=1

  • Loads ssl.gstatic.com/accounts/o/1618667077-postmessagerelay.js
    • Proprietary JS
    • FIX: Remove.

http://www.google-analytics.com/ga.js

  • Proprietary JS
  • FIX: Remove.

www.blogger.com/static/v1

  • jsbin/3672639782-lbx.js
    • 582kB of proprietary JS
  • widgets/3561504294-widgets.js
    • 85kB more proprietary JS
  • Loads over half a dozen more smaller scripts from apis.google.com on top of that
  • FIX: Remove.

https://apis.google.com/js/plusone.js

  • The notorious Google+ +1 button!
    • Can track users
  • FIX: Remove; they can always share the link on their own

reddit.com

  • static/button.js
    • Combined, minified file
    • lib/jquery.cookie.js
      • Dual Expat/GPL
  • jquery.reddit.js
    • The source file contains no license
    • FIX: Add license to source file
    • blogbutton.js
      • The source file contains no license
      • FIX: Add license to source file

About

redditstatic.com

  • about.js; concatenated, minified:
  • (minified blob)
    • Not in the repository!
    • Might be part of Modernizr; looks to modify the Date object for consistency
    • No license and might be proprietary
    • FIX: Add to repository with license information
  • (minified blobs)
    • Not in the repository!
    • Some trivial hooks and stuff, on top of what's listed below (which is non-trivial and extensive)
  • The following Backbone views/models:
    • SlideShowView
      • AboutSlideshowView
    • TimelineEvent
    • TimelineEventView
    • TimelineView
      • AboutTimelineView
    • GridView
      • PeopleGridView
    • AboutSlideshowView
    • TeamRouter
    • DropdownView
    • TeamMember
    • SortableCollection
    • PersonDetailsPopup
    • PersonView
    • Postcard
    • PostcardCollection
    • PostcardRouter
    • PostcardOverlayView
      • PostcardInfoView
      • PostcardRedditView
      • PostcardCloseView
    • PostcardZoomView
    • PostcardView
    • PostcardGridView
  • No license and is therefore proprietary
  • FIX: Add to repository with license information

General

Quick License Addition

This simple shell/sed script can be used to add the license header to all source files in one go, assuming that such a header is contained within the file license_header:

$ sed -i '
  1{
    r ./license_header
    h;d
  }
  2{H;g}' r2/r2/public/static/js/*.js