{"id":15386654,"url":"https://github.com/pixelscommander/onlinejs","last_synced_at":"2025-10-13T13:07:52.886Z","repository":{"id":3379394,"uuid":"4427177","full_name":"PixelsCommander/OnlineJS","owner":"PixelsCommander","description":"Reliable, fast and easy to use library to check your internet connection status","archived":false,"fork":false,"pushed_at":"2018-01-20T19:59:19.000Z","size":114,"stargazers_count":69,"open_issues_count":6,"forks_count":17,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-15T20:04:50.105Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pixelscommander.com/polygon/onlinejs/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PixelsCommander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-24T00:59:27.000Z","updated_at":"2024-12-10T16:17:01.000Z","dependencies_parsed_at":"2022-08-27T09:01:43.867Z","dependency_job_id":null,"html_url":"https://github.com/PixelsCommander/OnlineJS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PixelsCommander%2FOnlineJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PixelsCommander%2FOnlineJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PixelsCommander%2FOnlineJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PixelsCommander%2FOnlineJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PixelsCommander","download_url":"https://codeload.github.com/PixelsCommander/OnlineJS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PixelsCommander%2FOnlineJS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259164584,"owners_count":22815387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T14:50:04.378Z","updated_at":"2025-10-13T13:07:47.847Z","avatar_url":"https://github.com/PixelsCommander.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ONLINE JS\n========\n\nLightweight and reliable library to check internet connection status.\n\nCompatible browsers: IE 8-11, Opera, Chrome, Firefox, Android, iOS\n\n\nUsage\n-----\n\nInclude this library into your project and just check is \u003ccode\u003ewindow.onLine === true\u003c/code\u003e.\n\nAssign \u003ccode\u003ewindow.onLineHandler\u003c/code\u003e or \u003ccode\u003ewindow.offLineHandler\u003c/code\u003e functions to handle status changes.\n\nJust look at \u003ca href=\"http://pixelscommander.com/polygon/onlinejs/\"\u003eexample\u003c/a\u003e (index.html in the repo)!\n\nMore info in this \u003ca href=\"http://pixelscommander.com/en/javascript/onlinejs-javascript-internet-connection/\"\u003eblog post\u003c/a\u003e.\n\nSafety and guarantees\n---------------------\nLibrary requests headers from public URL to check if internet is available. URL set by default is maintained by me and there is no guarantee I am going to run it forever. In order to make it safe for your application it is recommended to run your own URL responding with header \u003ccode\u003eAccess-Control-Allow-Origin: *\u003c/code\u003e and then switch Online.JS to it by setting \u003ccode\u003ewindow.onLineURL\u003c/code\u003e.\n\n\nnavigator.onLine\n----------------\n\nI`m often asked: “Why not just use navigator.onLine ?”. \nUsing this property in critical tasks is bad idea. Property is underhandled and is not consistent among all browsers. It can show local connection status or react only on autonomous mode switching. Online JS is better way for serious project, it uses navigator.onLine and corresponding events as one of possible triggers and then makes more checks of internet connection.\n\n\nQuestions and propositions\n--------------------------\n\nFeel free to write me with any questions or propositions \u003ca href=\"mailto:denis.radin@gmail.com\"\u003edenis.radin@gmail.com\u003c/a\u003e\n\n\nBug tracker\n-----------\n\nHave a bug? Please create an issue here on GitHub!\n\nhttps://github.com/PixelsCommander/OnlineJS/issues\n\n\nTwitter account\n---------------\n\nKeep up to date on announcements and more by following OnlineJS on Twitter, \u003ca href=\"http://twitter.com/pixelscommander\"\u003e@pixelscommander\u003c/a\u003e.\n\n\nLicense\n---------------------\n\nCopyright 2011 Denis Radin.\n\nLicensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelscommander%2Fonlinejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelscommander%2Fonlinejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelscommander%2Fonlinejs/lists"}