{"action":"opened","issue":{"url":"https://api.github.com/repos/FooSoft/yomichan/issues/80","repository_url":"https://api.github.com/repos/FooSoft/yomichan","labels_url":"https://api.github.com/repos/FooSoft/yomichan/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/FooSoft/yomichan/issues/80/comments","events_url":"https://api.github.com/repos/FooSoft/yomichan/issues/80/events","html_url":"https://github.com/FooSoft/yomichan/issues/80","id":258930008,"number":80,"title":"[bug] Error: IndexSizeError: Index or size is negative or greater than the allowed amount","user":{"login":"siikamiika","id":5602483,"avatar_url":"https://avatars1.githubusercontent.com/u/5602483?v=4","gravatar_id":"","url":"https://api.github.com/users/siikamiika","html_url":"https://github.com/siikamiika","followers_url":"https://api.github.com/users/siikamiika/followers","following_url":"https://api.github.com/users/siikamiika/following{/other_user}","gists_url":"https://api.github.com/users/siikamiika/gists{/gist_id}","starred_url":"https://api.github.com/users/siikamiika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siikamiika/subscriptions","organizations_url":"https://api.github.com/users/siikamiika/orgs","repos_url":"https://api.github.com/users/siikamiika/repos","events_url":"https://api.github.com/users/siikamiika/events{/privacy}","received_events_url":"https://api.github.com/users/siikamiika/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-19T19:07:39Z","updated_at":"2017-09-19T19:07:39Z","closed_at":null,"author_association":"NONE","body":"**Summary:**\r\nOn some sites I get the alert `Error: IndexSizeError: Index or size is negative or greater than the allowed amount` when scanning.\r\n\r\n**Steps to reproduce:**\r\n1. Open this test case (Firefox 55, Linux or Windows):\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n    <head>\r\n        <meta charset=\"utf-8\">\r\n        <title>IndexSizeError</title>\r\n    </head>\r\n    <body>\r\n        <form method=\"get\" action=\"https://test\"><div><input name=\"test\" value=\"123\" type=\"hidden\"><input value=\"test\" type=\"submit\"></div></form>\r\n    </body>\r\n</html>\r\n```\r\n2. Scan anywhere on the page.\r\n\r\n**Expected results:**\r\nNothing should happen because there is no text under the mouse cursor.\r\n\r\n**Actual results:**\r\nYou get an alert with the text  `Error: IndexSizeError: Index or size is negative or greater than the allowed amount`.\r\n\r\n---\r\n\r\n**More info:**\r\n- The error in this case has something to do with the `<form>` being an one-liner. If I add newlines between `<form>` and `<div>`, there are no errors.\r\n- On dev branch, the error appears to originate from https://github.com/FooSoft/yomichan/blob/5476c100467e31d7dac02a4b1c14e62a4e9b34d0/ext/fg/js/frontend.js#L176 or a corresponding line on current master https://github.com/FooSoft/yomichan/blob/0c650dac828b7ab9641396268a66d3a7410d4000/ext/fg/js/frontend.js#L180 (`textSource.containsPoint(point)`)\r\n- I don't think that there are bad consequences from silently ignoring this error unless it can be reproduced with something that actually contains text.\r\n- I cannot reproduce it on Chrome/Chromium."}}
{"actor":{"display_login":"siikamiika"}}