{"action":"created","issue":{"url":"https://api.github.com/repos/sanex3339/javascript-obfuscator/issues/12","repository_url":"https://api.github.com/repos/sanex3339/javascript-obfuscator","labels_url":"https://api.github.com/repos/sanex3339/javascript-obfuscator/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/sanex3339/javascript-obfuscator/issues/12/comments","events_url":"https://api.github.com/repos/sanex3339/javascript-obfuscator/issues/12/events","html_url":"https://github.com/sanex3339/javascript-obfuscator/issues/12","id":174402693,"number":12,"title":"Domain lock WIP feature","user":{"login":"slig","id":37779,"avatar_url":"https://avatars.githubusercontent.com/u/37779?v=3","gravatar_id":"","url":"https://api.github.com/users/slig","html_url":"https://github.com/slig","followers_url":"https://api.github.com/users/slig/followers","following_url":"https://api.github.com/users/slig/following{/other_user}","gists_url":"https://api.github.com/users/slig/gists{/gist_id}","starred_url":"https://api.github.com/users/slig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slig/subscriptions","organizations_url":"https://api.github.com/users/slig/orgs","repos_url":"https://api.github.com/users/slig/repos","events_url":"https://api.github.com/users/slig/events{/privacy}","received_events_url":"https://api.github.com/users/slig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-08-31T23:26:35Z","updated_at":"2016-10-02T20:09:35Z","closed_at":null,"body":"Hi,\r\n\r\nI've been studying your project and I loved it. Thanks for sharing.\r\n\r\nI started a feature that I'm going to use and I'd like to know if you're interested in adding it to your project (I can create a PR) and if you can help me with some questions.\r\n\r\nHere's what I've come up with: https://github.com/slig/javascript-obfuscator/tree/domain-lock\r\n\r\nThings working right now:\r\n\r\n- [x] Multiple domains and subdomains. (e.g: \".example.com\" allows any example.com subdomain, and \"example.com\" matches exactly with \"example.com\"\r\n\r\nThings that need to be done:\r\n\r\n- [x] Now it only shows an alert displaying if the current domain is allowed or not. I've thought of using an while(1) or throwing an exception, and both seem to work, but I'm not sure what's the best, or what is the one that you recommend;\r\n- [ ] Update the README;\r\n- [ ] Write proper tests (not sure how to test this kind of feature, I'd love to hear your input);\r\n\r\nRandom questions:\r\n\r\n- I wrote a simple function to hide the domain list inside a string and use a RegExp on the browser to get back the string. I found this method to be more resilient against closure compiler pretty print. What do you think?\r\n- Should this feature be appended before the obfuscation or after? Right now I'm using before.\r\n- For now, the code on DomainLockTemplate.ts is unobfuscated. Should I run it on jscrush or leave it as this?\r\n\r\nThank you very much for your time and patience!"},"comment":{"url":"https://api.github.com/repos/sanex3339/javascript-obfuscator/issues/comments/250992595","html_url":"https://github.com/sanex3339/javascript-obfuscator/issues/12#issuecomment-250992595","issue_url":"https://api.github.com/repos/sanex3339/javascript-obfuscator/issues/12","id":250992595,"user":{"login":"sanex3339","id":9210534,"avatar_url":"https://avatars.githubusercontent.com/u/9210534?v=3","gravatar_id":"","url":"https://api.github.com/users/sanex3339","html_url":"https://github.com/sanex3339","followers_url":"https://api.github.com/users/sanex3339/followers","following_url":"https://api.github.com/users/sanex3339/following{/other_user}","gists_url":"https://api.github.com/users/sanex3339/gists{/gist_id}","starred_url":"https://api.github.com/users/sanex3339/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanex3339/subscriptions","organizations_url":"https://api.github.com/users/sanex3339/orgs","repos_url":"https://api.github.com/users/sanex3339/repos","events_url":"https://api.github.com/users/sanex3339/events{/privacy}","received_events_url":"https://api.github.com/users/sanex3339/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T20:09:35Z","updated_at":"2016-10-02T20:09:35Z","body":"For this, some previous and all next custom nodes i make two classes for intellectual getting node in which custom node should be appended.\r\n\r\nhttps://github.com/sanex3339/javascript-obfuscator/commit/8571cef294d870af95a6d2b913ee0fa3fdd6be43\r\n\r\nfor example following code:\r\n\r\n```javascript\r\nfunction foo () {\r\n\r\n}\r\n\r\nfunction bar () {\r\n    function inner1 () {\r\n    \r\n    }\r\n\r\n    function inner2 () {\r\n        var inner3 = function () {\r\n            \r\n        }\r\n        \r\n        inner3();\r\n    }\r\n    \r\n    inner2();\r\n    inner1();\r\n}\r\n\r\nfunction baz () {\r\n\r\n}\r\n\r\nbaz(); // first call expression\r\nfoo();\r\nbar();\r\n```\r\n\r\nCustom node will be inserted into `baz` function declaration block statement, because `CallExpression` of this function declaration is first in order of call expressions.\r\n\r\nNext example:\r\n\r\n```javascript\r\nfunction foo () {\r\n\r\n}\r\n\r\nfunction bar () {\r\n    function inner1 () {\r\n    \r\n    }\r\n\r\n    function inner2 () {\r\n        var inner3 = function () {\r\n            \r\n        }\r\n        \r\n        inner3(); // first call expression\r\n    }\r\n    \r\n    inner2(); // first call expression\r\n    inner1();\r\n}\r\n\r\nfunction baz () {\r\n\r\n}\r\n\r\nbar(); // first call expression\r\nfoo();\r\nbaz();\r\n```\r\n\r\nCustom node will be inserted into `inner3` function expression block statement, because `CallExpression`s chain has following structure:\r\n`bar() -> inner2() -> inner3()`\r\n\r\nWith this new classes custom nodes should be more hardest to observe."}}
{"actor":{"display_login":"sanex3339"}}