{"action":"created","issue":{"url":"https://api.github.com/repos/typekit/webfontloader/issues/298","repository_url":"https://api.github.com/repos/typekit/webfontloader","labels_url":"https://api.github.com/repos/typekit/webfontloader/issues/298/labels{/name}","comments_url":"https://api.github.com/repos/typekit/webfontloader/issues/298/comments","events_url":"https://api.github.com/repos/typekit/webfontloader/issues/298/events","html_url":"https://github.com/typekit/webfontloader/issues/298","id":126020631,"number":298,"title":"Sometimes callback for loaded font is not called","user":{"login":"vetrovosk","id":843213,"avatar_url":"https://avatars.githubusercontent.com/u/843213?v=3","gravatar_id":"","url":"https://api.github.com/users/vetrovosk","html_url":"https://github.com/vetrovosk","followers_url":"https://api.github.com/users/vetrovosk/followers","following_url":"https://api.github.com/users/vetrovosk/following{/other_user}","gists_url":"https://api.github.com/users/vetrovosk/gists{/gist_id}","starred_url":"https://api.github.com/users/vetrovosk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vetrovosk/subscriptions","organizations_url":"https://api.github.com/users/vetrovosk/orgs","repos_url":"https://api.github.com/users/vetrovosk/repos","events_url":"https://api.github.com/users/vetrovosk/events{/privacy}","received_events_url":"https://api.github.com/users/vetrovosk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-11T19:40:47Z","updated_at":"2016-02-19T11:51:39Z","closed_at":null,"body":"I have a simple page:\r\n\r\n```\r\n<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>Title</title>\r\n    <script src=\"https://ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js\"></script>\r\n</head>\r\n<body>\r\n    <script>\r\n        function load(name) {\r\n            console.log(\"loading \" + name);\r\n            WebFont.load({\r\n                custom: {\r\n                    families: [name],\r\n                    testStrings: {\r\n                        'Entypo': '\\uE604'\r\n                    },\r\n                    urls: ['https://app.coachingspaces.com/css/full/001-icon-fonts.css']\r\n                },\r\n                classes: true,\r\n                active: function () {\r\n                    console.log(\"active \" + name);\r\n                },\r\n                inactive: function () {\r\n                    console.log(\"inactive \" + name);\r\n                }\r\n            });\r\n        }\r\n        load('FreeSans');\r\n        load('Entypo');\r\n    </script>\r\n</body>\r\n</html>\r\n```\r\n\r\nWhen I open it in chrome 47.0.2526.106 \"active\" callback is only called for one of the fonts, though both fonts are loaded: see attached screenshots.\r\n\r\n<img width=\"829\" alt=\"screen shot 2016-01-11 at 20 40 21\" src=\"https://cloud.githubusercontent.com/assets/843213/12244341/89f54a70-b8a3-11e5-8f9d-2b4abf40ef91.png\">\r\n<img width=\"829\" alt=\"screen shot 2016-01-11 at 20 40 27\" src=\"https://cloud.githubusercontent.com/assets/843213/12244340/89f4c64a-b8a3-11e5-98b7-1b246a4c23be.png\">\r\n<img width=\"834\" alt=\"screen shot 2016-01-11 at 20 40 33\" src=\"https://cloud.githubusercontent.com/assets/843213/12244342/89ffc4be-b8a3-11e5-9305-467d693f9f73.png\">\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/typekit/webfontloader/issues/comments/186184972","html_url":"https://github.com/typekit/webfontloader/issues/298#issuecomment-186184972","issue_url":"https://api.github.com/repos/typekit/webfontloader/issues/298","id":186184972,"user":{"login":"ktopping","id":91001,"avatar_url":"https://avatars.githubusercontent.com/u/91001?v=3","gravatar_id":"","url":"https://api.github.com/users/ktopping","html_url":"https://github.com/ktopping","followers_url":"https://api.github.com/users/ktopping/followers","following_url":"https://api.github.com/users/ktopping/following{/other_user}","gists_url":"https://api.github.com/users/ktopping/gists{/gist_id}","starred_url":"https://api.github.com/users/ktopping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktopping/subscriptions","organizations_url":"https://api.github.com/users/ktopping/orgs","repos_url":"https://api.github.com/users/ktopping/repos","events_url":"https://api.github.com/users/ktopping/events{/privacy}","received_events_url":"https://api.github.com/users/ktopping/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T11:51:39Z","updated_at":"2016-02-19T11:51:39Z","body":"I have done some more investigating and it appears that it was the change from [v1.6.15 to v1.6.16](https://github.com/typekit/webfontloader/compare/v1.6.15...v1.6.16) that introduced the problem.\r\n\r\nI have also got better at reproducing the problem locally, in Firefox. Doing a \"Ctrl-R\" refresh, followed by another couple of \"Ctrl-R\" refreshes while the page is still blank seems to reliably reproduce it. When it happens, it is almost always accompanied by the following type of messages (not unsurprisingly) appearing in the console:\r\n```\r\ndownloadable font: download failed (font-family: \"Source Sans Pro\" style:normal weight:600 stretch:normal src index:2): status=2152398850 source: https://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGCOFnW3Jk0f09zW_Yln67Ac.woff2\r\n```\r\n![ff-log](https://cloud.githubusercontent.com/assets/91001/13174819/21a273c0-d6fe-11e5-9bf0-faa4ca4bcdde.png)\r\n\r\nNB the log message at the end is my debug message, run on a timeout, as follows:\r\n\r\n```javascript\r\n  window.setTimeout(function () {\r\n    if ($(\"html\").hasClass(\"wf-loading\")) {\r\n      console.log(\"Page still has the \\\"wf-loading\\\" class.\");\r\n    }\r\n  }, 5000);\r\n```\r\n\r\n"}}