{"action":"opened","number":19,"pull_request":{"url":"https://api.github.com/repos/shakyShane/html-injector/pulls/19","id":58346664,"html_url":"https://github.com/shakyShane/html-injector/pull/19","diff_url":"https://github.com/shakyShane/html-injector/pull/19.diff","patch_url":"https://github.com/shakyShane/html-injector/pull/19.patch","issue_url":"https://api.github.com/repos/shakyShane/html-injector/issues/19","number":19,"state":"open","locked":false,"title":"Only reload when url contains path of changed file","user":{"login":"webxl","id":264741,"avatar_url":"https://avatars.githubusercontent.com/u/264741?v=3","gravatar_id":"","url":"https://api.github.com/users/webxl","html_url":"https://github.com/webxl","followers_url":"https://api.github.com/users/webxl/followers","following_url":"https://api.github.com/users/webxl/following{/other_user}","gists_url":"https://api.github.com/users/webxl/gists{/gist_id}","starred_url":"https://api.github.com/users/webxl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webxl/subscriptions","organizations_url":"https://api.github.com/users/webxl/orgs","repos_url":"https://api.github.com/users/webxl/repos","events_url":"https://api.github.com/users/webxl/events{/privacy}","received_events_url":"https://api.github.com/users/webxl/received_events","type":"User","site_admin":false},"body":"I was seeing the injection, but also getting a reload because multiple html files are changing, so adding a check seems to take care of this problem. \r\n\r\nI only figured out how to make this work for this config style though:\r\n```\r\nbs.use(htmlInjector, {\r\n    files: ['./**/*.html']\r\n  });\r\n```\r\n\r\nThe logs below have my own debugging messages:\r\n\r\nBefore:\r\n\r\n```\r\n[BS] [HTML Injector] Responding to file change event {\"event\":\"change\",\"path\":\"docs/index.html\",\"namespace\":\"HTML Injector\"}\r\n[BS] [HTML Injector] Cache items: 1\r\n[BS] [HTML Injector] requesting http://localhost:3000/docs/maintenance/index.html\r\n[BS] [HTML Injector] Responding to file change event {\"event\":\"change\",\"path\":\"docs/maintenance/index.html\",\"namespace\":\"HTML Injector\"}\r\n[BS] [HTML Injector] Cache items: 1\r\n[BS] [HTML Injector] requesting http://localhost:3000/docs/maintenance/index.html\r\n[BS] [HTML Injector] 1 tasks returned\r\n[BS] [HTML Injector] Task: TAG: DIV, INDEX: 25\r\n[BS] [HTML Injector] 0 tasks returned, reloading instead\r\n\r\n```\r\nAfter: \r\n```\r\n[BS] [HTML Injector] Responding to file change event {\"event\":\"change\",\"path\":\"docs/index.html\",\"namespace\":\"HTML Injector\"}\r\n[BS] [HTML Injector] Cache items: 1\r\n[BS] [HTML Injector] requesting http://localhost:3000/docs/maintenance/index.html\r\n[BS] [HTML Injector] Responding to file change event {\"event\":\"change\",\"path\":\"docs/maintenance/index.html\",\"namespace\":\"HTML Injector\"}\r\n[BS] [HTML Injector] Cache items: 1\r\n[BS] [HTML Injector] requesting http://localhost:3000/docs/maintenance/index.html\r\n[BS] [HTML Injector] 1 tasks returned\r\n[BS] [HTML Injector] Task: TAG: DIV, INDEX: 25\r\n```\r\n\r\nPerhaps this could be an option. Thoughts?","created_at":"2016-02-04T20:49:05Z","updated_at":"2016-02-04T20:49:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shakyShane/html-injector/pulls/19/commits","review_comments_url":"https://api.github.com/repos/shakyShane/html-injector/pulls/19/comments","review_comment_url":"https://api.github.com/repos/shakyShane/html-injector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shakyShane/html-injector/issues/19/comments","statuses_url":"https://api.github.com/repos/shakyShane/html-injector/statuses/33576694fcaff22650b5347a9392ce4a05f2d0db","head":{"label":"webxl:patch-1","ref":"patch-1","sha":"33576694fcaff22650b5347a9392ce4a05f2d0db","user":{"login":"webxl","id":264741,"avatar_url":"https://avatars.githubusercontent.com/u/264741?v=3","gravatar_id":"","url":"https://api.github.com/users/webxl","html_url":"https://github.com/webxl","followers_url":"https://api.github.com/users/webxl/followers","following_url":"https://api.github.com/users/webxl/following{/other_user}","gists_url":"https://api.github.com/users/webxl/gists{/gist_id}","starred_url":"https://api.github.com/users/webxl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webxl/subscriptions","organizations_url":"https://api.github.com/users/webxl/orgs","repos_url":"https://api.github.com/users/webxl/repos","events_url":"https://api.github.com/users/webxl/events{/privacy}","received_events_url":"https://api.github.com/users/webxl/received_events","type":"User","site_admin":false},"repo":{"id":51103092,"name":"html-injector","full_name":"webxl/html-injector","owner":{"login":"webxl","id":264741,"avatar_url":"https://avatars.githubusercontent.com/u/264741?v=3","gravatar_id":"","url":"https://api.github.com/users/webxl","html_url":"https://github.com/webxl","followers_url":"https://api.github.com/users/webxl/followers","following_url":"https://api.github.com/users/webxl/following{/other_user}","gists_url":"https://api.github.com/users/webxl/gists{/gist_id}","starred_url":"https://api.github.com/users/webxl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webxl/subscriptions","organizations_url":"https://api.github.com/users/webxl/orgs","repos_url":"https://api.github.com/users/webxl/repos","events_url":"https://api.github.com/users/webxl/events{/privacy}","received_events_url":"https://api.github.com/users/webxl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/webxl/html-injector","description":"BrowserSync html injector","fork":true,"url":"https://api.github.com/repos/webxl/html-injector","forks_url":"https://api.github.com/repos/webxl/html-injector/forks","keys_url":"https://api.github.com/repos/webxl/html-injector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webxl/html-injector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webxl/html-injector/teams","hooks_url":"https://api.github.com/repos/webxl/html-injector/hooks","issue_events_url":"https://api.github.com/repos/webxl/html-injector/issues/events{/number}","events_url":"https://api.github.com/repos/webxl/html-injector/events","assignees_url":"https://api.github.com/repos/webxl/html-injector/assignees{/user}","branches_url":"https://api.github.com/repos/webxl/html-injector/branches{/branch}","tags_url":"https://api.github.com/repos/webxl/html-injector/tags","blobs_url":"https://api.github.com/repos/webxl/html-injector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webxl/html-injector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webxl/html-injector/git/refs{/sha}","trees_url":"https://api.github.com/repos/webxl/html-injector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webxl/html-injector/statuses/{sha}","languages_url":"https://api.github.com/repos/webxl/html-injector/languages","stargazers_url":"https://api.github.com/repos/webxl/html-injector/stargazers","contributors_url":"https://api.github.com/repos/webxl/html-injector/contributors","subscribers_url":"https://api.github.com/repos/webxl/html-injector/subscribers","subscription_url":"https://api.github.com/repos/webxl/html-injector/subscription","commits_url":"https://api.github.com/repos/webxl/html-injector/commits{/sha}","git_commits_url":"https://api.github.com/repos/webxl/html-injector/git/commits{/sha}","comments_url":"https://api.github.com/repos/webxl/html-injector/comments{/number}","issue_comment_url":"https://api.github.com/repos/webxl/html-injector/issues/comments{/number}","contents_url":"https://api.github.com/repos/webxl/html-injector/contents/{+path}","compare_url":"https://api.github.com/repos/webxl/html-injector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webxl/html-injector/merges","archive_url":"https://api.github.com/repos/webxl/html-injector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webxl/html-injector/downloads","issues_url":"https://api.github.com/repos/webxl/html-injector/issues{/number}","pulls_url":"https://api.github.com/repos/webxl/html-injector/pulls{/number}","milestones_url":"https://api.github.com/repos/webxl/html-injector/milestones{/number}","notifications_url":"https://api.github.com/repos/webxl/html-injector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webxl/html-injector/labels{/name}","releases_url":"https://api.github.com/repos/webxl/html-injector/releases{/id}","deployments_url":"https://api.github.com/repos/webxl/html-injector/deployments","created_at":"2016-02-04T20:26:14Z","updated_at":"2016-02-04T20:26:15Z","pushed_at":"2016-02-04T20:48:09Z","git_url":"git://github.com/webxl/html-injector.git","ssh_url":"git@github.com:webxl/html-injector.git","clone_url":"https://github.com/webxl/html-injector.git","svn_url":"https://github.com/webxl/html-injector","homepage":null,"size":237,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"shakyShane:master","ref":"master","sha":"fc968ea132e4de65b00f5c3ac4947abb72bbe86e","user":{"login":"shakyShane","id":1643522,"avatar_url":"https://avatars.githubusercontent.com/u/1643522?v=3","gravatar_id":"","url":"https://api.github.com/users/shakyShane","html_url":"https://github.com/shakyShane","followers_url":"https://api.github.com/users/shakyShane/followers","following_url":"https://api.github.com/users/shakyShane/following{/other_user}","gists_url":"https://api.github.com/users/shakyShane/gists{/gist_id}","starred_url":"https://api.github.com/users/shakyShane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shakyShane/subscriptions","organizations_url":"https://api.github.com/users/shakyShane/orgs","repos_url":"https://api.github.com/users/shakyShane/repos","events_url":"https://api.github.com/users/shakyShane/events{/privacy}","received_events_url":"https://api.github.com/users/shakyShane/received_events","type":"User","site_admin":false},"repo":{"id":22774071,"name":"html-injector","full_name":"shakyShane/html-injector","owner":{"login":"shakyShane","id":1643522,"avatar_url":"https://avatars.githubusercontent.com/u/1643522?v=3","gravatar_id":"","url":"https://api.github.com/users/shakyShane","html_url":"https://github.com/shakyShane","followers_url":"https://api.github.com/users/shakyShane/followers","following_url":"https://api.github.com/users/shakyShane/following{/other_user}","gists_url":"https://api.github.com/users/shakyShane/gists{/gist_id}","starred_url":"https://api.github.com/users/shakyShane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shakyShane/subscriptions","organizations_url":"https://api.github.com/users/shakyShane/orgs","repos_url":"https://api.github.com/users/shakyShane/repos","events_url":"https://api.github.com/users/shakyShane/events{/privacy}","received_events_url":"https://api.github.com/users/shakyShane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shakyShane/html-injector","description":"BrowserSync html injector","fork":false,"url":"https://api.github.com/repos/shakyShane/html-injector","forks_url":"https://api.github.com/repos/shakyShane/html-injector/forks","keys_url":"https://api.github.com/repos/shakyShane/html-injector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shakyShane/html-injector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shakyShane/html-injector/teams","hooks_url":"https://api.github.com/repos/shakyShane/html-injector/hooks","issue_events_url":"https://api.github.com/repos/shakyShane/html-injector/issues/events{/number}","events_url":"https://api.github.com/repos/shakyShane/html-injector/events","assignees_url":"https://api.github.com/repos/shakyShane/html-injector/assignees{/user}","branches_url":"https://api.github.com/repos/shakyShane/html-injector/branches{/branch}","tags_url":"https://api.github.com/repos/shakyShane/html-injector/tags","blobs_url":"https://api.github.com/repos/shakyShane/html-injector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shakyShane/html-injector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shakyShane/html-injector/git/refs{/sha}","trees_url":"https://api.github.com/repos/shakyShane/html-injector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shakyShane/html-injector/statuses/{sha}","languages_url":"https://api.github.com/repos/shakyShane/html-injector/languages","stargazers_url":"https://api.github.com/repos/shakyShane/html-injector/stargazers","contributors_url":"https://api.github.com/repos/shakyShane/html-injector/contributors","subscribers_url":"https://api.github.com/repos/shakyShane/html-injector/subscribers","subscription_url":"https://api.github.com/repos/shakyShane/html-injector/subscription","commits_url":"https://api.github.com/repos/shakyShane/html-injector/commits{/sha}","git_commits_url":"https://api.github.com/repos/shakyShane/html-injector/git/commits{/sha}","comments_url":"https://api.github.com/repos/shakyShane/html-injector/comments{/number}","issue_comment_url":"https://api.github.com/repos/shakyShane/html-injector/issues/comments{/number}","contents_url":"https://api.github.com/repos/shakyShane/html-injector/contents/{+path}","compare_url":"https://api.github.com/repos/shakyShane/html-injector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shakyShane/html-injector/merges","archive_url":"https://api.github.com/repos/shakyShane/html-injector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shakyShane/html-injector/downloads","issues_url":"https://api.github.com/repos/shakyShane/html-injector/issues{/number}","pulls_url":"https://api.github.com/repos/shakyShane/html-injector/pulls{/number}","milestones_url":"https://api.github.com/repos/shakyShane/html-injector/milestones{/number}","notifications_url":"https://api.github.com/repos/shakyShane/html-injector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shakyShane/html-injector/labels{/name}","releases_url":"https://api.github.com/repos/shakyShane/html-injector/releases{/id}","deployments_url":"https://api.github.com/repos/shakyShane/html-injector/deployments","created_at":"2014-08-08T23:11:34Z","updated_at":"2016-02-04T13:07:57Z","pushed_at":"2015-11-04T13:57:02Z","git_url":"git://github.com/shakyShane/html-injector.git","ssh_url":"git@github.com:shakyShane/html-injector.git","clone_url":"https://github.com/shakyShane/html-injector.git","svn_url":"https://github.com/shakyShane/html-injector","homepage":null,"size":586,"stargazers_count":34,"watchers_count":34,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":4,"forks":6,"open_issues":4,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shakyShane/html-injector/pulls/19"},"html":{"href":"https://github.com/shakyShane/html-injector/pull/19"},"issue":{"href":"https://api.github.com/repos/shakyShane/html-injector/issues/19"},"comments":{"href":"https://api.github.com/repos/shakyShane/html-injector/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/shakyShane/html-injector/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/shakyShane/html-injector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shakyShane/html-injector/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/shakyShane/html-injector/statuses/33576694fcaff22650b5347a9392ce4a05f2d0db"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":24,"deletions":21,"changed_files":1}}