{"action":"created","issue":{"url":"https://api.github.com/repos/allinurl/goaccess/issues/472","repository_url":"https://api.github.com/repos/allinurl/goaccess","labels_url":"https://api.github.com/repos/allinurl/goaccess/issues/472/labels{/name}","comments_url":"https://api.github.com/repos/allinurl/goaccess/issues/472/comments","events_url":"https://api.github.com/repos/allinurl/goaccess/issues/472/events","html_url":"https://github.com/allinurl/goaccess/issues/472","id":165474429,"number":472,"title":"HTML output not compatible with Microsoft Edge","user":{"login":"kokhoon","id":1871397,"avatar_url":"https://avatars.githubusercontent.com/u/1871397?v=3","gravatar_id":"","url":"https://api.github.com/users/kokhoon","html_url":"https://github.com/kokhoon","followers_url":"https://api.github.com/users/kokhoon/followers","following_url":"https://api.github.com/users/kokhoon/following{/other_user}","gists_url":"https://api.github.com/users/kokhoon/gists{/gist_id}","starred_url":"https://api.github.com/users/kokhoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokhoon/subscriptions","organizations_url":"https://api.github.com/users/kokhoon/orgs","repos_url":"https://api.github.com/users/kokhoon/repos","events_url":"https://api.github.com/users/kokhoon/events{/privacy}","received_events_url":"https://api.github.com/users/kokhoon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/allinurl/goaccess/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-14T04:39:55Z","updated_at":"2016-07-15T14:16:47Z","closed_at":null,"body":"I generated an HTML output using version 1.0.2 which renders nicely under Firefox and Chrome.\r\nHowever, under Microsoft Edge, there are some issues with 'localStorage' being undefined.\r\nI fixed the above by introducing additional checks at lines that references 'localStorage'\r\n\r\nThis allows the rendering to complete, however, I noticed the \"Unique visitors\" chart was overflowing (draws outside of its rectangle region)\r\nThat led me to devise another workaround so that the HTML output now works well enough under Microsoft Edge.\r\n\r\nHere is the required patch for \"resource/js/app.js\":\r\n\r\n```\r\ngit diff resources/js/app.js\r\ndiff --git a/resources/js/app.js b/resources/js/app.js\r\nindex ef52e42..e1ff6cd 100644\r\n--- a/resources/js/app.js\r\n+++ b/resources/js/app.js\r\n@@ -30,8 +30,10 @@ window.GoAccess = window.GoAccess || {\r\n                        'perPage': 10,\r\n                };\r\n\r\n-               var ls = JSON.parse(localStorage.getItem('AppPrefs'));\r\n-               this.AppPrefs = GoAccess.Util.merge(this.AppPrefs, ls);\r\n+               if (localStorage != undefined) {\r\n+                       var ls = JSON.parse(localStorage.getItem('AppPrefs'));\r\n+                       this.AppPrefs = GoAccess.Util.merge(this.AppPrefs, ls);\r\n+               }\r\n                if (Object.keys(this.AppWSConn).length)\r\n                        this.setWebSocket(this.AppWSConn);\r\n        },\r\n@@ -45,7 +47,8 @@ window.GoAccess = window.GoAccess || {\r\n        },\r\n\r\n        setPrefs: function () {\r\n-               localStorage.setItem('AppPrefs', JSON.stringify(GoAccess.getPrefs()));\r\n+               if (localStorage != undefined)\r\n+                       localStorage.setItem('AppPrefs', JSON.stringify(GoAccess.getPrefs()));\r\n        },\r\n\r\n        getPanelData: function (panel) {\r\n@@ -1256,6 +1259,10 @@ window.onload = function () {\r\n        });\r\n        GoAccess.App.initialize();\r\n\r\n+       //Work-around for \"visitors\" chart overflowing under Microsoft Edge\r\n+       if (/Edge\\/\\d./i.test(navigator.userAgent))\r\n+               d3.select(\"#chart-visitors\").call(GoAccess.AppCharts[\"visitors\"].width($(\"#chart-visitors\").offsetWidth))\r\n+\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/allinurl/goaccess/issues/comments/232962581","html_url":"https://github.com/allinurl/goaccess/issues/472#issuecomment-232962581","issue_url":"https://api.github.com/repos/allinurl/goaccess/issues/472","id":232962581,"user":{"login":"allinurl","id":5005367,"avatar_url":"https://avatars.githubusercontent.com/u/5005367?v=3","gravatar_id":"","url":"https://api.github.com/users/allinurl","html_url":"https://github.com/allinurl","followers_url":"https://api.github.com/users/allinurl/followers","following_url":"https://api.github.com/users/allinurl/following{/other_user}","gists_url":"https://api.github.com/users/allinurl/gists{/gist_id}","starred_url":"https://api.github.com/users/allinurl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allinurl/subscriptions","organizations_url":"https://api.github.com/users/allinurl/orgs","repos_url":"https://api.github.com/users/allinurl/repos","events_url":"https://api.github.com/users/allinurl/events{/privacy}","received_events_url":"https://api.github.com/users/allinurl/received_events","type":"User","site_admin":false},"created_at":"2016-07-15T14:16:47Z","updated_at":"2016-07-15T14:16:47Z","body":"I was able to reproduce this. I'll look into it and implement the fix. Thanks"}}
{"actor":{"display_login":"allinurl"}}