<|start_filename|>js/index.js<|end_filename|>
const highlightMyNews = () => {
  const userLogin = document.getElementsByTagName('meta')['user-login'].content.trim();
  const regex = new RegExp(userLogin, 'gi');

  let alertArray = document
    .getElementsByClassName('news')[0]
    .getElementsByClassName('body');

  for (alert of alertArray) {
    alert.innerText.match(regex)
      ? alert.style.background = '#E5E5E5' : '';
  }
};

(() => {
  highlightMyNews();

  // select the target node
  var target = document.getElementsByClassName('news')[0];

  // create an observer instance
  // https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
  var observer = new MutationObserver(function (mutations) {
    highlightMyNews();
  });

  // configuration of the observer:
  var config = { attributes: true, childList: true, characterData: true };

  // pass in the target node, as well as the observer options
  observer.observe(target, config);
})();

<|start_filename|>manifest.json<|end_filename|>
{
	"manifest_version": 2,
	"name": "My Git Repo News",
	"description": "Chrome extension which helps you not to miss important changes in your news thread related to your repo",
	"short_name": "My Git Repo News",
	"version": "1.0.2",
	"homepage_url": "https://github.com/greybax/github-extension-my-repo-news",
	"browser_action": {
		"default_title": "My Git Repo News",
		"default_icon": "icons/icon-16.png"
	},
	"icons": {
		"16": "icons/icon-16.png",
		"48": "icons/icon-48.png",
		"128": "icons/icon-128.png"
	},
	"permissions": ["activeTab"],
	"content_scripts": [
		{
			"matches": [
				"https://github.com/*",
				"http://github.com/*"
			],
			"js": [
				"js/index.js"
			]
		}
	]
}
