{"action":"created","comment":{"url":"https://api.github.com/repos/apiraino/link_cleaner/pulls/comments/238438797","pull_request_review_id":180981446,"id":238438797,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODQzODc5Nw==","diff_hunk":"@@ -8,8 +8,39 @@\n \n var global_link_text = '';\n \n+function maybe_clean (orig_url, regexp, f) {\n+    var res = '';\n+    for (var pat in regexp) {\n+        if (new RegExp(pat).test(orig_url)) {\n+            res = link_cleaner(orig_url, f)['redirectUrl'];\n+            break;\n+        }\n+    }\n+    return (res != '' ? res : orig_url);\n+}\n+\n+function cleaner_entrypoint (orig_link) {","path":"copy.js","position":22,"original_position":15,"commit_id":"b984be015d3ab67813376ee653b91af043746fdf","original_commit_id":"3a2866409c5970339b6160c6f7666e6e210eb926","user":{"login":"apiraino","id":6098822,"node_id":"MDQ6VXNlcjYwOTg4MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6098822?v=4","gravatar_id":"","url":"https://api.github.com/users/apiraino","html_url":"https://github.com/apiraino","followers_url":"https://api.github.com/users/apiraino/followers","following_url":"https://api.github.com/users/apiraino/following{/other_user}","gists_url":"https://api.github.com/users/apiraino/gists{/gist_id}","starred_url":"https://api.github.com/users/apiraino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiraino/subscriptions","organizations_url":"https://api.github.com/users/apiraino/orgs","repos_url":"https://api.github.com/users/apiraino/repos","events_url":"https://api.github.com/users/apiraino/events{/privacy}","received_events_url":"https://api.github.com/users/apiraino/received_events","type":"User","site_admin":false},"body":"And this is part that hurts.\r\n\r\nIn order to respond to user action (requesting to clean a URL), I'm basically replicating what the browser does in `background.js` - matching the URL and decide to apply or not a certain cleaning function.\r\n\r\nI guess, though, that running so much regexping like this hitting hard on performance, but this is just a proof of my proposal for the feature (implementing the cleaning action on the menu item). If the idea is sound and makes sense, we can improve here and try to reduce the memory footprint.","created_at":"2018-12-03T21:12:02Z","updated_at":"2018-12-03T21:12:02Z","html_url":"https://github.com/apiraino/link_cleaner/pull/3#discussion_r238438797","pull_request_url":"https://api.github.com/repos/apiraino/link_cleaner/pulls/3","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/apiraino/link_cleaner/pulls/comments/238438797"},"html":{"href":"https://github.com/apiraino/link_cleaner/pull/3#discussion_r238438797"},"pull_request":{"href":"https://api.github.com/repos/apiraino/link_cleaner/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/apiraino/link_cleaner/pulls/3","id":232331016,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyMzMxMDE2","html_url":"https://github.com/apiraino/link_cleaner/pull/3","diff_url":"https://github.com/apiraino/link_cleaner/pull/3.diff","patch_url":"https://github.com/apiraino/link_cleaner/pull/3.patch","issue_url":"https://api.github.com/repos/apiraino/link_cleaner/issues/3","number":3,"state":"open","locked":false,"title":"Refactor extension","user":{"login":"apiraino","id":6098822,"node_id":"MDQ6VXNlcjYwOTg4MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6098822?v=4","gravatar_id":"","url":"https://api.github.com/users/apiraino","html_url":"https://github.com/apiraino","followers_url":"https://api.github.com/users/apiraino/followers","following_url":"https://api.github.com/users/apiraino/following{/other_user}","gists_url":"https://api.github.com/users/apiraino/gists{/gist_id}","starred_url":"https://api.github.com/users/apiraino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiraino/subscriptions","organizations_url":"https://api.github.com/users/apiraino/orgs","repos_url":"https://api.github.com/users/apiraino/repos","events_url":"https://api.github.com/users/apiraino/events{/privacy}","received_events_url":"https://api.github.com/users/apiraino/received_events","type":"User","site_admin":false},"body":"- [x] split modules in smaller units\r\n- [x] add user config options\r\n- [x] add localization\r\n- [x] add right menu item action (not fully implemented)\r\n\r\nreplaces pr #1 ","created_at":"2018-11-20T14:11:52Z","updated_at":"2018-12-03T21:12:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd8b070567e04057e551c8dfcf61aed89e5ba304","assignee":{"login":"apiraino","id":6098822,"node_id":"MDQ6VXNlcjYwOTg4MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6098822?v=4","gravatar_id":"","url":"https://api.github.com/users/apiraino","html_url":"https://github.com/apiraino","followers_url":"https://api.github.com/users/apiraino/followers","following_url":"https://api.github.com/users/apiraino/following{/other_user}","gists_url":"https://api.github.com/users/apiraino/gists{/gist_id}","starred_url":"https://api.github.com/users/apiraino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiraino/subscriptions","organizations_url":"https://api.github.com/users/apiraino/orgs","repos_url":"https://api.github.com/users/apiraino/repos","events_url":"https://api.github.com/users/apiraino/events{/privacy}","received_events_url":"https://api.github.com/users/apiraino/received_events","type":"User","site_admin":false},"assignees":[{"login":"apiraino","id":6098822,"node_id":"MDQ6VXNlcjYwOTg4MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6098822?v=4","gravatar_id":"","url":"https://api.github.com/users/apiraino","html_url":"https://github.com/apiraino","followers_url":"https://api.github.com/users/apiraino/followers","following_url":"https://api.github.com/users/apiraino/following{/other_user}","gists_url":"https://api.github.com/users/apiraino/gists{/gist_id}","starred_url":"https://api.github.com/users/apiraino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiraino/subscriptions","organizations_url":"https://api.github.com/users/apiraino/orgs","repos_url":"https://api.github.com/users/apiraino/repos","events_url":"https://api.github.com/users/apiraino/events{/privacy}","received_events_url":"https://api.github.com/users/apiraino/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apiraino/link_cleaner/pulls/3/commits","review_comments_url":"https://api.github.com/repos/apiraino/link_cleaner/pulls/3/comments","review_comment_url":"https://api.github.com/repos/apiraino/link_cleaner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apiraino/link_cleaner/issues/3/comments","statuses_url":"https://api.github.com/repos/apiraino/link_cleaner/statuses/b984be015d3ab67813376ee653b91af043746fdf","head":{"label":"apiraino:refactor_extension_take_2","ref":"refactor_extension_take_2","sha":"b984be015d3ab67813376ee653b91af043746fdf","user":{"login":"apiraino","id":6098822,"node_id":"MDQ6VXNlcjYwOTg4MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6098822?v=4","gravatar_id":"","url":"https://api.github.com/users/apiraino","html_url":"https://github.com/apiraino","followers_url":"https://api.github.com/users/apiraino/followers","following_url":"https://api.github.com/users/apiraino/following{/other_user}","gists_url":"https://api.github.com/users/apiraino/gists{/gist_id}","starred_url":"https://api.github.com/users/apiraino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiraino/subscriptions","organizations_url":"https://api.github.com/users/apiraino/orgs","repos_url":"https://api.github.com/users/apiraino/repos","events_url":"https://api.github.com/users/apiraino/events{/privacy}","received_events_url":"https://api.github.com/users/apiraino/received_events","type":"User","site_admin":false},"repo":{"id":149789556,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3ODk1NTY=","name":"link_cleaner","full_name":"apiraino/link_cleaner","private":false,"owner":{"login":"apiraino","id":6098822,"node_id":"MDQ6VXNlcjYwOTg4MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6098822?v=4","gravatar_id":"","url":"https://api.github.com/users/apiraino","html_url":"https://github.com/apiraino","followers_url":"https://api.github.com/users/apiraino/followers","following_url":"https://api.github.com/users/apiraino/following{/other_user}","gists_url":"https://api.github.com/users/apiraino/gists{/gist_id}","starred_url":"https://api.github.com/users/apiraino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiraino/subscriptions","organizations_url":"https://api.github.com/users/apiraino/orgs","repos_url":"https://api.github.com/users/apiraino/repos","events_url":"https://api.github.com/users/apiraino/events{/privacy}","received_events_url":"https://api.github.com/users/apiraino/received_events","type":"User","site_admin":false},"html_url":"https://github.com/apiraino/link_cleaner","description":"Browser Webextension to clean urls from utm_* and amazon/aliexpress product pages from useless tracking parameters","fork":true,"url":"https://api.github.com/repos/apiraino/link_cleaner","forks_url":"https://api.github.com/repos/apiraino/link_cleaner/forks","keys_url":"https://api.github.com/repos/apiraino/link_cleaner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiraino/link_cleaner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiraino/link_cleaner/teams","hooks_url":"https://api.github.com/repos/apiraino/link_cleaner/hooks","issue_events_url":"https://api.github.com/repos/apiraino/link_cleaner/issues/events{/number}","events_url":"https://api.github.com/repos/apiraino/link_cleaner/events","assignees_url":"https://api.github.com/repos/apiraino/link_cleaner/assignees{/user}","branches_url":"https://api.github.com/repos/apiraino/link_cleaner/branches{/branch}","tags_url":"https://api.github.com/repos/apiraino/link_cleaner/tags","blobs_url":"https://api.github.com/repos/apiraino/link_cleaner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiraino/link_cleaner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiraino/link_cleaner/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiraino/link_cleaner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiraino/link_cleaner/statuses/{sha}","languages_url":"https://api.github.com/repos/apiraino/link_cleaner/languages","stargazers_url":"https://api.github.com/repos/apiraino/link_cleaner/stargazers","contributors_url":"https://api.github.com/repos/apiraino/link_cleaner/contributors","subscribers_url":"https://api.github.com/repos/apiraino/link_cleaner/subscribers","subscription_url":"https://api.github.com/repos/apiraino/link_cleaner/subscription","commits_url":"https://api.github.com/repos/apiraino/link_cleaner/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiraino/link_cleaner/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiraino/link_cleaner/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiraino/link_cleaner/issues/comments{/number}","contents_url":"https://api.github.com/repos/apiraino/link_cleaner/contents/{+path}","compare_url":"https://api.github.com/repos/apiraino/link_cleaner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiraino/link_cleaner/merges","archive_url":"https://api.github.com/repos/apiraino/link_cleaner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiraino/link_cleaner/downloads","issues_url":"https://api.github.com/repos/apiraino/link_cleaner/issues{/number}","pulls_url":"https://api.github.com/repos/apiraino/link_cleaner/pulls{/number}","milestones_url":"https://api.github.com/repos/apiraino/link_cleaner/milestones{/number}","notifications_url":"https://api.github.com/repos/apiraino/link_cleaner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiraino/link_cleaner/labels{/name}","releases_url":"https://api.github.com/repos/apiraino/link_cleaner/releases{/id}","deployments_url":"https://api.github.com/repos/apiraino/link_cleaner/deployments","created_at":"2018-09-21T16:27:27Z","updated_at":"2018-11-19T08:34:01Z","pushed_at":"2018-12-03T21:01:29Z","git_url":"git://github.com/apiraino/link_cleaner.git","ssh_url":"git@github.com:apiraino/link_cleaner.git","clone_url":"https://github.com/apiraino/link_cleaner.git","svn_url":"https://github.com/apiraino/link_cleaner","homepage":null,"size":57,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"apiraino:master","ref":"master","sha":"017e26369cb23d6f0fc81537e938e6711aedd12e","user":{"login":"apiraino","id":6098822,"node_id":"MDQ6VXNlcjYwOTg4MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6098822?v=4","gravatar_id":"","url":"https://api.github.com/users/apiraino","html_url":"https://github.com/apiraino","followers_url":"https://api.github.com/users/apiraino/followers","following_url":"https://api.github.com/users/apiraino/following{/other_user}","gists_url":"https://api.github.com/users/apiraino/gists{/gist_id}","starred_url":"https://api.github.com/users/apiraino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiraino/subscriptions","organizations_url":"https://api.github.com/users/apiraino/orgs","repos_url":"https://api.github.com/users/apiraino/repos","events_url":"https://api.github.com/users/apiraino/events{/privacy}","received_events_url":"https://api.github.com/users/apiraino/received_events","type":"User","site_admin":false},"repo":{"id":149789556,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3ODk1NTY=","name":"link_cleaner","full_name":"apiraino/link_cleaner","private":false,"owner":{"login":"apiraino","id":6098822,"node_id":"MDQ6VXNlcjYwOTg4MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6098822?v=4","gravatar_id":"","url":"https://api.github.com/users/apiraino","html_url":"https://github.com/apiraino","followers_url":"https://api.github.com/users/apiraino/followers","following_url":"https://api.github.com/users/apiraino/following{/other_user}","gists_url":"https://api.github.com/users/apiraino/gists{/gist_id}","starred_url":"https://api.github.com/users/apiraino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiraino/subscriptions","organizations_url":"https://api.github.com/users/apiraino/orgs","repos_url":"https://api.github.com/users/apiraino/repos","events_url":"https://api.github.com/users/apiraino/events{/privacy}","received_events_url":"https://api.github.com/users/apiraino/received_events","type":"User","site_admin":false},"html_url":"https://github.com/apiraino/link_cleaner","description":"Browser Webextension to clean urls from utm_* and amazon/aliexpress product pages from useless tracking parameters","fork":true,"url":"https://api.github.com/repos/apiraino/link_cleaner","forks_url":"https://api.github.com/repos/apiraino/link_cleaner/forks","keys_url":"https://api.github.com/repos/apiraino/link_cleaner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiraino/link_cleaner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiraino/link_cleaner/teams","hooks_url":"https://api.github.com/repos/apiraino/link_cleaner/hooks","issue_events_url":"https://api.github.com/repos/apiraino/link_cleaner/issues/events{/number}","events_url":"https://api.github.com/repos/apiraino/link_cleaner/events","assignees_url":"https://api.github.com/repos/apiraino/link_cleaner/assignees{/user}","branches_url":"https://api.github.com/repos/apiraino/link_cleaner/branches{/branch}","tags_url":"https://api.github.com/repos/apiraino/link_cleaner/tags","blobs_url":"https://api.github.com/repos/apiraino/link_cleaner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiraino/link_cleaner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiraino/link_cleaner/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiraino/link_cleaner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiraino/link_cleaner/statuses/{sha}","languages_url":"https://api.github.com/repos/apiraino/link_cleaner/languages","stargazers_url":"https://api.github.com/repos/apiraino/link_cleaner/stargazers","contributors_url":"https://api.github.com/repos/apiraino/link_cleaner/contributors","subscribers_url":"https://api.github.com/repos/apiraino/link_cleaner/subscribers","subscription_url":"https://api.github.com/repos/apiraino/link_cleaner/subscription","commits_url":"https://api.github.com/repos/apiraino/link_cleaner/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiraino/link_cleaner/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiraino/link_cleaner/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiraino/link_cleaner/issues/comments{/number}","contents_url":"https://api.github.com/repos/apiraino/link_cleaner/contents/{+path}","compare_url":"https://api.github.com/repos/apiraino/link_cleaner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiraino/link_cleaner/merges","archive_url":"https://api.github.com/repos/apiraino/link_cleaner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiraino/link_cleaner/downloads","issues_url":"https://api.github.com/repos/apiraino/link_cleaner/issues{/number}","pulls_url":"https://api.github.com/repos/apiraino/link_cleaner/pulls{/number}","milestones_url":"https://api.github.com/repos/apiraino/link_cleaner/milestones{/number}","notifications_url":"https://api.github.com/repos/apiraino/link_cleaner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiraino/link_cleaner/labels{/name}","releases_url":"https://api.github.com/repos/apiraino/link_cleaner/releases{/id}","deployments_url":"https://api.github.com/repos/apiraino/link_cleaner/deployments","created_at":"2018-09-21T16:27:27Z","updated_at":"2018-11-19T08:34:01Z","pushed_at":"2018-12-03T21:01:29Z","git_url":"git://github.com/apiraino/link_cleaner.git","ssh_url":"git@github.com:apiraino/link_cleaner.git","clone_url":"https://github.com/apiraino/link_cleaner.git","svn_url":"https://github.com/apiraino/link_cleaner","homepage":null,"size":57,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apiraino/link_cleaner/pulls/3"},"html":{"href":"https://github.com/apiraino/link_cleaner/pull/3"},"issue":{"href":"https://api.github.com/repos/apiraino/link_cleaner/issues/3"},"comments":{"href":"https://api.github.com/repos/apiraino/link_cleaner/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/apiraino/link_cleaner/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/apiraino/link_cleaner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apiraino/link_cleaner/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/apiraino/link_cleaner/statuses/b984be015d3ab67813376ee653b91af043746fdf"}},"author_association":"OWNER"}}
{"actor":{"display_login":"apiraino"}}