{"size": 1118, "ext": "js", "max_stars_repo_path": "src/eradicate.js", "max_stars_repo_name": "kymgit/mynewsfeed", "max_stars_repo_stars_event_min_datetime": "2016-01-30T04:48:18.000Z", "max_stars_repo_stars_event_max_datetime": "2017-10-10T11:55:36.000Z", "max_issues_repo_path": "src/eradicate.js", "max_issues_repo_name": "kymgit/mynewsfeed", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/eradicate.js", "max_forks_repo_name": "kymgit/mynewsfeed", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.6666666667, "max_line_length": 71, "alphanum_fraction": 0.7441860465}
// Load any browser specific code. This is selected by webpack
var browser = require( 'browser-specific' );

// Include the stylesheets
require( './eradicate.css' );

var forEach = require('lodash/collection/foreach');

var React = require('react');

var NewsFeedEradicator = require('./components/index.jsx');

// This delay ensures that the elements have been created by Facebook's
// scripts before we attempt to replace them
setTimeout(function(){
	// Add News Feed Eradicator display
	var streamContainer = document.getElementById('stream_pagelet');
	var nfeContainer = document.createElement("div");
	nfeContainer.id = "nfe-container";
	streamContainer.appendChild(nfeContainer);

	// Delete the stream to prevent its infinite scroll infinitely loading
	// new stories (even though they are hidden)
	var streamMatcher = /^topnews_main_stream/;
	forEach(streamContainer.children, (child) => {
		if(streamMatcher.test(child.id)) {
			streamContainer.removeChild(child);

			// Exit the foreach
			return false;
		}
	});

	React.render(
		React.createElement(NewsFeedEradicator, null),
		nfeContainer
	);
}, 1000);
