{"action":"created","comment":{"url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/comments/213121923","pull_request_review_id":149892244,"id":213121923,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzEyMTkyMw==","diff_hunk":"@@ -1216,12 +1216,43 @@\n \t\tfunction disableBrowserAutofill(dom) {\n \t\t\t//Does not disable autofill if config.autocomplete is disabled\n \t\t\tif (config.autocomplete > 0) {\n-\t\t\t\tfor (var i = 0; i < dom.getElementsByTagName(\"input\").length; i++) {\n-\t\t\t\t\tdom.getElementsByTagName(\"input\")[i].autocomplete = \"smartystreets\";\n+\t\t\t\tconst uniqueElementIds = getUniqueAddressInputIds();\n+\t\t\t\tfor (var i = 0; i < uniqueElementIds.length; i++) {\n+\t\t\t\t\tconst id = uniqueElementIds[i];\n+\t\t\t\t\tconst elem = dom.querySelector(normalizeId(id));\n+\t\t\t\t\tif (elem) {\n+\t\t\t\t\t\telem.autocomplete = \"smartystreets\";\n+\t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n+\t\tfunction normalizeId(id) {\n+\t\t\treturn '#' + id.replace('#', '');\n+\t\t}\n+\n+\t\tfunction getUniqueAddressInputIds() {\n+\t\t\tconst uniqueElementIds = [];\n+\n+\t\t\tconfig.addresses.forEach(address => {\n+\t\t\t\t// These might be strings, or maybe dom input references\n+\t\t\t\tconst objs = Object.keys(address).map(key => address[key]);\n+\t\t\t\tobjs.forEach((obj) => {\n+\t\t\t\t\tlet id;\n+\t\t\t\t\tif (typeof obj === 'string') {","path":"src/jquery.liveaddress.js","position":29,"original_position":29,"commit_id":"86eaadb66c70709306936235eab4342bb92ee786","original_commit_id":"86eaadb66c70709306936235eab4342bb92ee786","user":{"login":"camiblanch","id":6712788,"node_id":"MDQ6VXNlcjY3MTI3ODg=","avatar_url":"https://avatars1.githubusercontent.com/u/6712788?v=4","gravatar_id":"","url":"https://api.github.com/users/camiblanch","html_url":"https://github.com/camiblanch","followers_url":"https://api.github.com/users/camiblanch/followers","following_url":"https://api.github.com/users/camiblanch/following{/other_user}","gists_url":"https://api.github.com/users/camiblanch/gists{/gist_id}","starred_url":"https://api.github.com/users/camiblanch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camiblanch/subscriptions","organizations_url":"https://api.github.com/users/camiblanch/orgs","repos_url":"https://api.github.com/users/camiblanch/repos","events_url":"https://api.github.com/users/camiblanch/events{/privacy}","received_events_url":"https://api.github.com/users/camiblanch/received_events","type":"User","site_admin":false},"body":"I'm curious to as to what use case you see this coming in as a `string`. What is that use case?","created_at":"2018-08-27T21:29:19Z","updated_at":"2018-08-27T21:29:19Z","html_url":"https://github.com/smartystreets/jquery.liveaddress/pull/73#discussion_r213121923","pull_request_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/73","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/comments/213121923"},"html":{"href":"https://github.com/smartystreets/jquery.liveaddress/pull/73#discussion_r213121923"},"pull_request":{"href":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/73","id":209211261,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MjExMjYx","html_url":"https://github.com/smartystreets/jquery.liveaddress/pull/73","diff_url":"https://github.com/smartystreets/jquery.liveaddress/pull/73.diff","patch_url":"https://github.com/smartystreets/jquery.liveaddress/pull/73.patch","issue_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/issues/73","number":73,"state":"open","locked":false,"title":"Fix for setting autocomplete on only the requisite fields, and not al…","user":{"login":"btwelch","id":83845,"node_id":"MDQ6VXNlcjgzODQ1","avatar_url":"https://avatars0.githubusercontent.com/u/83845?v=4","gravatar_id":"","url":"https://api.github.com/users/btwelch","html_url":"https://github.com/btwelch","followers_url":"https://api.github.com/users/btwelch/followers","following_url":"https://api.github.com/users/btwelch/following{/other_user}","gists_url":"https://api.github.com/users/btwelch/gists{/gist_id}","starred_url":"https://api.github.com/users/btwelch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btwelch/subscriptions","organizations_url":"https://api.github.com/users/btwelch/orgs","repos_url":"https://api.github.com/users/btwelch/repos","events_url":"https://api.github.com/users/btwelch/events{/privacy}","received_events_url":"https://api.github.com/users/btwelch/received_events","type":"User","site_admin":false},"body":"Imagine you're filling out a registration form where SmartyStreets is used. All of your autocomplete fields are set to \"smartystreets\": your first name, last name, address... all the fields.\r\n\r\nYou fill out the form, no problems, Smartystreets works, yay!\r\n\r\nNow you come back to that same form, and update your information, Chrome is helpful, throwing up the autofill feature... and you're like \"Heck yeah, fill those fields for me Chrome!\"\r\n\r\nBut, since every input has autocomplete=\"smartystreets\"... every single input on the page gets your first name... and you're like \"Why, Smartystreets, why?\"\r\n\r\nI'm submitting this fix so that Smartystreets will mark autocomplete=\"smartystreets\" on only the requisite ADDRESS fields that you specify in config.addresses, and not all inputs, which can cause autocomplete to put undesired data into fields.\r\n\r\nThanks!","created_at":"2018-08-17T17:29:53Z","updated_at":"2018-08-27T21:29:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"370338a6d546a21d72e3fda36a1656462a5fc4e5","assignee":{"login":"camiblanch","id":6712788,"node_id":"MDQ6VXNlcjY3MTI3ODg=","avatar_url":"https://avatars1.githubusercontent.com/u/6712788?v=4","gravatar_id":"","url":"https://api.github.com/users/camiblanch","html_url":"https://github.com/camiblanch","followers_url":"https://api.github.com/users/camiblanch/followers","following_url":"https://api.github.com/users/camiblanch/following{/other_user}","gists_url":"https://api.github.com/users/camiblanch/gists{/gist_id}","starred_url":"https://api.github.com/users/camiblanch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camiblanch/subscriptions","organizations_url":"https://api.github.com/users/camiblanch/orgs","repos_url":"https://api.github.com/users/camiblanch/repos","events_url":"https://api.github.com/users/camiblanch/events{/privacy}","received_events_url":"https://api.github.com/users/camiblanch/received_events","type":"User","site_admin":false},"assignees":[{"login":"camiblanch","id":6712788,"node_id":"MDQ6VXNlcjY3MTI3ODg=","avatar_url":"https://avatars1.githubusercontent.com/u/6712788?v=4","gravatar_id":"","url":"https://api.github.com/users/camiblanch","html_url":"https://github.com/camiblanch","followers_url":"https://api.github.com/users/camiblanch/followers","following_url":"https://api.github.com/users/camiblanch/following{/other_user}","gists_url":"https://api.github.com/users/camiblanch/gists{/gist_id}","starred_url":"https://api.github.com/users/camiblanch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camiblanch/subscriptions","organizations_url":"https://api.github.com/users/camiblanch/orgs","repos_url":"https://api.github.com/users/camiblanch/repos","events_url":"https://api.github.com/users/camiblanch/events{/privacy}","received_events_url":"https://api.github.com/users/camiblanch/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/73/commits","review_comments_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/73/comments","review_comment_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/issues/73/comments","statuses_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/statuses/86eaadb66c70709306936235eab4342bb92ee786","head":{"label":"btwelch:master","ref":"master","sha":"86eaadb66c70709306936235eab4342bb92ee786","user":{"login":"btwelch","id":83845,"node_id":"MDQ6VXNlcjgzODQ1","avatar_url":"https://avatars0.githubusercontent.com/u/83845?v=4","gravatar_id":"","url":"https://api.github.com/users/btwelch","html_url":"https://github.com/btwelch","followers_url":"https://api.github.com/users/btwelch/followers","following_url":"https://api.github.com/users/btwelch/following{/other_user}","gists_url":"https://api.github.com/users/btwelch/gists{/gist_id}","starred_url":"https://api.github.com/users/btwelch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btwelch/subscriptions","organizations_url":"https://api.github.com/users/btwelch/orgs","repos_url":"https://api.github.com/users/btwelch/repos","events_url":"https://api.github.com/users/btwelch/events{/privacy}","received_events_url":"https://api.github.com/users/btwelch/received_events","type":"User","site_admin":false},"repo":{"id":145145031,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUxNDUwMzE=","name":"jquery.liveaddress","full_name":"btwelch/jquery.liveaddress","owner":{"login":"btwelch","id":83845,"node_id":"MDQ6VXNlcjgzODQ1","avatar_url":"https://avatars0.githubusercontent.com/u/83845?v=4","gravatar_id":"","url":"https://api.github.com/users/btwelch","html_url":"https://github.com/btwelch","followers_url":"https://api.github.com/users/btwelch/followers","following_url":"https://api.github.com/users/btwelch/following{/other_user}","gists_url":"https://api.github.com/users/btwelch/gists{/gist_id}","starred_url":"https://api.github.com/users/btwelch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btwelch/subscriptions","organizations_url":"https://api.github.com/users/btwelch/orgs","repos_url":"https://api.github.com/users/btwelch/repos","events_url":"https://api.github.com/users/btwelch/events{/privacy}","received_events_url":"https://api.github.com/users/btwelch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/btwelch/jquery.liveaddress","description":"LiveAddress API jQuery Plugin","fork":true,"url":"https://api.github.com/repos/btwelch/jquery.liveaddress","forks_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/forks","keys_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/teams","hooks_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/hooks","issue_events_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/issues/events{/number}","events_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/events","assignees_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/assignees{/user}","branches_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/branches{/branch}","tags_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/tags","blobs_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/git/refs{/sha}","trees_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/statuses/{sha}","languages_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/languages","stargazers_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/stargazers","contributors_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/contributors","subscribers_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/subscribers","subscription_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/subscription","commits_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/commits{/sha}","git_commits_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/git/commits{/sha}","comments_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/comments{/number}","issue_comment_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/issues/comments{/number}","contents_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/contents/{+path}","compare_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/merges","archive_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/downloads","issues_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/issues{/number}","pulls_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/pulls{/number}","milestones_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/milestones{/number}","notifications_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/labels{/name}","releases_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/releases{/id}","deployments_url":"https://api.github.com/repos/btwelch/jquery.liveaddress/deployments","created_at":"2018-08-17T16:47:51Z","updated_at":"2018-08-17T17:25:43Z","pushed_at":"2018-08-17T17:25:41Z","git_url":"git://github.com/btwelch/jquery.liveaddress.git","ssh_url":"git@github.com:btwelch/jquery.liveaddress.git","clone_url":"https://github.com/btwelch/jquery.liveaddress.git","svn_url":"https://github.com/btwelch/jquery.liveaddress","homepage":"https://smartystreets.com/docs/plugin","size":1772,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"smartystreets:master","ref":"master","sha":"9998ea280cad3f403f10012c7cd9ac8cbc22e48f","user":{"login":"smartystreets","id":969237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk2OTIzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/969237?v=4","gravatar_id":"","url":"https://api.github.com/users/smartystreets","html_url":"https://github.com/smartystreets","followers_url":"https://api.github.com/users/smartystreets/followers","following_url":"https://api.github.com/users/smartystreets/following{/other_user}","gists_url":"https://api.github.com/users/smartystreets/gists{/gist_id}","starred_url":"https://api.github.com/users/smartystreets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartystreets/subscriptions","organizations_url":"https://api.github.com/users/smartystreets/orgs","repos_url":"https://api.github.com/users/smartystreets/repos","events_url":"https://api.github.com/users/smartystreets/events{/privacy}","received_events_url":"https://api.github.com/users/smartystreets/received_events","type":"Organization","site_admin":false},"repo":{"id":6300956,"node_id":"MDEwOlJlcG9zaXRvcnk2MzAwOTU2","name":"jquery.liveaddress","full_name":"smartystreets/jquery.liveaddress","owner":{"login":"smartystreets","id":969237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk2OTIzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/969237?v=4","gravatar_id":"","url":"https://api.github.com/users/smartystreets","html_url":"https://github.com/smartystreets","followers_url":"https://api.github.com/users/smartystreets/followers","following_url":"https://api.github.com/users/smartystreets/following{/other_user}","gists_url":"https://api.github.com/users/smartystreets/gists{/gist_id}","starred_url":"https://api.github.com/users/smartystreets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartystreets/subscriptions","organizations_url":"https://api.github.com/users/smartystreets/orgs","repos_url":"https://api.github.com/users/smartystreets/repos","events_url":"https://api.github.com/users/smartystreets/events{/privacy}","received_events_url":"https://api.github.com/users/smartystreets/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smartystreets/jquery.liveaddress","description":"LiveAddress API jQuery Plugin","fork":false,"url":"https://api.github.com/repos/smartystreets/jquery.liveaddress","forks_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/forks","keys_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/teams","hooks_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/hooks","issue_events_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/issues/events{/number}","events_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/events","assignees_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/assignees{/user}","branches_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/branches{/branch}","tags_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/tags","blobs_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/git/refs{/sha}","trees_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/statuses/{sha}","languages_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/languages","stargazers_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/stargazers","contributors_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/contributors","subscribers_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/subscribers","subscription_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/subscription","commits_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/commits{/sha}","git_commits_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/git/commits{/sha}","comments_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/comments{/number}","issue_comment_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/issues/comments{/number}","contents_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/contents/{+path}","compare_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/merges","archive_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/downloads","issues_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/issues{/number}","pulls_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls{/number}","milestones_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/milestones{/number}","notifications_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/labels{/name}","releases_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/releases{/id}","deployments_url":"https://api.github.com/repos/smartystreets/jquery.liveaddress/deployments","created_at":"2012-10-19T20:10:08Z","updated_at":"2018-06-15T22:24:55Z","pushed_at":"2018-08-17T17:29:54Z","git_url":"git://github.com/smartystreets/jquery.liveaddress.git","ssh_url":"git@github.com:smartystreets/jquery.liveaddress.git","clone_url":"https://github.com/smartystreets/jquery.liveaddress.git","svn_url":"https://github.com/smartystreets/jquery.liveaddress","homepage":"https://smartystreets.com/docs/plugin","size":1771,"stargazers_count":82,"watchers_count":82,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":50,"open_issues":8,"watchers":82,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/73"},"html":{"href":"https://github.com/smartystreets/jquery.liveaddress/pull/73"},"issue":{"href":"https://api.github.com/repos/smartystreets/jquery.liveaddress/issues/73"},"comments":{"href":"https://api.github.com/repos/smartystreets/jquery.liveaddress/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smartystreets/jquery.liveaddress/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/smartystreets/jquery.liveaddress/statuses/86eaadb66c70709306936235eab4342bb92ee786"}},"author_association":"NONE"}}
{"actor":{"display_login":"camiblanch"}}