{"action":"created","issue":{"url":"https://api.github.com/repos/npny/mdn-automatic-translation/issues/8","repository_url":"https://api.github.com/repos/npny/mdn-automatic-translation","labels_url":"https://api.github.com/repos/npny/mdn-automatic-translation/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/npny/mdn-automatic-translation/issues/8/comments","events_url":"https://api.github.com/repos/npny/mdn-automatic-translation/issues/8/events","html_url":"https://github.com/npny/mdn-automatic-translation/issues/8","id":147323627,"number":8,"title":"Rules are cached forever","user":{"login":"SebastianZ","id":958943,"avatar_url":"https://avatars.githubusercontent.com/u/958943?v=3","gravatar_id":"","url":"https://api.github.com/users/SebastianZ","html_url":"https://github.com/SebastianZ","followers_url":"https://api.github.com/users/SebastianZ/followers","following_url":"https://api.github.com/users/SebastianZ/following{/other_user}","gists_url":"https://api.github.com/users/SebastianZ/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastianZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastianZ/subscriptions","organizations_url":"https://api.github.com/users/SebastianZ/orgs","repos_url":"https://api.github.com/users/SebastianZ/repos","events_url":"https://api.github.com/users/SebastianZ/events{/privacy}","received_events_url":"https://api.github.com/users/SebastianZ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-11T05:56:39Z","updated_at":"2016-04-11T11:12:08Z","closed_at":null,"body":"`window.localStorage` is written once but never emptied, which means the rules are stored forever unless you change the local storage manually.\r\n\r\nIt would be better to use `sessionStorage` instead, so the rules are reread from the extension everytime the browser is restarted (at least as long as there is no [easy] possibility to edit them).\r\n\r\nSebastian"},"comment":{"url":"https://api.github.com/repos/npny/mdn-automatic-translation/issues/comments/208290811","html_url":"https://github.com/npny/mdn-automatic-translation/issues/8#issuecomment-208290811","issue_url":"https://api.github.com/repos/npny/mdn-automatic-translation/issues/8","id":208290811,"user":{"login":"SebastianZ","id":958943,"avatar_url":"https://avatars.githubusercontent.com/u/958943?v=3","gravatar_id":"","url":"https://api.github.com/users/SebastianZ","html_url":"https://github.com/SebastianZ","followers_url":"https://api.github.com/users/SebastianZ/followers","following_url":"https://api.github.com/users/SebastianZ/following{/other_user}","gists_url":"https://api.github.com/users/SebastianZ/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastianZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastianZ/subscriptions","organizations_url":"https://api.github.com/users/SebastianZ/orgs","repos_url":"https://api.github.com/users/SebastianZ/repos","events_url":"https://api.github.com/users/SebastianZ/events{/privacy}","received_events_url":"https://api.github.com/users/SebastianZ/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T11:12:08Z","updated_at":"2016-04-11T11:12:08Z","body":"> Well, this was intended as a way for each person to customise their own rules locally by editing their localStorage instead of having to edit (and possibly repack) the extension everytime.\r\n\r\nI thought so. The main point of this issue is that when a new version of the extension is released, which contains new rules, the user would still have the old set of rules. (S)he needs to actively run `localStorage.clear()` to get the new rules (and by that also looses the custom rules).\r\n\r\n> Thus I propose instead:\r\n> \r\n> * Rules are taken from defaultRules directly\r\n> * At the user's request, we can write the rules in localStorage for him to edit, and use that instead.\r\n> ...\r\n> Though looking back at the whole thing it's probably the wrong way to go about it, and I could probably remove the localStorage thing altogether.\r\n\r\nThat sounds reasonable. The customization feature may be (re-)implemented later on with a proper editor. I've created issue #11 for that.\r\nNote that to avoid synching issues, I'd allow the user to define a separate set of rules, which is dynamically merged with the one defined in defaultRules. This also means that the user would **not** be allowed to change the default rules.\r\n\r\nSebastian"}}