From 235c34993c7b14f783fc8259cc237ac09f0d3e57 Mon Sep 17 00:00:00 2001 From: MDN Date: Fri, 9 Jul 2021 00:38:08 +0000 Subject: [CRON] sync translated content --- files/de/_redirects.txt | 5 +- files/de/_wikihistory.json | 38 +-- .../de/orphaned/web/api/navigatoronline/index.html | 128 +++++++ .../web/api/navigatoronline/online/index.html | 191 +++++++++++ .../online_and_offline_events/index.html | 121 +++++++ files/de/web/api/navigatoronline/index.html | 127 ------- files/de/web/api/navigatoronline/online/index.html | 190 ----------- .../online_and_offline_events/index.html | 120 ------- files/es/_redirects.txt | 11 +- files/es/_wikihistory.json | 88 ++--- .../hardwareconcurrency/index.html | 70 ++++ .../web/api/navigatorconcurrenthardware/index.html | 72 ++++ .../orphaned/web/api/navigatorlanguage/index.html | 149 +++++++++ .../web/api/navigatorlanguage/language/index.html | 134 ++++++++ .../es/orphaned/web/api/navigatoronline/index.html | 134 ++++++++ .../web/api/navigatoronline/online/index.html | 167 ++++++++++ .../online_and_offline_events/index.html | 92 ++++++ .../hardwareconcurrency/index.html | 69 ---- .../web/api/navigatorconcurrenthardware/index.html | 71 ---- files/es/web/api/navigatorlanguage/index.html | 148 --------- .../web/api/navigatorlanguage/language/index.html | 133 -------- files/es/web/api/navigatoronline/index.html | 133 -------- files/es/web/api/navigatoronline/online/index.html | 166 ---------- .../online_and_offline_events/index.html | 92 ------ files/fr/_redirects.txt | 18 +- files/fr/_wikihistory.json | 112 +++---- .../orphaned/web/api/navigatorlanguage/index.html | 62 ++++ .../web/api/navigatorlanguage/language/index.html | 59 ++++ .../web/api/navigatorlanguage/languages/index.html | 59 ++++ .../fr/orphaned/web/api/navigatoronline/index.html | 63 ++++ .../web/api/navigatoronline/online/index.html | 90 +++++ .../online_and_offline_events/index.html | 100 ++++++ .../orphaned/web/api/navigatorstorage/index.html | 71 ++++ .../web/api/navigatorstorage/storage/index.html | 48 +++ files/fr/web/api/navigatorlanguage/index.html | 61 ---- .../web/api/navigatorlanguage/language/index.html | 58 ---- .../web/api/navigatorlanguage/languages/index.html | 58 ---- files/fr/web/api/navigatoronline/index.html | 62 ---- files/fr/web/api/navigatoronline/online/index.html | 89 ----- .../online_and_offline_events/index.html | 100 ------ files/fr/web/api/navigatorstorage/index.html | 70 ---- .../fr/web/api/navigatorstorage/storage/index.html | 47 --- files/ja/_redirects.txt | 92 ++++-- files/ja/_wikihistory.json | 366 ++++++++++----------- .../hardwareconcurrency/index.html | 70 ++++ .../web/api/navigatorconcurrenthardware/index.html | 72 ++++ .../web/api/navigatorid/appcodename/index.html | 27 ++ .../web/api/navigatorid/appname/index.html | 27 ++ .../web/api/navigatorid/appversion/index.html | 65 ++++ files/ja/orphaned/web/api/navigatorid/index.html | 75 +++++ .../web/api/navigatorid/platform/index.html | 66 ++++ .../web/api/navigatorid/product/index.html | 39 +++ .../web/api/navigatorid/useragent/index.html | 85 +++++ .../orphaned/web/api/navigatorlanguage/index.html | 64 ++++ .../web/api/navigatorlanguage/language/index.html | 66 ++++ .../web/api/navigatorlanguage/languages/index.html | 44 +++ .../ja/orphaned/web/api/navigatoronline/index.html | 60 ++++ .../web/api/navigatoronline/online/index.html | 89 +++++ .../online_and_offline_events/index.html | 74 +++++ .../orphaned/web/api/navigatorplugins/index.html | 60 ++++ .../api/navigatorplugins/javaenabled/index.html | 48 +++ .../web/api/navigatorplugins/mimetypes/index.html | 64 ++++ .../web/api/navigatorplugins/plugins/index.html | 60 ++++ .../orphaned/web/api/navigatorstorage/index.html | 69 ++++ .../web/api/navigatorstorage/storage/index.html | 61 ++++ .../ja/orphaned/web/http/headers/index/index.html | 14 + .../hardwareconcurrency/index.html | 69 ---- .../web/api/navigatorconcurrenthardware/index.html | 71 ---- .../ja/web/api/navigatorid/appcodename/index.html | 26 -- files/ja/web/api/navigatorid/appname/index.html | 26 -- files/ja/web/api/navigatorid/appversion/index.html | 64 ---- files/ja/web/api/navigatorid/index.html | 74 ----- files/ja/web/api/navigatorid/platform/index.html | 65 ---- files/ja/web/api/navigatorid/product/index.html | 38 --- files/ja/web/api/navigatorid/useragent/index.html | 84 ----- files/ja/web/api/navigatorlanguage/index.html | 63 ---- .../web/api/navigatorlanguage/language/index.html | 65 ---- .../web/api/navigatorlanguage/languages/index.html | 43 --- files/ja/web/api/navigatoronline/index.html | 59 ---- files/ja/web/api/navigatoronline/online/index.html | 88 ----- .../online_and_offline_events/index.html | 73 ---- files/ja/web/api/navigatorplugins/index.html | 59 ---- .../api/navigatorplugins/javaenabled/index.html | 47 --- .../web/api/navigatorplugins/mimetypes/index.html | 63 ---- .../ja/web/api/navigatorplugins/plugins/index.html | 59 ---- files/ja/web/api/navigatorstorage/index.html | 68 ---- .../ja/web/api/navigatorstorage/storage/index.html | 60 ---- files/ja/web/http/headers/index/index.html | 13 - files/ko/_redirects.txt | 8 +- files/ko/_wikihistory.json | 72 ++-- files/ko/orphaned/web/api/navigatorid/index.html | 75 +++++ .../orphaned/web/api/navigatorlanguage/index.html | 66 ++++ .../web/api/navigatorlanguage/language/index.html | 57 ++++ .../ko/orphaned/web/api/navigatoronline/index.html | 64 ++++ .../online_and_offline_events/index.html | 108 ++++++ files/ko/web/api/navigatorid/index.html | 74 ----- files/ko/web/api/navigatorlanguage/index.html | 65 ---- .../web/api/navigatorlanguage/language/index.html | 56 ---- files/ko/web/api/navigatoronline/index.html | 63 ---- .../online_and_offline_events/index.html | 107 ------ files/pl/_redirects.txt | 78 +++-- files/pl/_wikihistory.json | 250 +++++++------- .../web/api/navigatorid/appcodename/index.html | 31 ++ .../web/api/navigatorid/appname/index.html | 30 ++ .../web/api/navigatorid/appversion/index.html | 33 ++ .../web/api/navigatorid/platform/index.html | 29 ++ .../web/api/navigatorid/product/index.html | 39 +++ .../orphaned/web/api/navigatorlanguage/index.html | 149 +++++++++ .../web/api/navigatorlanguage/language/index.html | 46 +++ .../pl/orphaned/web/api/navigatoronline/index.html | 128 +++++++ .../web/api/navigatoronline/online/index.html | 48 +++ .../online_and_offline_events/index.html | 85 +++++ .../orphaned/web/api/navigatorplugins/index.html | 112 +++++++ .../api/navigatorplugins/javaenabled/index.html | 40 +++ .../web/api/navigatorplugins/mimetypes/index.html | 41 +++ .../web/api/navigatorplugins/plugins/index.html | 59 ++++ .../pl/web/api/navigatorid/appcodename/index.html | 31 -- files/pl/web/api/navigatorid/appname/index.html | 30 -- files/pl/web/api/navigatorid/appversion/index.html | 33 -- files/pl/web/api/navigatorid/platform/index.html | 29 -- files/pl/web/api/navigatorid/product/index.html | 39 --- files/pl/web/api/navigatorlanguage/index.html | 148 --------- .../web/api/navigatorlanguage/language/index.html | 46 --- files/pl/web/api/navigatoronline/index.html | 127 ------- files/pl/web/api/navigatoronline/online/index.html | 48 --- .../online_and_offline_events/index.html | 85 ----- files/pl/web/api/navigatorplugins/index.html | 111 ------- .../api/navigatorplugins/javaenabled/index.html | 40 --- .../web/api/navigatorplugins/mimetypes/index.html | 41 --- .../pl/web/api/navigatorplugins/plugins/index.html | 59 ---- files/pt-br/_redirects.txt | 16 +- files/pt-br/_wikihistory.json | 134 ++++---- .../pt-br/orphaned/web/api/navigatorid/index.html | 121 +++++++ .../web/api/navigatorid/platform/index.html | 64 ++++ .../web/api/navigatorid/useragent/index.html | 90 +++++ .../orphaned/web/api/navigatorlanguage/index.html | 149 +++++++++ .../web/api/navigatorlanguage/language/index.html | 132 ++++++++ .../orphaned/web/api/navigatoronline/index.html | 135 ++++++++ .../web/api/navigatoronline/online/index.html | 92 ++++++ .../online_and_offline_events/index.html | 96 ++++++ .../orphaned/web/api/navigatorplugins/index.html | 70 ++++ .../api/navigatorplugins/javaenabled/index.html | 55 ++++ files/pt-br/web/api/navigatorid/index.html | 120 ------- .../pt-br/web/api/navigatorid/platform/index.html | 63 ---- .../pt-br/web/api/navigatorid/useragent/index.html | 89 ----- files/pt-br/web/api/navigatorlanguage/index.html | 148 --------- .../web/api/navigatorlanguage/language/index.html | 131 -------- files/pt-br/web/api/navigatoronline/index.html | 134 -------- .../web/api/navigatoronline/online/index.html | 91 ----- .../online_and_offline_events/index.html | 95 ------ files/pt-br/web/api/navigatorplugins/index.html | 69 ---- .../api/navigatorplugins/javaenabled/index.html | 54 --- files/ru/_redirects.txt | 17 + files/ru/_wikihistory.json | 222 ++++++------- .../web/api/navigatorid/appcodename/index.html | 56 ++++ .../web/api/navigatorid/appname/index.html | 55 ++++ .../web/api/navigatorid/appversion/index.html | 54 +++ files/ru/orphaned/web/api/navigatorid/index.html | 79 +++++ .../web/api/navigatorid/platform/index.html | 62 ++++ .../web/api/navigatorid/product/index.html | 69 ++++ .../web/api/navigatorid/taintenabled/index.html | 53 +++ .../web/api/navigatorid/useragent/index.html | 77 +++++ .../orphaned/web/api/navigatorlanguage/index.html | 60 ++++ .../web/api/navigatorlanguage/language/index.html | 53 +++ .../web/api/navigatorlanguage/languages/index.html | 55 ++++ .../ru/orphaned/web/api/navigatoronline/index.html | 58 ++++ .../web/api/navigatoronline/online/index.html | 67 ++++ .../orphaned/web/api/navigatorplugins/index.html | 58 ++++ .../api/navigatorplugins/javaenabled/index.html | 29 ++ .../web/api/navigatorplugins/mimetypes/index.html | 40 +++ .../web/api/navigatorplugins/plugins/index.html | 64 ++++ .../ru/web/api/navigatorid/appcodename/index.html | 55 ---- files/ru/web/api/navigatorid/appname/index.html | 54 --- files/ru/web/api/navigatorid/appversion/index.html | 53 --- files/ru/web/api/navigatorid/index.html | 78 ----- files/ru/web/api/navigatorid/platform/index.html | 61 ---- files/ru/web/api/navigatorid/product/index.html | 68 ---- .../ru/web/api/navigatorid/taintenabled/index.html | 52 --- files/ru/web/api/navigatorid/useragent/index.html | 76 ----- files/ru/web/api/navigatorlanguage/index.html | 59 ---- .../web/api/navigatorlanguage/language/index.html | 52 --- .../web/api/navigatorlanguage/languages/index.html | 54 --- files/ru/web/api/navigatoronline/index.html | 57 ---- files/ru/web/api/navigatoronline/online/index.html | 66 ---- files/ru/web/api/navigatorplugins/index.html | 57 ---- .../api/navigatorplugins/javaenabled/index.html | 28 -- .../web/api/navigatorplugins/mimetypes/index.html | 39 --- .../ru/web/api/navigatorplugins/plugins/index.html | 63 ---- files/zh-cn/_redirects.txt | 63 ++-- files/zh-cn/_wikihistory.json | 360 ++++++++++---------- .../hardwareconcurrency/index.html | 70 ++++ .../web/api/navigatorconcurrenthardware/index.html | 72 ++++ .../web/api/navigatorid/appcodename/index.html | 37 +++ .../web/api/navigatorid/appname/index.html | 38 +++ .../web/api/navigatorid/appversion/index.html | 43 +++ .../zh-cn/orphaned/web/api/navigatorid/index.html | 121 +++++++ .../web/api/navigatorid/platform/index.html | 36 ++ .../web/api/navigatorid/product/index.html | 35 ++ .../web/api/navigatorid/useragent/index.html | 80 +++++ .../orphaned/web/api/navigatorlanguage/index.html | 69 ++++ .../web/api/navigatorlanguage/language/index.html | 65 ++++ .../web/api/navigatorlanguage/languages/index.html | 65 ++++ .../orphaned/web/api/navigatoronline/index.html | 127 +++++++ .../web/api/navigatoronline/online/index.html | 88 +++++ .../online_and_offline_events/index.html | 120 +++++++ .../orphaned/web/api/navigatorplugins/index.html | 106 ++++++ .../api/navigatorplugins/javaenabled/index.html | 31 ++ .../web/api/navigatorplugins/mimetypes/index.html | 40 +++ .../web/api/navigatorplugins/plugins/index.html | 96 ++++++ .../orphaned/web/api/navigatorstorage/index.html | 71 ++++ .../web/api/navigatorstorage/storage/index.html | 57 ++++ .../orphaned/web/api/xdomainrequest/index.html | 187 +++++++++++ .../orphaned/web/http/headers/index/index.html | 9 + .../hardwareconcurrency/index.html | 69 ---- .../web/api/navigatorconcurrenthardware/index.html | 71 ---- .../web/api/navigatorid/appcodename/index.html | 36 -- files/zh-cn/web/api/navigatorid/appname/index.html | 37 --- .../web/api/navigatorid/appversion/index.html | 42 --- files/zh-cn/web/api/navigatorid/index.html | 120 ------- .../zh-cn/web/api/navigatorid/platform/index.html | 35 -- files/zh-cn/web/api/navigatorid/product/index.html | 34 -- .../zh-cn/web/api/navigatorid/useragent/index.html | 79 ----- files/zh-cn/web/api/navigatorlanguage/index.html | 68 ---- .../web/api/navigatorlanguage/language/index.html | 64 ---- .../web/api/navigatorlanguage/languages/index.html | 64 ---- files/zh-cn/web/api/navigatoronline/index.html | 126 ------- .../web/api/navigatoronline/online/index.html | 87 ----- .../online_and_offline_events/index.html | 119 ------- files/zh-cn/web/api/navigatorplugins/index.html | 105 ------ .../api/navigatorplugins/javaenabled/index.html | 30 -- .../web/api/navigatorplugins/mimetypes/index.html | 39 --- .../web/api/navigatorplugins/plugins/index.html | 95 ------ files/zh-cn/web/api/navigatorstorage/index.html | 70 ---- .../web/api/navigatorstorage/storage/index.html | 56 ---- files/zh-cn/web/api/xdomainrequest/index.html | 186 ----------- files/zh-cn/web/http/headers/index/index.html | 8 - files/zh-tw/_redirects.txt | 5 +- files/zh-tw/_wikihistory.json | 28 +- .../web/api/navigatorlanguage/language/index.html | 65 ++++ .../orphaned/web/api/navigatoronline/index.html | 130 ++++++++ .../online_and_offline_events/index.html | 102 ++++++ .../web/api/navigatorlanguage/language/index.html | 64 ---- files/zh-tw/web/api/navigatoronline/index.html | 129 -------- .../online_and_offline_events/index.html | 101 ------ 244 files changed, 9349 insertions(+), 9139 deletions(-) create mode 100644 files/de/orphaned/web/api/navigatoronline/index.html create mode 100644 files/de/orphaned/web/api/navigatoronline/online/index.html create mode 100644 files/de/orphaned/web/api/navigatoronline/online_and_offline_events/index.html delete mode 100644 files/de/web/api/navigatoronline/index.html delete mode 100644 files/de/web/api/navigatoronline/online/index.html delete mode 100644 files/de/web/api/navigatoronline/online_and_offline_events/index.html create mode 100644 files/es/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html create mode 100644 files/es/orphaned/web/api/navigatorconcurrenthardware/index.html create mode 100644 files/es/orphaned/web/api/navigatorlanguage/index.html create mode 100644 files/es/orphaned/web/api/navigatorlanguage/language/index.html create mode 100644 files/es/orphaned/web/api/navigatoronline/index.html create mode 100644 files/es/orphaned/web/api/navigatoronline/online/index.html create mode 100644 files/es/orphaned/web/api/navigatoronline/online_and_offline_events/index.html delete mode 100644 files/es/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html delete mode 100644 files/es/web/api/navigatorconcurrenthardware/index.html delete mode 100644 files/es/web/api/navigatorlanguage/index.html delete mode 100644 files/es/web/api/navigatorlanguage/language/index.html delete mode 100644 files/es/web/api/navigatoronline/index.html delete mode 100644 files/es/web/api/navigatoronline/online/index.html delete mode 100644 files/es/web/api/navigatoronline/online_and_offline_events/index.html create mode 100644 files/fr/orphaned/web/api/navigatorlanguage/index.html create mode 100644 files/fr/orphaned/web/api/navigatorlanguage/language/index.html create mode 100644 files/fr/orphaned/web/api/navigatorlanguage/languages/index.html create mode 100644 files/fr/orphaned/web/api/navigatoronline/index.html create mode 100644 files/fr/orphaned/web/api/navigatoronline/online/index.html create mode 100644 files/fr/orphaned/web/api/navigatoronline/online_and_offline_events/index.html create mode 100644 files/fr/orphaned/web/api/navigatorstorage/index.html create mode 100644 files/fr/orphaned/web/api/navigatorstorage/storage/index.html delete mode 100644 files/fr/web/api/navigatorlanguage/index.html delete mode 100644 files/fr/web/api/navigatorlanguage/language/index.html delete mode 100644 files/fr/web/api/navigatorlanguage/languages/index.html delete mode 100644 files/fr/web/api/navigatoronline/index.html delete mode 100644 files/fr/web/api/navigatoronline/online/index.html delete mode 100644 files/fr/web/api/navigatoronline/online_and_offline_events/index.html delete mode 100644 files/fr/web/api/navigatorstorage/index.html delete mode 100644 files/fr/web/api/navigatorstorage/storage/index.html create mode 100644 files/ja/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html create mode 100644 files/ja/orphaned/web/api/navigatorconcurrenthardware/index.html create mode 100644 files/ja/orphaned/web/api/navigatorid/appcodename/index.html create mode 100644 files/ja/orphaned/web/api/navigatorid/appname/index.html create mode 100644 files/ja/orphaned/web/api/navigatorid/appversion/index.html create mode 100644 files/ja/orphaned/web/api/navigatorid/index.html create mode 100644 files/ja/orphaned/web/api/navigatorid/platform/index.html create mode 100644 files/ja/orphaned/web/api/navigatorid/product/index.html create mode 100644 files/ja/orphaned/web/api/navigatorid/useragent/index.html create mode 100644 files/ja/orphaned/web/api/navigatorlanguage/index.html create mode 100644 files/ja/orphaned/web/api/navigatorlanguage/language/index.html create mode 100644 files/ja/orphaned/web/api/navigatorlanguage/languages/index.html create mode 100644 files/ja/orphaned/web/api/navigatoronline/index.html create mode 100644 files/ja/orphaned/web/api/navigatoronline/online/index.html create mode 100644 files/ja/orphaned/web/api/navigatoronline/online_and_offline_events/index.html create mode 100644 files/ja/orphaned/web/api/navigatorplugins/index.html create mode 100644 files/ja/orphaned/web/api/navigatorplugins/javaenabled/index.html create mode 100644 files/ja/orphaned/web/api/navigatorplugins/mimetypes/index.html create mode 100644 files/ja/orphaned/web/api/navigatorplugins/plugins/index.html create mode 100644 files/ja/orphaned/web/api/navigatorstorage/index.html create mode 100644 files/ja/orphaned/web/api/navigatorstorage/storage/index.html create mode 100644 files/ja/orphaned/web/http/headers/index/index.html delete mode 100644 files/ja/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html delete mode 100644 files/ja/web/api/navigatorconcurrenthardware/index.html delete mode 100644 files/ja/web/api/navigatorid/appcodename/index.html delete mode 100644 files/ja/web/api/navigatorid/appname/index.html delete mode 100644 files/ja/web/api/navigatorid/appversion/index.html delete mode 100644 files/ja/web/api/navigatorid/index.html delete mode 100644 files/ja/web/api/navigatorid/platform/index.html delete mode 100644 files/ja/web/api/navigatorid/product/index.html delete mode 100644 files/ja/web/api/navigatorid/useragent/index.html delete mode 100644 files/ja/web/api/navigatorlanguage/index.html delete mode 100644 files/ja/web/api/navigatorlanguage/language/index.html delete mode 100644 files/ja/web/api/navigatorlanguage/languages/index.html delete mode 100644 files/ja/web/api/navigatoronline/index.html delete mode 100644 files/ja/web/api/navigatoronline/online/index.html delete mode 100644 files/ja/web/api/navigatoronline/online_and_offline_events/index.html delete mode 100644 files/ja/web/api/navigatorplugins/index.html delete mode 100644 files/ja/web/api/navigatorplugins/javaenabled/index.html delete mode 100644 files/ja/web/api/navigatorplugins/mimetypes/index.html delete mode 100644 files/ja/web/api/navigatorplugins/plugins/index.html delete mode 100644 files/ja/web/api/navigatorstorage/index.html delete mode 100644 files/ja/web/api/navigatorstorage/storage/index.html delete mode 100644 files/ja/web/http/headers/index/index.html create mode 100644 files/ko/orphaned/web/api/navigatorid/index.html create mode 100644 files/ko/orphaned/web/api/navigatorlanguage/index.html create mode 100644 files/ko/orphaned/web/api/navigatorlanguage/language/index.html create mode 100644 files/ko/orphaned/web/api/navigatoronline/index.html create mode 100644 files/ko/orphaned/web/api/navigatoronline/online_and_offline_events/index.html delete mode 100644 files/ko/web/api/navigatorid/index.html delete mode 100644 files/ko/web/api/navigatorlanguage/index.html delete mode 100644 files/ko/web/api/navigatorlanguage/language/index.html delete mode 100644 files/ko/web/api/navigatoronline/index.html delete mode 100644 files/ko/web/api/navigatoronline/online_and_offline_events/index.html create mode 100644 files/pl/orphaned/web/api/navigatorid/appcodename/index.html create mode 100644 files/pl/orphaned/web/api/navigatorid/appname/index.html create mode 100644 files/pl/orphaned/web/api/navigatorid/appversion/index.html create mode 100644 files/pl/orphaned/web/api/navigatorid/platform/index.html create mode 100644 files/pl/orphaned/web/api/navigatorid/product/index.html create mode 100644 files/pl/orphaned/web/api/navigatorlanguage/index.html create mode 100644 files/pl/orphaned/web/api/navigatorlanguage/language/index.html create mode 100644 files/pl/orphaned/web/api/navigatoronline/index.html create mode 100644 files/pl/orphaned/web/api/navigatoronline/online/index.html create mode 100644 files/pl/orphaned/web/api/navigatoronline/online_and_offline_events/index.html create mode 100644 files/pl/orphaned/web/api/navigatorplugins/index.html create mode 100644 files/pl/orphaned/web/api/navigatorplugins/javaenabled/index.html create mode 100644 files/pl/orphaned/web/api/navigatorplugins/mimetypes/index.html create mode 100644 files/pl/orphaned/web/api/navigatorplugins/plugins/index.html delete mode 100644 files/pl/web/api/navigatorid/appcodename/index.html delete mode 100644 files/pl/web/api/navigatorid/appname/index.html delete mode 100644 files/pl/web/api/navigatorid/appversion/index.html delete mode 100644 files/pl/web/api/navigatorid/platform/index.html delete mode 100644 files/pl/web/api/navigatorid/product/index.html delete mode 100644 files/pl/web/api/navigatorlanguage/index.html delete mode 100644 files/pl/web/api/navigatorlanguage/language/index.html delete mode 100644 files/pl/web/api/navigatoronline/index.html delete mode 100644 files/pl/web/api/navigatoronline/online/index.html delete mode 100644 files/pl/web/api/navigatoronline/online_and_offline_events/index.html delete mode 100644 files/pl/web/api/navigatorplugins/index.html delete mode 100644 files/pl/web/api/navigatorplugins/javaenabled/index.html delete mode 100644 files/pl/web/api/navigatorplugins/mimetypes/index.html delete mode 100644 files/pl/web/api/navigatorplugins/plugins/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatorid/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatorid/platform/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatorid/useragent/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatorlanguage/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatorlanguage/language/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatoronline/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatoronline/online/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatoronline/online_and_offline_events/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatorplugins/index.html create mode 100644 files/pt-br/orphaned/web/api/navigatorplugins/javaenabled/index.html delete mode 100644 files/pt-br/web/api/navigatorid/index.html delete mode 100644 files/pt-br/web/api/navigatorid/platform/index.html delete mode 100644 files/pt-br/web/api/navigatorid/useragent/index.html delete mode 100644 files/pt-br/web/api/navigatorlanguage/index.html delete mode 100644 files/pt-br/web/api/navigatorlanguage/language/index.html delete mode 100644 files/pt-br/web/api/navigatoronline/index.html delete mode 100644 files/pt-br/web/api/navigatoronline/online/index.html delete mode 100644 files/pt-br/web/api/navigatoronline/online_and_offline_events/index.html delete mode 100644 files/pt-br/web/api/navigatorplugins/index.html delete mode 100644 files/pt-br/web/api/navigatorplugins/javaenabled/index.html create mode 100644 files/ru/orphaned/web/api/navigatorid/appcodename/index.html create mode 100644 files/ru/orphaned/web/api/navigatorid/appname/index.html create mode 100644 files/ru/orphaned/web/api/navigatorid/appversion/index.html create mode 100644 files/ru/orphaned/web/api/navigatorid/index.html create mode 100644 files/ru/orphaned/web/api/navigatorid/platform/index.html create mode 100644 files/ru/orphaned/web/api/navigatorid/product/index.html create mode 100644 files/ru/orphaned/web/api/navigatorid/taintenabled/index.html create mode 100644 files/ru/orphaned/web/api/navigatorid/useragent/index.html create mode 100644 files/ru/orphaned/web/api/navigatorlanguage/index.html create mode 100644 files/ru/orphaned/web/api/navigatorlanguage/language/index.html create mode 100644 files/ru/orphaned/web/api/navigatorlanguage/languages/index.html create mode 100644 files/ru/orphaned/web/api/navigatoronline/index.html create mode 100644 files/ru/orphaned/web/api/navigatoronline/online/index.html create mode 100644 files/ru/orphaned/web/api/navigatorplugins/index.html create mode 100644 files/ru/orphaned/web/api/navigatorplugins/javaenabled/index.html create mode 100644 files/ru/orphaned/web/api/navigatorplugins/mimetypes/index.html create mode 100644 files/ru/orphaned/web/api/navigatorplugins/plugins/index.html delete mode 100644 files/ru/web/api/navigatorid/appcodename/index.html delete mode 100644 files/ru/web/api/navigatorid/appname/index.html delete mode 100644 files/ru/web/api/navigatorid/appversion/index.html delete mode 100644 files/ru/web/api/navigatorid/index.html delete mode 100644 files/ru/web/api/navigatorid/platform/index.html delete mode 100644 files/ru/web/api/navigatorid/product/index.html delete mode 100644 files/ru/web/api/navigatorid/taintenabled/index.html delete mode 100644 files/ru/web/api/navigatorid/useragent/index.html delete mode 100644 files/ru/web/api/navigatorlanguage/index.html delete mode 100644 files/ru/web/api/navigatorlanguage/language/index.html delete mode 100644 files/ru/web/api/navigatorlanguage/languages/index.html delete mode 100644 files/ru/web/api/navigatoronline/index.html delete mode 100644 files/ru/web/api/navigatoronline/online/index.html delete mode 100644 files/ru/web/api/navigatorplugins/index.html delete mode 100644 files/ru/web/api/navigatorplugins/javaenabled/index.html delete mode 100644 files/ru/web/api/navigatorplugins/mimetypes/index.html delete mode 100644 files/ru/web/api/navigatorplugins/plugins/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorconcurrenthardware/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorid/appcodename/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorid/appname/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorid/appversion/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorid/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorid/platform/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorid/product/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorid/useragent/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorlanguage/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorlanguage/language/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorlanguage/languages/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatoronline/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatoronline/online/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatoronline/online_and_offline_events/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorplugins/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorplugins/javaenabled/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorplugins/mimetypes/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorplugins/plugins/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorstorage/index.html create mode 100644 files/zh-cn/orphaned/web/api/navigatorstorage/storage/index.html create mode 100644 files/zh-cn/orphaned/web/api/xdomainrequest/index.html create mode 100644 files/zh-cn/orphaned/web/http/headers/index/index.html delete mode 100644 files/zh-cn/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html delete mode 100644 files/zh-cn/web/api/navigatorconcurrenthardware/index.html delete mode 100644 files/zh-cn/web/api/navigatorid/appcodename/index.html delete mode 100644 files/zh-cn/web/api/navigatorid/appname/index.html delete mode 100644 files/zh-cn/web/api/navigatorid/appversion/index.html delete mode 100644 files/zh-cn/web/api/navigatorid/index.html delete mode 100644 files/zh-cn/web/api/navigatorid/platform/index.html delete mode 100644 files/zh-cn/web/api/navigatorid/product/index.html delete mode 100644 files/zh-cn/web/api/navigatorid/useragent/index.html delete mode 100644 files/zh-cn/web/api/navigatorlanguage/index.html delete mode 100644 files/zh-cn/web/api/navigatorlanguage/language/index.html delete mode 100644 files/zh-cn/web/api/navigatorlanguage/languages/index.html delete mode 100644 files/zh-cn/web/api/navigatoronline/index.html delete mode 100644 files/zh-cn/web/api/navigatoronline/online/index.html delete mode 100644 files/zh-cn/web/api/navigatoronline/online_and_offline_events/index.html delete mode 100644 files/zh-cn/web/api/navigatorplugins/index.html delete mode 100644 files/zh-cn/web/api/navigatorplugins/javaenabled/index.html delete mode 100644 files/zh-cn/web/api/navigatorplugins/mimetypes/index.html delete mode 100644 files/zh-cn/web/api/navigatorplugins/plugins/index.html delete mode 100644 files/zh-cn/web/api/navigatorstorage/index.html delete mode 100644 files/zh-cn/web/api/navigatorstorage/storage/index.html delete mode 100644 files/zh-cn/web/api/xdomainrequest/index.html delete mode 100644 files/zh-cn/web/http/headers/index/index.html create mode 100644 files/zh-tw/orphaned/web/api/navigatorlanguage/language/index.html create mode 100644 files/zh-tw/orphaned/web/api/navigatoronline/index.html create mode 100644 files/zh-tw/orphaned/web/api/navigatoronline/online_and_offline_events/index.html delete mode 100644 files/zh-tw/web/api/navigatorlanguage/language/index.html delete mode 100644 files/zh-tw/web/api/navigatoronline/index.html delete mode 100644 files/zh-tw/web/api/navigatoronline/online_and_offline_events/index.html diff --git a/files/de/_redirects.txt b/files/de/_redirects.txt index 2977d69b29..c922a19eb0 100644 --- a/files/de/_redirects.txt +++ b/files/de/_redirects.txt @@ -445,7 +445,7 @@ /de/docs/Mozilla/Add-ons/WebExtensions/Beispiele /de/docs/Mozilla/Add-ons/WebExtensions/Examples /de/docs/Mozilla/Add-ons/WebExtensions/Deine_erste_WebErweiterung /de/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension /de/docs/Mozilla/Add-ons/WebExtensions/Deine_zweite_Erweiterung /de/docs/Mozilla/Add-ons/WebExtensions/Your_second_WebExtension -/de/docs/Online_and_offline_events /de/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/de/docs/Online_and_offline_events /de/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /de/docs/OpenSearch_Plugin_für_Firefox_erstellen /de/docs/Web/OpenSearch /de/docs/Plugins/Flash-Aktivierung:_Browser-Vergleich /de/docs/orphaned/Plugins/Flash_Activation:_Browser_Comparison /de/docs/Profilmanager /de/docs/Profile_Manager @@ -503,6 +503,9 @@ /de/docs/Web/API/LinkStyle /de/docs/orphaned/Web/API/LinkStyle /de/docs/Web/API/MozMobileConnection.selectNetworkAutomatically /de/docs/Web/API/MozMobileConnection/selectNetworkAutomatically /de/docs/Web/API/Navigator/registerProtocolHandler/Webbasierte_protokoll-handler /de/docs/Web/API/Navigator/registerProtocolHandler/Web-based_protocol_handlers +/de/docs/Web/API/NavigatorOnLine /de/docs/orphaned/Web/API/NavigatorOnLine +/de/docs/Web/API/NavigatorOnLine/Online_and_offline_events /de/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/de/docs/Web/API/NavigatorOnLine/onLine /de/docs/orphaned/Web/API/NavigatorOnLine/onLine /de/docs/Web/API/Node.cloneNode /de/docs/Web/API/Node/cloneNode /de/docs/Web/API/Node/innerText /de/docs/Web/API/HTMLElement/innerText /de/docs/Web/API/Node/setUserData /de/docs/orphaned/Web/API/Node/setUserData diff --git a/files/de/_wikihistory.json b/files/de/_wikihistory.json index a1f70ee2aa..4a9a904a8c 100644 --- a/files/de/_wikihistory.json +++ b/files/de/_wikihistory.json @@ -3695,25 +3695,6 @@ "petzichen" ] }, - "Web/API/NavigatorOnLine": { - "modified": "2019-03-23T22:47:26.289Z", - "contributors": [ - "teoli" - ] - }, - "Web/API/NavigatorOnLine/Online_and_offline_events": { - "modified": "2019-03-23T22:59:48.853Z", - "contributors": [ - "chrisdavidmills", - "terabaud" - ] - }, - "Web/API/NavigatorOnLine/onLine": { - "modified": "2019-03-23T22:47:22.054Z", - "contributors": [ - "TRoskop" - ] - }, "Web/API/Node": { "modified": "2019-10-07T12:42:22.118Z", "contributors": [ @@ -14569,6 +14550,25 @@ "Sebastianz" ] }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2019-03-23T22:47:26.289Z", + "contributors": [ + "teoli" + ] + }, + "orphaned/Web/API/NavigatorOnLine/Online_and_offline_events": { + "modified": "2019-03-23T22:59:48.853Z", + "contributors": [ + "chrisdavidmills", + "terabaud" + ] + }, + "orphaned/Web/API/NavigatorOnLine/onLine": { + "modified": "2019-03-23T22:47:22.054Z", + "contributors": [ + "TRoskop" + ] + }, "orphaned/Web/API/Node/setUserData": { "modified": "2019-03-23T22:05:46.565Z", "contributors": [ diff --git a/files/de/orphaned/web/api/navigatoronline/index.html b/files/de/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..cf50921490 --- /dev/null +++ b/files/de/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,128 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +tags: + - API + - HTML-DOM + - NeedsTranslation + - TopicStub +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

+ +

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorOnLine interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
+
+ +

Methods

+ +

The NavigatorOnLine interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

See also

+ + diff --git a/files/de/orphaned/web/api/navigatoronline/online/index.html b/files/de/orphaned/web/api/navigatoronline/online/index.html new file mode 100644 index 0000000000..341ab14f0e --- /dev/null +++ b/files/de/orphaned/web/api/navigatoronline/online/index.html @@ -0,0 +1,191 @@ +--- +title: NavigatorOnLine.onLine +slug: orphaned/Web/API/NavigatorOnLine/onLine +tags: + - API + - DOM + - Dokumentation + - Eigenschaft + - Navigation + - NavigatorOnLine + - Offline + - Online + - Reference + - WebAPI +translation_of: Web/API/NavigatorOnLine/onLine +original_slug: Web/API/NavigatorOnLine/onLine +--- +
{{ApiRef("HTML DOM")}}
+ +

Diese Eigenschaft gibt einen Wahrheitswert (Bool-Wert) zurück, der Auskunft gibt, ob der Browser eine Internetverbindung aufbauen konnte. Dieser Wert wird immer dann aktualisiert, wenn eine neue Verbindung vom Browser angefordert wurde (durch Script- oder Benutzeraktionen). Es wird "false" zurückgegeben, wenn der letzte Versuch, eine Verbindung aufzubauen, fehlgeschlagen ist.

+ +

Einige Browser implementieren diese Funktion verschieden.

+ +

Für Chrome und Safari gilt, dass wenn keine Verbindung zum LAN oder Router aufgebaut wurde, der Browser "offline" ist. Andernfalls ist der Browser "online". Das bedeutet, dass aus dem Online-Status nicht die tatsächliche Verbindung erkennbar ist. Wenn der Rückgabewert "false" ist, dann ist mit Sicherheit keine Verbindung vorhanden. Wenn der Wert aber "true" ist, muss dies keine tatsächliche Verbindung zum Internet bedeuten. Auch kann die Ausführung innerhalb einer Virtuellen Maschine den Wert verfälschen. Für weitere Informationen kann dieser HTML5-Rocks Artikel hilfreich sein (in Englisch): Working Off the Grid with HTML5 Offline

+ +

Firefox und der Internet Explorer können diesen Wert auch durch die Funktion des "Offline-Modus" verändern. Dann wird auch "false" zurückgegeben, unabhängig vom tatsächlichen Status.

+ +

Bis Firefox 41 wurde in allen anderen Fällen "true" zurückgegeben. Seit Version 41 kann der tatsächliche Verbindungsstatus erkannt werden, wenn Firefox auf OS X oder Windows installiert ist.

+ +

Es sind auch folgende Ereignisse verfügbar, mit denen unmittelbar auf Änderungen des "OnLine"-Wertes reagiert werden kann.

+ + + +

 

+ +

Syntax

+ +
online = window.navigator.onLine;
+
+ +

Value

+ +

Der Rückgabewert ist vom Typ "boolean", kann also true oder false sein.

+ +

 

+ +

Beispiel

+ +

Hier das Live-Beispiel

+ +

Um zu bestimmen, ob der Browser mit dem Internet verbunden ist, müssen Sie den Wert von window.navigator.onLine wie folgt verwenden:

+ +
if (navigator.onLine) {
+  console.log('Verbunden');
+} else {
+  console.log('Getrennt');
+}
+ +

Wenn der Browser onLine nicht kennt, wird false oder undefiniert zurückgegeben.

+ +

Um auf dir Veränderung des Status direkt reagieren zu können, verwenden Sie addEventListener für die Ereignisse window.ononline und window.onoffline; wie in diesem Beispiel:

+ +
window.addEventListener("offline", function(e) { console.log("Nicht Verbunden"); });
+
+window.addEventListener("online", function(e) { console.log("Verbunden"); });
+
+ +

 

+ +

Spezifikationen

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("HTML WHATWG", "browsers.html#navigator.online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Initial definition
+ +

 

+ +

Browserkompatibilität

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunktionChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Einfache Umsetzung{{CompatVersionUnknown}}[1]{{CompatGeckoDesktop(1.9.1)}}[2]
+ {{CompatGeckoDesktop(2.0)}}[4]
8[3]{{CompatNo}}[2]5.0.4
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunktionAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileBlackBerry
Einfache Umsetzung2.2[5]{{CompatGeckoMobile(1.9.1)}}[2]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}} +

7
+ 10

+
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

[1] Vorherige Versionen von Chrome geben true unmittelbar nach den öffnen des Tabs zurück. Erst nach der nächsten Netzwerkaktivität wird der richtige Wert zurückgegeben.  Windows: 11, Mac: 14, Chrome OS: 13, Linux: Liefert immer true zurück. Siehe auch crbug.com/7469.

+ +

[2] Seit Firefox 4 und Opera 11.10 wird false unabhängig von der tatsächlichen Verbindung zurückgegeben, wenn der "offline"-Modus des Browsers aktiviert wurde. 

+ +

[3] Im Internet Explorer 8 werden die "online"- and "offline"-Ereignisse duch document.body ausgelöst; seit dem IE 9 werden diese auch von window ausgelöst.

+ +

[4] Seit Firefox 41, auf OS X und Windows, wird der tatsächliche Verbindungstatus zurückgegeben, solange der "offline"-Modus nicht aktivert wurde.

+ +

[5] Fehler in der WebView-Komponenten, siehe auch: bug 16760.

+ +

 

+ +

Hinweise

+ +

Für weitere Informationen, siehe auch die  Online/Offline‎-Ereignisse 

+ +

 

+ +

Verweise

+ + diff --git a/files/de/orphaned/web/api/navigatoronline/online_and_offline_events/index.html b/files/de/orphaned/web/api/navigatoronline/online_and_offline_events/index.html new file mode 100644 index 0000000000..91f2d23c03 --- /dev/null +++ b/files/de/orphaned/web/api/navigatoronline/online_and_offline_events/index.html @@ -0,0 +1,121 @@ +--- +title: Online- und Offline-Events +slug: orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +translation_of: Web/API/NavigatorOnLine/Online_and_offline_events +original_slug: Web/API/NavigatorOnLine/Online_and_offline_events +--- +

Einige Browser implementieren Online-/Offline-Events basierend auf der WHATWG Web Applications 1.0 specification.

+ +

Übersicht

+ +

Um eine gute offlinefähige Webanwendung erstellen zu können, muss die Anwendung wissen, wann sie offline ist. Zusätzlich muss die Anwendung wissen, wann die Internetverbindung wieder verfügbar ist. Die Voraussetzungen sind also:

+ +
    +
  1. die Anwendung erfährt, wann die Verbindung nach einem Verbindungsabbruch wieder besteht, so dass Änderungen mit dem Server abgeglichen werden können
  2. +
  3. die Anwendung erfährt, wann die Verbindung abbricht, um so Serveranfragen für später in eine Warteschlange einreihen zu können
  4. +
+ +

Dieser Vorgang trägt dazu bei, Online-/Offline Ereignisse zu trivialisieren.

+ +

Oft benötigen Webanwendungen außerdem die Möglichkeit, bestimmte Dokumente im Offline-Cache zu halten. Mehr Informationen darüber gibt es unter Offline resources in Firefox.

+ +

API

+ + + +

navigator.onLine ist eine Eigenschaft mit boole'schem Wert (true für online, false für offline). Sie aktualisiert sich, sobald der Benutzer in den Offline-Modus wechselt, indem der entsprechende Menü-Eintrag angewählt wird (in Firefox: Datei -> Offline-Modus).

+ +

Die Eigenschaft aktualisiert sich außerdem, sobald der Browser nicht mehr in der Lage ist, eine Verbindung herzustellen. Gemäß der Spezifikation:

+ +
The navigator.onLine attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)...
+ +

Firefox 2 aktualisiert diese Eigenschaft beim Wechseln in den Offline-Modus und zurück, sowie beim Abbruch/Wiederaufbau der Netzwerkverbindung in Windows und Linux.

+ +

Diese Eigenschaft existierte bereits in älteren Versionen von Firefox und Internet Explorer (die Spezifikation selbst basiert auf den vorherigen Implementierungen), sodass man sie schon jetzt einsetzen kann. Die Autoerkennung der Konnektivität wurde in Firefox 2 implementiert.

+ +

"online" und "offline" Events

+ +

Mit Firefox 3 gibt es 2 neue Events: "online" und "offline". Diese werden auf dem <body> jeder Sete ausgelöst, wenn der Browser zwischen Online- und Offline-Modus wechselt. Zusätzlich steigen die Events auf von document.body, zu document, und letztlich zu window. Beide können nicht unterbunden werden (man kann den Benutzer nicht daran hindern, online oder offline zu gehen).

+ +

Die Events können auf bekannte Art und Weise registriert werden:

+ + + +

Beispiel

+ +

Es gibt einen einfachen Test, um zu überprüfen, ob die Events funktionieren:

+ +

Hier ist der JavaScript-Teil:

+ +
window.addEventListener('load', function() {
+  var status = document.getElementById("status");
+
+  function updateOnlineStatus(event) {
+    var condition = navigator.onLine ? "online" : "offline";
+
+    status.className = condition;
+    status.innerHTML = condition.toUpperCase();
+
+    log.insertAdjacentHTML("beforeend", "Event: " + event.type + "; Status: " + condition);
+  }
+
+  window.addEventListener('online',  updateOnlineStatus);
+  window.addEventListener('offline', updateOnlineStatus);
+});
+ +

Ein bißchen CSS:

+ +
#status {
+  position : fixed;
+  width: 100%;
+  font : bold 1em sans-serif;
+  color: #FFF:
+  padding : 0.5em
+}
+
+#log {
+  padding: 2.5em 0.5em 0.5em;
+  font: 1em sans-serif;
+}
+
+.online {
+  background: green;
+}
+
+.offline {
+  background: red;
+}
+
+ +

Und das entsprechende HTML:XXX When mochitests for this are created, point to those instead and update this example -nickolay

+ +
<div id="status"></div>
+<div id="log"></div>
+<p>This is a test</p>
+
+ +

Hier ist das Live-Ergebnis:

+ +

{{ EmbedLiveSample('Example', '100%', '150') }}

+ +

Hinweise

+ +

Wenn die API im Browser nicht implementiert ist, gibt es andere Möglichkeiten herauszufinden, ob der Benutzer offline ist: zum Beispiel durch das Reagieren auf AppCache error Ereignissen oder auf Antworten von XMLHttpRequest.

+ +

Verweise

+ + diff --git a/files/de/web/api/navigatoronline/index.html b/files/de/web/api/navigatoronline/index.html deleted file mode 100644 index 11f6707c43..0000000000 --- a/files/de/web/api/navigatoronline/index.html +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -tags: - - API - - HTML-DOM - - NeedsTranslation - - TopicStub -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

- -

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorOnLine interface doesn't inherit any property.

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
-
- -

Methods

- -

The NavigatorOnLine interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

See also

- - diff --git a/files/de/web/api/navigatoronline/online/index.html b/files/de/web/api/navigatoronline/online/index.html deleted file mode 100644 index 2995101bb4..0000000000 --- a/files/de/web/api/navigatoronline/online/index.html +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: NavigatorOnLine.onLine -slug: Web/API/NavigatorOnLine/onLine -tags: - - API - - DOM - - Dokumentation - - Eigenschaft - - Navigation - - NavigatorOnLine - - Offline - - Online - - Reference - - WebAPI -translation_of: Web/API/NavigatorOnLine/onLine ---- -
{{ApiRef("HTML DOM")}}
- -

Diese Eigenschaft gibt einen Wahrheitswert (Bool-Wert) zurück, der Auskunft gibt, ob der Browser eine Internetverbindung aufbauen konnte. Dieser Wert wird immer dann aktualisiert, wenn eine neue Verbindung vom Browser angefordert wurde (durch Script- oder Benutzeraktionen). Es wird "false" zurückgegeben, wenn der letzte Versuch, eine Verbindung aufzubauen, fehlgeschlagen ist.

- -

Einige Browser implementieren diese Funktion verschieden.

- -

Für Chrome und Safari gilt, dass wenn keine Verbindung zum LAN oder Router aufgebaut wurde, der Browser "offline" ist. Andernfalls ist der Browser "online". Das bedeutet, dass aus dem Online-Status nicht die tatsächliche Verbindung erkennbar ist. Wenn der Rückgabewert "false" ist, dann ist mit Sicherheit keine Verbindung vorhanden. Wenn der Wert aber "true" ist, muss dies keine tatsächliche Verbindung zum Internet bedeuten. Auch kann die Ausführung innerhalb einer Virtuellen Maschine den Wert verfälschen. Für weitere Informationen kann dieser HTML5-Rocks Artikel hilfreich sein (in Englisch): Working Off the Grid with HTML5 Offline

- -

Firefox und der Internet Explorer können diesen Wert auch durch die Funktion des "Offline-Modus" verändern. Dann wird auch "false" zurückgegeben, unabhängig vom tatsächlichen Status.

- -

Bis Firefox 41 wurde in allen anderen Fällen "true" zurückgegeben. Seit Version 41 kann der tatsächliche Verbindungsstatus erkannt werden, wenn Firefox auf OS X oder Windows installiert ist.

- -

Es sind auch folgende Ereignisse verfügbar, mit denen unmittelbar auf Änderungen des "OnLine"-Wertes reagiert werden kann.

- - - -

 

- -

Syntax

- -
online = window.navigator.onLine;
-
- -

Value

- -

Der Rückgabewert ist vom Typ "boolean", kann also true oder false sein.

- -

 

- -

Beispiel

- -

Hier das Live-Beispiel

- -

Um zu bestimmen, ob der Browser mit dem Internet verbunden ist, müssen Sie den Wert von window.navigator.onLine wie folgt verwenden:

- -
if (navigator.onLine) {
-  console.log('Verbunden');
-} else {
-  console.log('Getrennt');
-}
- -

Wenn der Browser onLine nicht kennt, wird false oder undefiniert zurückgegeben.

- -

Um auf dir Veränderung des Status direkt reagieren zu können, verwenden Sie addEventListener für die Ereignisse window.ononline und window.onoffline; wie in diesem Beispiel:

- -
window.addEventListener("offline", function(e) { console.log("Nicht Verbunden"); });
-
-window.addEventListener("online", function(e) { console.log("Verbunden"); });
-
- -

 

- -

Spezifikationen

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("HTML WHATWG", "browsers.html#navigator.online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Initial definition
- -

 

- -

Browserkompatibilität

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FunktionChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Einfache Umsetzung{{CompatVersionUnknown}}[1]{{CompatGeckoDesktop(1.9.1)}}[2]
- {{CompatGeckoDesktop(2.0)}}[4]
8[3]{{CompatNo}}[2]5.0.4
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FunktionAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileBlackBerry
Einfache Umsetzung2.2[5]{{CompatGeckoMobile(1.9.1)}}[2]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}} -

7
- 10

-
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] Vorherige Versionen von Chrome geben true unmittelbar nach den öffnen des Tabs zurück. Erst nach der nächsten Netzwerkaktivität wird der richtige Wert zurückgegeben.  Windows: 11, Mac: 14, Chrome OS: 13, Linux: Liefert immer true zurück. Siehe auch crbug.com/7469.

- -

[2] Seit Firefox 4 und Opera 11.10 wird false unabhängig von der tatsächlichen Verbindung zurückgegeben, wenn der "offline"-Modus des Browsers aktiviert wurde. 

- -

[3] Im Internet Explorer 8 werden die "online"- and "offline"-Ereignisse duch document.body ausgelöst; seit dem IE 9 werden diese auch von window ausgelöst.

- -

[4] Seit Firefox 41, auf OS X und Windows, wird der tatsächliche Verbindungstatus zurückgegeben, solange der "offline"-Modus nicht aktivert wurde.

- -

[5] Fehler in der WebView-Komponenten, siehe auch: bug 16760.

- -

 

- -

Hinweise

- -

Für weitere Informationen, siehe auch die  Online/Offline‎-Ereignisse 

- -

 

- -

Verweise

- - diff --git a/files/de/web/api/navigatoronline/online_and_offline_events/index.html b/files/de/web/api/navigatoronline/online_and_offline_events/index.html deleted file mode 100644 index 4bceb46e36..0000000000 --- a/files/de/web/api/navigatoronline/online_and_offline_events/index.html +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: Online- und Offline-Events -slug: Web/API/NavigatorOnLine/Online_and_offline_events -translation_of: Web/API/NavigatorOnLine/Online_and_offline_events ---- -

Einige Browser implementieren Online-/Offline-Events basierend auf der WHATWG Web Applications 1.0 specification.

- -

Übersicht

- -

Um eine gute offlinefähige Webanwendung erstellen zu können, muss die Anwendung wissen, wann sie offline ist. Zusätzlich muss die Anwendung wissen, wann die Internetverbindung wieder verfügbar ist. Die Voraussetzungen sind also:

- -
    -
  1. die Anwendung erfährt, wann die Verbindung nach einem Verbindungsabbruch wieder besteht, so dass Änderungen mit dem Server abgeglichen werden können
  2. -
  3. die Anwendung erfährt, wann die Verbindung abbricht, um so Serveranfragen für später in eine Warteschlange einreihen zu können
  4. -
- -

Dieser Vorgang trägt dazu bei, Online-/Offline Ereignisse zu trivialisieren.

- -

Oft benötigen Webanwendungen außerdem die Möglichkeit, bestimmte Dokumente im Offline-Cache zu halten. Mehr Informationen darüber gibt es unter Offline resources in Firefox.

- -

API

- - - -

navigator.onLine ist eine Eigenschaft mit boole'schem Wert (true für online, false für offline). Sie aktualisiert sich, sobald der Benutzer in den Offline-Modus wechselt, indem der entsprechende Menü-Eintrag angewählt wird (in Firefox: Datei -> Offline-Modus).

- -

Die Eigenschaft aktualisiert sich außerdem, sobald der Browser nicht mehr in der Lage ist, eine Verbindung herzustellen. Gemäß der Spezifikation:

- -
The navigator.onLine attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)...
- -

Firefox 2 aktualisiert diese Eigenschaft beim Wechseln in den Offline-Modus und zurück, sowie beim Abbruch/Wiederaufbau der Netzwerkverbindung in Windows und Linux.

- -

Diese Eigenschaft existierte bereits in älteren Versionen von Firefox und Internet Explorer (die Spezifikation selbst basiert auf den vorherigen Implementierungen), sodass man sie schon jetzt einsetzen kann. Die Autoerkennung der Konnektivität wurde in Firefox 2 implementiert.

- -

"online" und "offline" Events

- -

Mit Firefox 3 gibt es 2 neue Events: "online" und "offline". Diese werden auf dem <body> jeder Sete ausgelöst, wenn der Browser zwischen Online- und Offline-Modus wechselt. Zusätzlich steigen die Events auf von document.body, zu document, und letztlich zu window. Beide können nicht unterbunden werden (man kann den Benutzer nicht daran hindern, online oder offline zu gehen).

- -

Die Events können auf bekannte Art und Weise registriert werden:

- - - -

Beispiel

- -

Es gibt einen einfachen Test, um zu überprüfen, ob die Events funktionieren:

- -

Hier ist der JavaScript-Teil:

- -
window.addEventListener('load', function() {
-  var status = document.getElementById("status");
-
-  function updateOnlineStatus(event) {
-    var condition = navigator.onLine ? "online" : "offline";
-
-    status.className = condition;
-    status.innerHTML = condition.toUpperCase();
-
-    log.insertAdjacentHTML("beforeend", "Event: " + event.type + "; Status: " + condition);
-  }
-
-  window.addEventListener('online',  updateOnlineStatus);
-  window.addEventListener('offline', updateOnlineStatus);
-});
- -

Ein bißchen CSS:

- -
#status {
-  position : fixed;
-  width: 100%;
-  font : bold 1em sans-serif;
-  color: #FFF:
-  padding : 0.5em
-}
-
-#log {
-  padding: 2.5em 0.5em 0.5em;
-  font: 1em sans-serif;
-}
-
-.online {
-  background: green;
-}
-
-.offline {
-  background: red;
-}
-
- -

Und das entsprechende HTML:XXX When mochitests for this are created, point to those instead and update this example -nickolay

- -
<div id="status"></div>
-<div id="log"></div>
-<p>This is a test</p>
-
- -

Hier ist das Live-Ergebnis:

- -

{{ EmbedLiveSample('Example', '100%', '150') }}

- -

Hinweise

- -

Wenn die API im Browser nicht implementiert ist, gibt es andere Möglichkeiten herauszufinden, ob der Benutzer offline ist: zum Beispiel durch das Reagieren auf AppCache error Ereignissen oder auf Antworten von XMLHttpRequest.

- -

Verweise

- - diff --git a/files/es/_redirects.txt b/files/es/_redirects.txt index 1ae0cb1b94..6973e1efe2 100644 --- a/files/es/_redirects.txt +++ b/files/es/_redirects.txt @@ -453,7 +453,7 @@ /es/docs/EXSLT:str:split /es/docs/Web/EXSLT/str/split /es/docs/EXSLT:str:tokenize /es/docs/Web/EXSLT/str/tokenize /es/docs/Errores_notables_corregidos_en_Firefox_3 /es/docs/Mozilla/Firefox/Releases/3/Notable_bugs_fixed -/es/docs/Eventos_online_y_offline /es/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/es/docs/Eventos_online_y_offline /es/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /es/docs/Extensión_Firebug_(externo) https://addons.mozilla.org/extensions/moreinfo.php?id=1843&application=firefox /es/docs/FUEL:Annotations /es/docs/FUEL/Annotations /es/docs/FUEL:Application /es/docs/FUEL/Application @@ -1644,8 +1644,15 @@ /es/docs/Web/API/IDBObjectStore.add /es/docs/Web/API/IDBObjectStore/add /es/docs/Web/API/IndexedDB_API/Usando_IndexedDB /es/docs/Web/API/IndexedDB_API/Using_IndexedDB /es/docs/Web/API/Navigator.getUserMedia /es/docs/Web/API/Navigator/getUserMedia +/es/docs/Web/API/NavigatorConcurrentHardware /es/docs/orphaned/Web/API/NavigatorConcurrentHardware +/es/docs/Web/API/NavigatorConcurrentHardware/hardwareConcurrency /es/docs/orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency /es/docs/Web/API/NavigatorGeolocation/geolocation /es/docs/Web/API/Navigator/geolocation -/es/docs/Web/API/NavigatorOnLine/Eventos_online_y_offline /es/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/es/docs/Web/API/NavigatorLanguage /es/docs/orphaned/Web/API/NavigatorLanguage +/es/docs/Web/API/NavigatorLanguage/language /es/docs/orphaned/Web/API/NavigatorLanguage/language +/es/docs/Web/API/NavigatorOnLine /es/docs/orphaned/Web/API/NavigatorOnLine +/es/docs/Web/API/NavigatorOnLine/Eventos_online_y_offline /es/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/es/docs/Web/API/NavigatorOnLine/Online_and_offline_events /es/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/es/docs/Web/API/NavigatorOnLine/onLine /es/docs/orphaned/Web/API/NavigatorOnLine/onLine /es/docs/Web/API/Node.nextSibling /es/docs/Web/API/Node/nextSibling /es/docs/Web/API/Node/elementoPadre /es/docs/Web/API/Node/parentElement /es/docs/Web/API/Node/insertarAntes /es/docs/Web/API/Node/insertBefore diff --git a/files/es/_wikihistory.json b/files/es/_wikihistory.json index d5ef8ed468..0b33de87c6 100644 --- a/files/es/_wikihistory.json +++ b/files/es/_wikihistory.json @@ -8001,50 +8001,6 @@ "mmednik" ] }, - "Web/API/NavigatorConcurrentHardware": { - "modified": "2020-10-15T22:25:58.692Z" - }, - "Web/API/NavigatorConcurrentHardware/hardwareConcurrency": { - "modified": "2020-10-15T22:26:06.271Z", - "contributors": [ - "Gnuxdar" - ] - }, - "Web/API/NavigatorLanguage": { - "modified": "2019-03-23T22:46:20.556Z", - "contributors": [ - "teoli" - ] - }, - "Web/API/NavigatorLanguage/language": { - "modified": "2019-03-23T22:46:24.341Z", - "contributors": [ - "cesiztel", - "jesus9ias" - ] - }, - "Web/API/NavigatorOnLine": { - "modified": "2019-03-23T22:07:33.991Z", - "contributors": [ - "abbycar" - ] - }, - "Web/API/NavigatorOnLine/Online_and_offline_events": { - "modified": "2019-01-16T15:46:38.836Z", - "contributors": [ - "chrisdavidmills", - "Mgjbot", - "Nukeador", - "RickieesES", - "Unixcoder" - ] - }, - "Web/API/NavigatorOnLine/onLine": { - "modified": "2019-03-23T22:07:34.200Z", - "contributors": [ - "MarkelCuesta" - ] - }, "Web/API/Network_Information_API": { "modified": "2020-11-17T00:17:37.419Z", "contributors": [ @@ -23291,6 +23247,50 @@ "sebasmagri" ] }, + "orphaned/Web/API/NavigatorConcurrentHardware": { + "modified": "2020-10-15T22:25:58.692Z" + }, + "orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency": { + "modified": "2020-10-15T22:26:06.271Z", + "contributors": [ + "Gnuxdar" + ] + }, + "orphaned/Web/API/NavigatorLanguage": { + "modified": "2019-03-23T22:46:20.556Z", + "contributors": [ + "teoli" + ] + }, + "orphaned/Web/API/NavigatorLanguage/language": { + "modified": "2019-03-23T22:46:24.341Z", + "contributors": [ + "cesiztel", + "jesus9ias" + ] + }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2019-03-23T22:07:33.991Z", + "contributors": [ + "abbycar" + ] + }, + "orphaned/Web/API/NavigatorOnLine/Online_and_offline_events": { + "modified": "2019-01-16T15:46:38.836Z", + "contributors": [ + "chrisdavidmills", + "Mgjbot", + "Nukeador", + "RickieesES", + "Unixcoder" + ] + }, + "orphaned/Web/API/NavigatorOnLine/onLine": { + "modified": "2019-03-23T22:07:34.200Z", + "contributors": [ + "MarkelCuesta" + ] + }, "orphaned/Web/API/ParentNode": { "modified": "2019-03-23T22:43:20.773Z", "contributors": [ diff --git a/files/es/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html b/files/es/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html new file mode 100644 index 0000000000..d43e59b609 --- /dev/null +++ b/files/es/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html @@ -0,0 +1,70 @@ +--- +title: navigator.hardwareConcurrency +slug: orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency +translation_of: Web/API/NavigatorConcurrentHardware/hardwareConcurrency +original_slug: Web/API/NavigatorConcurrentHardware/hardwareConcurrency +--- +

{{APIRef("HTML DOM")}}

+ +

{{AvailableInWorkers}}

+ +

La propiedad navigator.hardwareConcurrency  es de solo lectura navigator.hardwareConcurrency devuelve el número de procesadores lógicos disponibles para ejecutar subprocesos en la computadora del usuario.

+ +

Sintaxi

+ +
logicalProcessors = window.navigator.hardwareConcurrency
+
+ +

Valor

+ +

{{jsxref("Number")}} indica el número de núcleos de procesadores lógicos.

+ +

Las computadoras modernas tienen múltiples núcleos de procesadores físicos en su CPU (dos o cuatro núcleos son típicos), pero cada núcleo físico también puede ejecutar más de un subproceso a la vez utilizando técnicas avanzadas de programación. Por lo tanto, una CPU de cuatro núcleos puede ofrecer ocho núcleos de procesador lógico, por ejemplo. El número de núcleos de procesador lógico se puede utilizar para medir el número de subprocesos que se pueden ejecutar de manera efectiva a la vez sin que tengan que cambiar de contexto.

+ +

 Sin embargo, el navegador puede optar por informar un número menor de núcleos lógicos para representar con mayor precisión el número de {{domxref("Worker")}}s que pueden ejecutarse a la vez, así que no trate esto como una medida absoluta del número de núcleos en el sistema del usuario .

+ +

Ejemplos

+ +

En este ejemplo, se crea un {{domxref ("Worker")}} para cada procesador lógico informado por el navegador y se crea un registro que incluye una referencia al nuevo worker, así como un valor booleano que indica si nosotros ' estoy usando ese worker todavía; Estos objetos, a su vez, se almacenan en una matriz para su uso posterior. Esto crea un grupo de workers que podemos usar para procesar solicitudes más adelante.

+ +
let workerList = [];
+
+for (let i = 0; i < window.navigator.hardwareConcurrency; i++) {
+  let newWorker = {
+    worker: new Worker('cpuworker.js'),
+    inUse: false
+  };
+  workerList.push(newWorker);
+}
+ +

Specification

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-navigator-hardwareconcurrency', 'navigator.hardwareConcurrency')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

Browser compatibility

+ +
+ + +

{{Compat("api.NavigatorConcurrentHardware.hardwareConcurrency")}}

+
+ +

See also

+ + diff --git a/files/es/orphaned/web/api/navigatorconcurrenthardware/index.html b/files/es/orphaned/web/api/navigatorconcurrenthardware/index.html new file mode 100644 index 0000000000..43e5ae1965 --- /dev/null +++ b/files/es/orphaned/web/api/navigatorconcurrenthardware/index.html @@ -0,0 +1,72 @@ +--- +title: NavigatorConcurrentHardware +slug: orphaned/Web/API/NavigatorConcurrentHardware +tags: + - API + - Concurrency + - HTML DOM + - Interface + - Navigator + - NavigatorCPU + - NavigatorConcurrentHardware + - NeedsBrowserCompatibility + - NeedsTranslation + - Reference + - Threading + - Threads + - TopicStub + - WorkerNavigator + - Workers +translation_of: Web/API/NavigatorConcurrentHardware +original_slug: Web/API/NavigatorConcurrentHardware +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorConcurrentHardware {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} interface features which allow Web content to determine how many logical processors the user has available, in order to let content and Web apps optimize their operations to best take advantage of the user's CPU.

+ +

{{AvailableInWorkers}}

+ +

The number of logical processor cores is a way to measure the number of threads which can effectively be run at once without them having to share CPUs. Modern computers have multiple physical cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may return 8. The browser may, however, choose to reduce the number in order to represent more accurately the number of {{domxref("Worker")}}s that can run at once

+ +

Properties

+ +
+
{{domxref("NavigatorConcurrentHardware.hardwareConcurrency")}} {{readonlyinline}}
+
Returns the number of logical processors which may be available to the user agent. This value is always at least 1, and will be 1 if the actual number of logical processors can't be determined.
+
+ +

Methods

+ +

The NavigatorConcurrentHardware mixin has no methods.

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorconcurrenthardware', 'NavigatorConcurrentHardware')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.NavigatorConcurrentHardware")}}

+ +

See also

+ + diff --git a/files/es/orphaned/web/api/navigatorlanguage/index.html b/files/es/orphaned/web/api/navigatorlanguage/index.html new file mode 100644 index 0000000000..fc736ce50b --- /dev/null +++ b/files/es/orphaned/web/api/navigatorlanguage/index.html @@ -0,0 +1,149 @@ +--- +title: NavigatorLanguage +slug: orphaned/Web/API/NavigatorLanguage +tags: + - API + - HTML-DOM + - NeedsTranslation + - No Interface + - Reference + - TopicStub +translation_of: Web/API/NavigatorLanguage +original_slug: Web/API/NavigatorLanguage +--- +

{{APIRef("HTML DOM")}}

+ +

NavigatorLanguage contains methods and properties related to the language of the navigator.

+ +

There is no object of type NavigatorLanguage, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorLanguage interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
+
Returns a {{domxref("DOMString")}} representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
+
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
+
Returns an array of {{domxref("DOMString")}} representing the languages known to the user, by order of preference.
+
+ +

Methods

+ +

The NavigatorLanguage interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Since the {{SpecName('HTML5 W3C')}} snapshot, the languages property has been added.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Initial specification; snapshot of  an early version{{SpecName('HTML WHATWG')}}.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages37{{CompatGeckoDesktop("32")}}{{CompatNo}}24{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages{{CompatUnknown}}{{CompatUnknown}} {{CompatGeckoMobile("32")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
+
+ +

See also

+ + diff --git a/files/es/orphaned/web/api/navigatorlanguage/language/index.html b/files/es/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..6c8ea79904 --- /dev/null +++ b/files/es/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,134 @@ +--- +title: NavigatorLanguage.language +slug: orphaned/Web/API/NavigatorLanguage/language +tags: + - API + - Gecko + - Idioma + - Lenguaje + - NavigatorLanguage + - Propiedad + - Referencia + - Referencia DOM de Gecko + - Solo lectura +translation_of: Web/API/NavigatorLanguage/language +original_slug: Web/API/NavigatorLanguage/language +--- +
{{APIRef("HTML DOM")}}
+ +

La propiedad de solo lectura NavigatorLanguage.language devuelve un string representando el lenguaje predefinido del usuario, generalmente es el lenguaje configurado para la interfaz del navegador.

+ +

Sintaxis

+ +
lang = globalObj.navigator.language
+
+ +

Valores

+ +

Un string que representa el código del lenguaje standard como se define en la BCP 47. Ejemplos de códigos válidos de lenguaje incluyen: "en", "en-US", "fr", "es-ES", etc.

+ +

Ejemplo

+ +
if (window.navigator.language != "en") {
+  doLangSelect(window.navigator.language);
+}
+
+ +

Especificaciones

+ + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
{{ SpecName('HTML5.1', '#dom-navigator-language', 'NavigatorLanguage.language') }}{{ Spec2('HTML5.1') }}Definición inicial
+ +

Compatibilidad en navegadores

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Soporte básico{{CompatVersionUnknown}}[1]{{CompatGeckoDesktop("1.0")}}[2]
+ {{CompatGeckoDesktop("5.0")}}[3]
11.0[4]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
sobre {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte básico{{CompatVersionUnknown}}{{CompatGeckoMobile(1.0)}}{{CompatNo}}[4]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
sobre {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

[1] Devuelve el lenguaje configurado para la interfaz del navegador, no el valor de la Accept-Language HTTP header.

+ +

[2] Antes de Gecko 2.0 {{geckoRelease("2.0")}}, el valor de esta propiedad fue también parte de la cadena de user agent, como se informa en {{domxref("window.navigator.userAgent", "navigator.userAgent")}}.

+ +

[3] A partir de  Gecko 5.0 {{geckoRelease("5.0")}}, el valor de esta propiedad está basada en el valor de la Accept-Language HTTP header.

+ +

[4] Otras propiedades disponibles (no estandarizadas) son: userLanguage y browserLanguage.

+ +

Ver también

+ + diff --git a/files/es/orphaned/web/api/navigatoronline/index.html b/files/es/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..d4ebd4037d --- /dev/null +++ b/files/es/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,134 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +tags: + - API + - HTML-DOM + - NeedsTranslation + - TopicStub +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

+ +

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorOnLine interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
+
+ +

Methods

+ +

The NavigatorOnLine interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

See also

+ + diff --git a/files/es/orphaned/web/api/navigatoronline/online/index.html b/files/es/orphaned/web/api/navigatoronline/online/index.html new file mode 100644 index 0000000000..8a9ff9fb13 --- /dev/null +++ b/files/es/orphaned/web/api/navigatoronline/online/index.html @@ -0,0 +1,167 @@ +--- +title: Navigator.onLine +slug: orphaned/Web/API/NavigatorOnLine/onLine +translation_of: Web/API/NavigatorOnLine/onLine +original_slug: Web/API/NavigatorOnLine/onLine +--- +
{{ApiRef("HTML DOM")}}
+ +

Retorna el estado en línea del navegador. La propiedad retorna un valor booleano,  true significa en línea y false significa desconectado. La propiedad envía actualizaciones siempre que el navegador tenga la capacidad de conectarse a los cambios de red. La actualización se produce cuando un usuario sigue un enlace o cuando un script pide una pagina remota. Por ejemplo, la propiedad debe retornar false cuando los usuarios hacen clic en un enlace poco después de perder la conexión a internet.

+ +

Los navegadores implementan esta propiedad de forma diferente.

+ +

En Chrome y Safari, si el navegador no puede conectarse a la red de area local (LAN) o al router, está desconectado; todas las otras condiciones retornan true. Así que puedes suponer que el navegador esta desconectado cuando retorna un valor false, no puedes suponer que un valor true signifique que el navegador puede acceder a internet. Podrías estar recibiendo falsos positivos, como en los casos en el que el ordenador este ejecutando un software de virtualización que tiene los adaptadores ethernet virtuales siempre "conectados". Por lo tanto, si tu quieres determinar el estado en linea de el navegador, tu debes desarrollar medios adicionales para comprobarlo. Para más información, consulte el artículo HTML5 Rocks article, Working Off the Grid.

+ +

En Firefox e Internet Explorer, cambiando el navegador al modo desconectado envía un valor false. Hasta Firefox 41, todas las demás condiciones retornaban un valor true; desde Firefox 41, en OS X y Windows, el valor sigue la actual conectividad de red.

+ +

Puedes ver los cambios en el estado de red escuchando los eventos window.ononline y window.onoffline.

+ +

Sintaxis

+ +
online = window.navigator.onLine;
+
+ +

Valor

+ +

online es booleano true o false.

+ +

Ejemplo

+ +

Ver ejemplo en linea.

+ +

Para comprobar que estas es linea, consulte window.navigator.onLine, como en el siguiente ejemplo: 

+ +
if (navigator.onLine) {
+  console.log('online');
+} else {
+  console.log('offline');
+}
+ +

Si el navegador no soporta navigator.onLine el ejemplo anterior siempre devolvera false/undefined.

+ +

Para ver los cambios en el estado de la red, use addEventListener para escuchar los eventos window.ononline y window.onoffline, como en el siguiente ejemplo:

+ +
window.addEventListener('offline', function(e) { console.log('offline'); });
+
+window.addEventListener('online', function(e) { console.log('online'); });
+
+ +

Especificaciones

+ + + + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
{{SpecName("HTML WHATWG", "browsers.html#navigator.online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Initial definition
+ +

Compatibilidad de navegadores

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}[1]{{CompatVersionUnknown}}{{CompatGeckoDesktop(1.9.1)}}[2]
+ {{CompatGeckoDesktop(2.0)}}[4]
8[3]{{CompatNo}}[2]5.0.4
on {{domxref("WorkerNavigator")}}Yes{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileBlackBerry
Basic support2.2[5]{{CompatVersionUnknown}}{{CompatGeckoMobile(1.9.1)}}[2]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}} +

7
+ 10

+
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

[1] Earlier versions of Chrome incorrectly return true when a tab is first opened, but it starts reporting the correct connectivity status after the first network event. Windows: 11, Mac: 14, Chrome OS: 13, Linux: Always returns true. For history, see crbug.com/7469.

+ +

[2] Since Firefox 4, and Opera 11.10, the browser returns true when "Work Offline" mode is disabled and false when it is enabled, regardless of actual connectivity.

+ +

[3] in Internet Explorer 8 "online" and "offline" events are raised on the document.body; under IE 9 they are raised on both document.body and window.

+ +

[4] Since Firefox 41, on OS X and Windows, the returned values follow the actual network connectivity, unless "Work offline" mode is selected (where it will always return false).

+ +

[5] Faulty in a WebView component, see Issue bug 16760.

+ +

Notas

+ +

See Online/Offline Events‎ for a more detailed description of this property as well as new offline-related features introduced in Firefox 3.

+ +

Véase también

+ + diff --git a/files/es/orphaned/web/api/navigatoronline/online_and_offline_events/index.html b/files/es/orphaned/web/api/navigatoronline/online_and_offline_events/index.html new file mode 100644 index 0000000000..d92ff00472 --- /dev/null +++ b/files/es/orphaned/web/api/navigatoronline/online_and_offline_events/index.html @@ -0,0 +1,92 @@ +--- +title: Eventos online y offline +slug: orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +tags: + - AJAX + - DOM + - Desarrollo_Web + - Todas_las_Categorías +translation_of: Web/API/NavigatorOnLine/Online_and_offline_events +original_slug: Web/API/NavigatorOnLine/Online_and_offline_events +--- +

+Firefox 3 implementa eventos Online/Offline de la especificacióbn WHATWG Web Applications 1.0. +

+

Descripción

+

Para poder construir una aplicación web offline-funcional, necesitas conocer cuándo está tu aplicación realmente offline. Además, también necesitas conocer cuándo vuelve la aplicación al estado 'online' nuevamente. A efectos prácticos, los requisitos son los siguientes: +

+
  1. Necesitas conocer cuándo el usuario vuelve a estar online, para que puedas re-sincronizar con el servidor. +
  2. Necesitas conocer cuándo el usuario está offline, para así estar seguro de poner en cola las peticiones al servidor para más tarde. +
+

Es este proceso el que los eventos online/offline ayudan a trivializar. +

Tu aplicación web quizás necesite establecer que ciertos documentos se mantengan en la caché de recursos offline. Para hacerlo, incluye elementos LINK en tu sección HEAD de la siguiente manera: +

+
<link rel="offline-resource" href="mi_recurso>
+
+

Cuando Firefox 3 o superiores procesan el HTML, esto causará que el recurso referenciado se mantenga en caché para su uso offline en un recurso especial de la caché. +

+

API

+ +

navigator.onLine es una propiedad que mantiene un valor true/false (true para online, false para offline). Esta propiedad se actualiza siempre que el usuario cambia hacia "Modo sin conexión" seleccionando el menú correspondiente (Archivo -> Trabajar sin conexión en Firefox). +

Además, esta propiedad se debería actualizar siempre que el navegador no sea capaz de conectarse a la red. De acuerdo con la especificación: +

+
+El atributo navigator.onLine debe devolver false si el agente de usuario no contactará con la red cuando el usuario siga los enlaces o cuando un script solicite una página remota (o sepa que intentarlo fallaría)... +
+

Firefox 2 actualiza esta propiedad cuando cambia desde/hacia el modo offline del navegador, y cuando pierde/recupera la conectividad de la red en Windows y Linux. +

Esta propiedad existía en versiones más antiguas de Firefox e Internet Explorer (la especificación surgió a partir estas implementaciones previas), así que puedes comenzar a usarla inmediatamente. La detección automática del estado de la red se implementó en Firefox 2. +

+

eventos "online" y "offline"

+

Firefox 3 introduce dos nuevos eventos: "online" y "offline". Estos dos eventos son iniciados en el <body> de cada página cuando el usuario cambia de modo online a offline. Además, los eventos emergen desde document.body a document, terminando en window. Ambos eventos son no-cancelables (no se puede evitar que el usuario pase a modo online u offline). +

Puedes registrar listeners para estos eventos de varias maneras habituales: +

+ +

Ejemplo:

+

Hay una prueba sencilla que puedes ejecutar para verificar que los eventos están funcionando. +

+

+
 <!doctype html>
+ <html>
+ <head>
+   <script>
+     function updateOnlineStatus(msg) {
+       var status = document.getElementById("status");
+       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
+       status.setAttribute("class", condition);
+       var state = document.getElementById("state");
+       state.innerHTML = condition;
+       var log = document.getElementById("log");
+       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
+     }
+     function loaded() {
+       updateOnlineStatus("load");
+       document.body.addEventListener("offline", function () {
+         updateOnlineStatus("offline")
+       }, false);
+       document.body.addEventListener("online", function () {
+         updateOnlineStatus("online")
+       }, false);
+     }
+   </script>
+   <style>...</style>
+ </head>
+ <body onload="loaded()">
+   <div id="status"><p id="state"></p></div>
+   <div id="log"></div>
+ </body>
+ </html>
+
+

Referencias

+ +


+

+
+
+{{ languages( { "en": "en/Online_and_offline_events", "fr": "fr/\u00c9v\u00e8nements_online_et_offline", "ja": "ja/Online_and_offline_events", "pl": "pl/Zdarzenia_online_i_offline", "pt": "pt/Eventos_online_e_offline" } ) }} diff --git a/files/es/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html b/files/es/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html deleted file mode 100644 index ed2116fa94..0000000000 --- a/files/es/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: navigator.hardwareConcurrency -slug: Web/API/NavigatorConcurrentHardware/hardwareConcurrency -translation_of: Web/API/NavigatorConcurrentHardware/hardwareConcurrency ---- -

{{APIRef("HTML DOM")}}

- -

{{AvailableInWorkers}}

- -

La propiedad navigator.hardwareConcurrency  es de solo lectura navigator.hardwareConcurrency devuelve el número de procesadores lógicos disponibles para ejecutar subprocesos en la computadora del usuario.

- -

Sintaxi

- -
logicalProcessors = window.navigator.hardwareConcurrency
-
- -

Valor

- -

{{jsxref("Number")}} indica el número de núcleos de procesadores lógicos.

- -

Las computadoras modernas tienen múltiples núcleos de procesadores físicos en su CPU (dos o cuatro núcleos son típicos), pero cada núcleo físico también puede ejecutar más de un subproceso a la vez utilizando técnicas avanzadas de programación. Por lo tanto, una CPU de cuatro núcleos puede ofrecer ocho núcleos de procesador lógico, por ejemplo. El número de núcleos de procesador lógico se puede utilizar para medir el número de subprocesos que se pueden ejecutar de manera efectiva a la vez sin que tengan que cambiar de contexto.

- -

 Sin embargo, el navegador puede optar por informar un número menor de núcleos lógicos para representar con mayor precisión el número de {{domxref("Worker")}}s que pueden ejecutarse a la vez, así que no trate esto como una medida absoluta del número de núcleos en el sistema del usuario .

- -

Ejemplos

- -

En este ejemplo, se crea un {{domxref ("Worker")}} para cada procesador lógico informado por el navegador y se crea un registro que incluye una referencia al nuevo worker, así como un valor booleano que indica si nosotros ' estoy usando ese worker todavía; Estos objetos, a su vez, se almacenan en una matriz para su uso posterior. Esto crea un grupo de workers que podemos usar para procesar solicitudes más adelante.

- -
let workerList = [];
-
-for (let i = 0; i < window.navigator.hardwareConcurrency; i++) {
-  let newWorker = {
-    worker: new Worker('cpuworker.js'),
-    inUse: false
-  };
-  workerList.push(newWorker);
-}
- -

Specification

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-navigator-hardwareconcurrency', 'navigator.hardwareConcurrency')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -
- - -

{{Compat("api.NavigatorConcurrentHardware.hardwareConcurrency")}}

-
- -

See also

- - diff --git a/files/es/web/api/navigatorconcurrenthardware/index.html b/files/es/web/api/navigatorconcurrenthardware/index.html deleted file mode 100644 index d7cee835c0..0000000000 --- a/files/es/web/api/navigatorconcurrenthardware/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: NavigatorConcurrentHardware -slug: Web/API/NavigatorConcurrentHardware -tags: - - API - - Concurrency - - HTML DOM - - Interface - - Navigator - - NavigatorCPU - - NavigatorConcurrentHardware - - NeedsBrowserCompatibility - - NeedsTranslation - - Reference - - Threading - - Threads - - TopicStub - - WorkerNavigator - - Workers -translation_of: Web/API/NavigatorConcurrentHardware ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorConcurrentHardware {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} interface features which allow Web content to determine how many logical processors the user has available, in order to let content and Web apps optimize their operations to best take advantage of the user's CPU.

- -

{{AvailableInWorkers}}

- -

The number of logical processor cores is a way to measure the number of threads which can effectively be run at once without them having to share CPUs. Modern computers have multiple physical cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may return 8. The browser may, however, choose to reduce the number in order to represent more accurately the number of {{domxref("Worker")}}s that can run at once

- -

Properties

- -
-
{{domxref("NavigatorConcurrentHardware.hardwareConcurrency")}} {{readonlyinline}}
-
Returns the number of logical processors which may be available to the user agent. This value is always at least 1, and will be 1 if the actual number of logical processors can't be determined.
-
- -

Methods

- -

The NavigatorConcurrentHardware mixin has no methods.

- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorconcurrenthardware', 'NavigatorConcurrentHardware')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- - - -

{{Compat("api.NavigatorConcurrentHardware")}}

- -

See also

- - diff --git a/files/es/web/api/navigatorlanguage/index.html b/files/es/web/api/navigatorlanguage/index.html deleted file mode 100644 index 7d6b0751e7..0000000000 --- a/files/es/web/api/navigatorlanguage/index.html +++ /dev/null @@ -1,148 +0,0 @@ ---- -title: NavigatorLanguage -slug: Web/API/NavigatorLanguage -tags: - - API - - HTML-DOM - - NeedsTranslation - - No Interface - - Reference - - TopicStub -translation_of: Web/API/NavigatorLanguage ---- -

{{APIRef("HTML DOM")}}

- -

NavigatorLanguage contains methods and properties related to the language of the navigator.

- -

There is no object of type NavigatorLanguage, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorLanguage interface doesn't inherit any property.

- -
-
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
-
Returns a {{domxref("DOMString")}} representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
-
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
-
Returns an array of {{domxref("DOMString")}} representing the languages known to the user, by order of preference.
-
- -

Methods

- -

The NavigatorLanguage interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Since the {{SpecName('HTML5 W3C')}} snapshot, the languages property has been added.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Initial specification; snapshot of  an early version{{SpecName('HTML WHATWG')}}.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages37{{CompatGeckoDesktop("32")}}{{CompatNo}}24{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages{{CompatUnknown}}{{CompatUnknown}} {{CompatGeckoMobile("32")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
-
- -

See also

- - diff --git a/files/es/web/api/navigatorlanguage/language/index.html b/files/es/web/api/navigatorlanguage/language/index.html deleted file mode 100644 index a8c388b631..0000000000 --- a/files/es/web/api/navigatorlanguage/language/index.html +++ /dev/null @@ -1,133 +0,0 @@ ---- -title: NavigatorLanguage.language -slug: Web/API/NavigatorLanguage/language -tags: - - API - - Gecko - - Idioma - - Lenguaje - - NavigatorLanguage - - Propiedad - - Referencia - - Referencia DOM de Gecko - - Solo lectura -translation_of: Web/API/NavigatorLanguage/language ---- -
{{APIRef("HTML DOM")}}
- -

La propiedad de solo lectura NavigatorLanguage.language devuelve un string representando el lenguaje predefinido del usuario, generalmente es el lenguaje configurado para la interfaz del navegador.

- -

Sintaxis

- -
lang = globalObj.navigator.language
-
- -

Valores

- -

Un string que representa el código del lenguaje standard como se define en la BCP 47. Ejemplos de códigos válidos de lenguaje incluyen: "en", "en-US", "fr", "es-ES", etc.

- -

Ejemplo

- -
if (window.navigator.language != "en") {
-  doLangSelect(window.navigator.language);
-}
-
- -

Especificaciones

- - - - - - - - - - - - - - -
EspecificaciónEstadoComentario
{{ SpecName('HTML5.1', '#dom-navigator-language', 'NavigatorLanguage.language') }}{{ Spec2('HTML5.1') }}Definición inicial
- -

Compatibilidad en navegadores

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Soporte básico{{CompatVersionUnknown}}[1]{{CompatGeckoDesktop("1.0")}}[2]
- {{CompatGeckoDesktop("5.0")}}[3]
11.0[4]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
sobre {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
CaracterísticaAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte básico{{CompatVersionUnknown}}{{CompatGeckoMobile(1.0)}}{{CompatNo}}[4]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
sobre {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] Devuelve el lenguaje configurado para la interfaz del navegador, no el valor de la Accept-Language HTTP header.

- -

[2] Antes de Gecko 2.0 {{geckoRelease("2.0")}}, el valor de esta propiedad fue también parte de la cadena de user agent, como se informa en {{domxref("window.navigator.userAgent", "navigator.userAgent")}}.

- -

[3] A partir de  Gecko 5.0 {{geckoRelease("5.0")}}, el valor de esta propiedad está basada en el valor de la Accept-Language HTTP header.

- -

[4] Otras propiedades disponibles (no estandarizadas) son: userLanguage y browserLanguage.

- -

Ver también

- - diff --git a/files/es/web/api/navigatoronline/index.html b/files/es/web/api/navigatoronline/index.html deleted file mode 100644 index 7aa4d6c0e1..0000000000 --- a/files/es/web/api/navigatoronline/index.html +++ /dev/null @@ -1,133 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -tags: - - API - - HTML-DOM - - NeedsTranslation - - TopicStub -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

- -

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorOnLine interface doesn't inherit any property.

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
-
- -

Methods

- -

The NavigatorOnLine interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

See also

- - diff --git a/files/es/web/api/navigatoronline/online/index.html b/files/es/web/api/navigatoronline/online/index.html deleted file mode 100644 index cc74bdbb8b..0000000000 --- a/files/es/web/api/navigatoronline/online/index.html +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: Navigator.onLine -slug: Web/API/NavigatorOnLine/onLine -translation_of: Web/API/NavigatorOnLine/onLine ---- -
{{ApiRef("HTML DOM")}}
- -

Retorna el estado en línea del navegador. La propiedad retorna un valor booleano,  true significa en línea y false significa desconectado. La propiedad envía actualizaciones siempre que el navegador tenga la capacidad de conectarse a los cambios de red. La actualización se produce cuando un usuario sigue un enlace o cuando un script pide una pagina remota. Por ejemplo, la propiedad debe retornar false cuando los usuarios hacen clic en un enlace poco después de perder la conexión a internet.

- -

Los navegadores implementan esta propiedad de forma diferente.

- -

En Chrome y Safari, si el navegador no puede conectarse a la red de area local (LAN) o al router, está desconectado; todas las otras condiciones retornan true. Así que puedes suponer que el navegador esta desconectado cuando retorna un valor false, no puedes suponer que un valor true signifique que el navegador puede acceder a internet. Podrías estar recibiendo falsos positivos, como en los casos en el que el ordenador este ejecutando un software de virtualización que tiene los adaptadores ethernet virtuales siempre "conectados". Por lo tanto, si tu quieres determinar el estado en linea de el navegador, tu debes desarrollar medios adicionales para comprobarlo. Para más información, consulte el artículo HTML5 Rocks article, Working Off the Grid.

- -

En Firefox e Internet Explorer, cambiando el navegador al modo desconectado envía un valor false. Hasta Firefox 41, todas las demás condiciones retornaban un valor true; desde Firefox 41, en OS X y Windows, el valor sigue la actual conectividad de red.

- -

Puedes ver los cambios en el estado de red escuchando los eventos window.ononline y window.onoffline.

- -

Sintaxis

- -
online = window.navigator.onLine;
-
- -

Valor

- -

online es booleano true o false.

- -

Ejemplo

- -

Ver ejemplo en linea.

- -

Para comprobar que estas es linea, consulte window.navigator.onLine, como en el siguiente ejemplo: 

- -
if (navigator.onLine) {
-  console.log('online');
-} else {
-  console.log('offline');
-}
- -

Si el navegador no soporta navigator.onLine el ejemplo anterior siempre devolvera false/undefined.

- -

Para ver los cambios en el estado de la red, use addEventListener para escuchar los eventos window.ononline y window.onoffline, como en el siguiente ejemplo:

- -
window.addEventListener('offline', function(e) { console.log('offline'); });
-
-window.addEventListener('online', function(e) { console.log('online'); });
-
- -

Especificaciones

- - - - - - - - - - - - - - - - -
EspecificaciónEstadoComentario
{{SpecName("HTML WHATWG", "browsers.html#navigator.online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Initial definition
- -

Compatibilidad de navegadores

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}[1]{{CompatVersionUnknown}}{{CompatGeckoDesktop(1.9.1)}}[2]
- {{CompatGeckoDesktop(2.0)}}[4]
8[3]{{CompatNo}}[2]5.0.4
on {{domxref("WorkerNavigator")}}Yes{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileBlackBerry
Basic support2.2[5]{{CompatVersionUnknown}}{{CompatGeckoMobile(1.9.1)}}[2]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}} -

7
- 10

-
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] Earlier versions of Chrome incorrectly return true when a tab is first opened, but it starts reporting the correct connectivity status after the first network event. Windows: 11, Mac: 14, Chrome OS: 13, Linux: Always returns true. For history, see crbug.com/7469.

- -

[2] Since Firefox 4, and Opera 11.10, the browser returns true when "Work Offline" mode is disabled and false when it is enabled, regardless of actual connectivity.

- -

[3] in Internet Explorer 8 "online" and "offline" events are raised on the document.body; under IE 9 they are raised on both document.body and window.

- -

[4] Since Firefox 41, on OS X and Windows, the returned values follow the actual network connectivity, unless "Work offline" mode is selected (where it will always return false).

- -

[5] Faulty in a WebView component, see Issue bug 16760.

- -

Notas

- -

See Online/Offline Events‎ for a more detailed description of this property as well as new offline-related features introduced in Firefox 3.

- -

Véase también

- - diff --git a/files/es/web/api/navigatoronline/online_and_offline_events/index.html b/files/es/web/api/navigatoronline/online_and_offline_events/index.html deleted file mode 100644 index 639f0434a6..0000000000 --- a/files/es/web/api/navigatoronline/online_and_offline_events/index.html +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: Eventos online y offline -slug: Web/API/NavigatorOnLine/Online_and_offline_events -tags: - - AJAX - - DOM - - Desarrollo_Web - - Todas_las_Categorías -translation_of: Web/API/NavigatorOnLine/Online_and_offline_events -original_slug: Web/API/NavigatorOnLine/Eventos_online_y_offline ---- -

-Firefox 3 implementa eventos Online/Offline de la especificacióbn WHATWG Web Applications 1.0. -

-

Descripción

-

Para poder construir una aplicación web offline-funcional, necesitas conocer cuándo está tu aplicación realmente offline. Además, también necesitas conocer cuándo vuelve la aplicación al estado 'online' nuevamente. A efectos prácticos, los requisitos son los siguientes: -

-
  1. Necesitas conocer cuándo el usuario vuelve a estar online, para que puedas re-sincronizar con el servidor. -
  2. Necesitas conocer cuándo el usuario está offline, para así estar seguro de poner en cola las peticiones al servidor para más tarde. -
-

Es este proceso el que los eventos online/offline ayudan a trivializar. -

Tu aplicación web quizás necesite establecer que ciertos documentos se mantengan en la caché de recursos offline. Para hacerlo, incluye elementos LINK en tu sección HEAD de la siguiente manera: -

-
<link rel="offline-resource" href="mi_recurso>
-
-

Cuando Firefox 3 o superiores procesan el HTML, esto causará que el recurso referenciado se mantenga en caché para su uso offline en un recurso especial de la caché. -

-

API

- -

navigator.onLine es una propiedad que mantiene un valor true/false (true para online, false para offline). Esta propiedad se actualiza siempre que el usuario cambia hacia "Modo sin conexión" seleccionando el menú correspondiente (Archivo -> Trabajar sin conexión en Firefox). -

Además, esta propiedad se debería actualizar siempre que el navegador no sea capaz de conectarse a la red. De acuerdo con la especificación: -

-
-El atributo navigator.onLine debe devolver false si el agente de usuario no contactará con la red cuando el usuario siga los enlaces o cuando un script solicite una página remota (o sepa que intentarlo fallaría)... -
-

Firefox 2 actualiza esta propiedad cuando cambia desde/hacia el modo offline del navegador, y cuando pierde/recupera la conectividad de la red en Windows y Linux. -

Esta propiedad existía en versiones más antiguas de Firefox e Internet Explorer (la especificación surgió a partir estas implementaciones previas), así que puedes comenzar a usarla inmediatamente. La detección automática del estado de la red se implementó en Firefox 2. -

-

eventos "online" y "offline"

-

Firefox 3 introduce dos nuevos eventos: "online" y "offline". Estos dos eventos son iniciados en el <body> de cada página cuando el usuario cambia de modo online a offline. Además, los eventos emergen desde document.body a document, terminando en window. Ambos eventos son no-cancelables (no se puede evitar que el usuario pase a modo online u offline). -

Puedes registrar listeners para estos eventos de varias maneras habituales: -

- -

Ejemplo:

-

Hay una prueba sencilla que puedes ejecutar para verificar que los eventos están funcionando. -

-

-
 <!doctype html>
- <html>
- <head>
-   <script>
-     function updateOnlineStatus(msg) {
-       var status = document.getElementById("status");
-       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
-       status.setAttribute("class", condition);
-       var state = document.getElementById("state");
-       state.innerHTML = condition;
-       var log = document.getElementById("log");
-       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
-     }
-     function loaded() {
-       updateOnlineStatus("load");
-       document.body.addEventListener("offline", function () {
-         updateOnlineStatus("offline")
-       }, false);
-       document.body.addEventListener("online", function () {
-         updateOnlineStatus("online")
-       }, false);
-     }
-   </script>
-   <style>...</style>
- </head>
- <body onload="loaded()">
-   <div id="status"><p id="state"></p></div>
-   <div id="log"></div>
- </body>
- </html>
-
-

Referencias

- -


-

-
-
-{{ languages( { "en": "en/Online_and_offline_events", "fr": "fr/\u00c9v\u00e8nements_online_et_offline", "ja": "ja/Online_and_offline_events", "pl": "pl/Zdarzenia_online_i_offline", "pt": "pt/Eventos_online_e_offline" } ) }} diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index c6d2e6ed56..72e88b502e 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -1060,7 +1060,7 @@ /fr/docs/DOM/window.navigator /fr/docs/Web/API/Window/navigator /fr/docs/DOM/window.navigator.battery /fr/docs/Web/API/Navigator/battery /fr/docs/DOM/window.navigator.isLocallyAvailable /fr/docs/Web/API/Navigator/mozIsLocallyAvailable -/fr/docs/DOM/window.navigator.onLine /fr/docs/Web/API/NavigatorOnLine/onLine +/fr/docs/DOM/window.navigator.onLine /fr/docs/orphaned/Web/API/NavigatorOnLine/onLine /fr/docs/DOM/window.navigator.registerProtocolHandler /fr/docs/Web/API/Navigator/registerProtocolHandler /fr/docs/DOM/window.onbeforeunload /fr/docs/Web/API/WindowEventHandlers/onbeforeunload /fr/docs/DOM/window.onload /fr/docs/Web/API/GlobalEventHandlers/onload @@ -1209,7 +1209,7 @@ /fr/docs/DOM:window.location /fr/docs/Web/API/window/location /fr/docs/DOM:window.navigator /fr/docs/Web/API/Window/navigator /fr/docs/DOM:window.navigator.isLocallyAvailable /fr/docs/Web/API/Navigator/mozIsLocallyAvailable -/fr/docs/DOM:window.navigator.onLine /fr/docs/Web/API/NavigatorOnLine/onLine +/fr/docs/DOM:window.navigator.onLine /fr/docs/orphaned/Web/API/NavigatorOnLine/onLine /fr/docs/DOM:window.navigator.registerProtocolHandler /fr/docs/Web/API/Navigator/registerProtocolHandler /fr/docs/DOM:window.onload /fr/docs/Web/API/GlobalEventHandlers/onload /fr/docs/DOM:window.open /fr/docs/Web/API/Window/open @@ -3806,9 +3806,17 @@ /fr/docs/Web/API/MediaDevices/mediaDevices.getUserMedia /fr/docs/Web/API/MediaDevices/getUserMedia /fr/docs/Web/API/Navigator.getGamepads /fr/docs/Web/API/Navigator/getGamepads /fr/docs/Web/API/Navigator.isLocallyAvailable /fr/docs/Web/API/Navigator/mozIsLocallyAvailable -/fr/docs/Web/API/Navigator.onLine /fr/docs/Web/API/NavigatorOnLine/onLine +/fr/docs/Web/API/Navigator.onLine /fr/docs/orphaned/Web/API/NavigatorOnLine/onLine /fr/docs/Web/API/Navigator.registerProtocolHandler /fr/docs/Web/API/Navigator/registerProtocolHandler -/fr/docs/Web/API/NavigatorOnLine/Évènements_online_et_offline /fr/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/fr/docs/Web/API/NavigatorLanguage /fr/docs/orphaned/Web/API/NavigatorLanguage +/fr/docs/Web/API/NavigatorLanguage/language /fr/docs/orphaned/Web/API/NavigatorLanguage/language +/fr/docs/Web/API/NavigatorLanguage/languages /fr/docs/orphaned/Web/API/NavigatorLanguage/languages +/fr/docs/Web/API/NavigatorOnLine /fr/docs/orphaned/Web/API/NavigatorOnLine +/fr/docs/Web/API/NavigatorOnLine/Online_and_offline_events /fr/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/fr/docs/Web/API/NavigatorOnLine/onLine /fr/docs/orphaned/Web/API/NavigatorOnLine/onLine +/fr/docs/Web/API/NavigatorOnLine/Évènements_online_et_offline /fr/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/fr/docs/Web/API/NavigatorStorage /fr/docs/orphaned/Web/API/NavigatorStorage +/fr/docs/Web/API/NavigatorStorage/storage /fr/docs/orphaned/Web/API/NavigatorStorage/storage /fr/docs/Web/API/Node.contains /fr/docs/Web/API/Node/contains /fr/docs/Web/API/Node/baseURIObject /fr/docs/conflicting/Web/API/Node /fr/docs/Web/API/Node/getUserData /fr/docs/orphaned/Web/API/Node/getUserData @@ -6034,4 +6042,4 @@ /fr/docs/zineb_chengab_bonjour_bonsoir_merci /fr/docs/Web /fr/docs/À_propos_de_JavaScript /fr/docs/Web/JavaScript/About_JavaScript /fr/docs/À_propos_du_Document_Object_Model /fr/docs/conflicting/Web/API/Document_Object_Model -/fr/docs/Évènements_online_et_offline /fr/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/fr/docs/Évènements_online_et_offline /fr/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index d8cddd890e..18200fd6de 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -18546,62 +18546,6 @@ "Arzak656" ] }, - "Web/API/NavigatorLanguage": { - "modified": "2020-11-13T08:13:18.543Z", - "contributors": [ - "Arzak656" - ] - }, - "Web/API/NavigatorLanguage/language": { - "modified": "2020-11-13T09:34:12.937Z", - "contributors": [ - "Arzak656" - ] - }, - "Web/API/NavigatorLanguage/languages": { - "modified": "2020-11-13T11:23:05.443Z", - "contributors": [ - "Arzak656" - ] - }, - "Web/API/NavigatorOnLine": { - "modified": "2020-10-15T21:33:01.047Z", - "contributors": [ - "Arzak656", - "fscholz" - ] - }, - "Web/API/NavigatorOnLine/Online_and_offline_events": { - "modified": "2019-03-23T23:53:02.447Z", - "contributors": [ - "Suriteka", - "chrisdavidmills", - "BenoitL", - "Mgjbot" - ] - }, - "Web/API/NavigatorOnLine/onLine": { - "modified": "2020-10-15T21:16:47.165Z", - "contributors": [ - "tomderudder", - "thibaultboursier", - "nicodel", - "fscholz", - "teoli", - "khalid32", - "Mgjbot", - "BenoitL" - ] - }, - "Web/API/NavigatorStorage": { - "modified": "2020-10-15T22:17:55.760Z" - }, - "Web/API/NavigatorStorage/storage": { - "modified": "2020-10-15T22:17:55.620Z", - "contributors": [ - "Watilin" - ] - }, "Web/API/Network_Information_API": { "modified": "2020-10-15T21:24:14.258Z", "contributors": [ @@ -44682,6 +44626,62 @@ "julienw" ] }, + "orphaned/Web/API/NavigatorLanguage": { + "modified": "2020-11-13T08:13:18.543Z", + "contributors": [ + "Arzak656" + ] + }, + "orphaned/Web/API/NavigatorLanguage/language": { + "modified": "2020-11-13T09:34:12.937Z", + "contributors": [ + "Arzak656" + ] + }, + "orphaned/Web/API/NavigatorLanguage/languages": { + "modified": "2020-11-13T11:23:05.443Z", + "contributors": [ + "Arzak656" + ] + }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2020-10-15T21:33:01.047Z", + "contributors": [ + "Arzak656", + "fscholz" + ] + }, + "orphaned/Web/API/NavigatorOnLine/Online_and_offline_events": { + "modified": "2019-03-23T23:53:02.447Z", + "contributors": [ + "Suriteka", + "chrisdavidmills", + "BenoitL", + "Mgjbot" + ] + }, + "orphaned/Web/API/NavigatorOnLine/onLine": { + "modified": "2020-10-15T21:16:47.165Z", + "contributors": [ + "tomderudder", + "thibaultboursier", + "nicodel", + "fscholz", + "teoli", + "khalid32", + "Mgjbot", + "BenoitL" + ] + }, + "orphaned/Web/API/NavigatorStorage": { + "modified": "2020-10-15T22:17:55.760Z" + }, + "orphaned/Web/API/NavigatorStorage/storage": { + "modified": "2020-10-15T22:17:55.620Z", + "contributors": [ + "Watilin" + ] + }, "orphaned/Web/API/Node/getUserData": { "modified": "2019-03-18T21:40:10.400Z", "contributors": [ diff --git a/files/fr/orphaned/web/api/navigatorlanguage/index.html b/files/fr/orphaned/web/api/navigatorlanguage/index.html new file mode 100644 index 0000000000..9d204676d2 --- /dev/null +++ b/files/fr/orphaned/web/api/navigatorlanguage/index.html @@ -0,0 +1,62 @@ +--- +title: NavigatorLanguage +slug: orphaned/Web/API/NavigatorLanguage +translation_of: Web/API/NavigatorLanguage +original_slug: Web/API/NavigatorLanguage +--- +
{{APIRef("HTML DOM")}}
+ +

NavigatorLanguage contient les méthodes et les propriétés de la langue du navigateur.

+ +

Il n'y a pas d'objet de type NavigatorLanguage, mais d'autres interfaces comme {{domxref("Navigator")}} ou {{domxref("WorkerNavigator")}} l'implémentent.

+ +

Propriété

+ +

L'interface NavigatorLanguage n'hérite d'aucune propriété.

+ +
+
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
+
Retourne une {{domxref("DOMString")}} représentant la langue préférée de l'utilisateur, généralement la langue de l'interface utilisateur du navigateur. La valeur null est retournée quand la langue est inconnue.
+
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
+
Retourne un tableau de {{domxref("DOMString")}} représentant les langues connu de l'utilisateur par ordre de préférence.
+
+ +

Méthodes

+ +

L'interface NavigatorLanguage n'implémente et n'hérite d'aucune méthode.

+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + +
SpécificationsStatusCommentaire
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Depuis la snapshot {{SpecName('HTML5 W3C')}}, la propriété languages a été ajoutée.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Spécification initiale; snapshot de la version anticipé {{SpecName('HTML WHATWG')}}.
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.NavigatorLanguage")}}

+ +

Voir aussi

+ + diff --git a/files/fr/orphaned/web/api/navigatorlanguage/language/index.html b/files/fr/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..4f028ccaa8 --- /dev/null +++ b/files/fr/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,59 @@ +--- +title: NavigatorLanguage.language +slug: orphaned/Web/API/NavigatorLanguage/language +translation_of: Web/API/NavigatorLanguage/language +original_slug: Web/API/NavigatorLanguage/language +--- +
{{APIRef("HTML DOM")}}
+ +

La propriété en lecture seule NavigatorLanguage.language fournit une chaîne de caractère indiquant la langue préférée de l'utilisateur, généralement la langue de l'interface du navigateur.

+ +

Syntaxe

+ +
const lang = navigator.language
+
+ +

Valeur retournée

+ +

La constante lang contient une chaîne de caractère indiquant la langue défini dans BCP 47, par exemple "en", "en-US", "fr", "fr-FR", "es-ES", etc.

+ +

Notons que dans Safari sur iOS avant la version 10.2, le code du pays était en minuscule, par exemple: "en-us", "fr-fr" etc.

+ +

Exemple

+ +
if (/^en\b/.test(navigator.language)) {
+  doLangSelect(window.navigator.language);
+}
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationsStatusCommentaire
{{SpecName('HTML WHATWG', '#dom-navigator-language', 'NavigatorLanguage: language')}}{{Spec2('HTML WHATWG')}}Définition initiale
+ +

Combatibilité des navigateurs

+ + + +

{{Compat("api.NavigatorLanguage.language")}}

+ +

Voir aussi

+ + diff --git a/files/fr/orphaned/web/api/navigatorlanguage/languages/index.html b/files/fr/orphaned/web/api/navigatorlanguage/languages/index.html new file mode 100644 index 0000000000..0df287b9fc --- /dev/null +++ b/files/fr/orphaned/web/api/navigatorlanguage/languages/index.html @@ -0,0 +1,59 @@ +--- +title: NavigatorLanguage.languages +slug: orphaned/Web/API/NavigatorLanguage/languages +translation_of: Web/API/NavigatorLanguage/languages +original_slug: Web/API/NavigatorLanguage/languages +--- +

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

+ +

La propriété en lecture seule NavigatorLanguage.languages retourne un tableau de {{domxref("DOMString")}} représentant les langues préférées de l'utilisateur. Les étiquettes de langue utilisent les étiquettes de langages défini par BCP 47. Le tableau retourné est trié par ordre de préférence décroissante (la langue préférée en premier).

+ +

La valeur de {{domxref("NavigatorLanguage.language","navigator.language")}} est le premier élément du tableau retourné.

+ +

Quant la valeur change, notamment lorsque l'utilisateur modifie ses préférences de langues, un événement {{event("languagechange")}} est déclenché sur l'objet {{domxref("Window")}}.

+ +

L'entête HTTP Accept-Language présent dans chaque requête HTTP issu de la navigation de l'utilisateur contient les mêmes valeurs que navigator.languages, avec en plus un champ qvalues (valeur de qualité), par exemple: en-US;q=0.8.

+ +

Syntaxe

+ +
preferredLanguages = globalObj.navigator.languages
+
+ +

Exemples

+ +
navigator.language   //"en-US"
+navigator.languages  //["en-US", "zh-CN", "ja-JP"]
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationsStatusCommentaire
{{SpecName('HTML WHATWG', '#dom-navigator-languages', 'NavigatorLanguage: languages')}}{{Spec2('HTML WHATWG')}}Définition initiale
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.NavigatorLanguage.languages")}}

+ +

Voir aussi

+ + diff --git a/files/fr/orphaned/web/api/navigatoronline/index.html b/files/fr/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..75a26c4b92 --- /dev/null +++ b/files/fr/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,63 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +tags: + - API +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

L'interface NavigatorOnLine contient les méthodes et les propriétés concernant l'état de connexion du navigateur.

+ +

Il n'y a pas d'objet de type NavigatorOnLine, mais d'autres interfaces l'implémentent comme {{domxref("Navigator")}} ou {{domxref("WorkerNavigator")}}.

+ +

Propriétés

+ +

L'interface NavigatorOnLine n'hérite d'aucune propriété.

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
Retourne un {{domxref("Boolean")}} indicant si le navigateur est connecté.
+
+ +

Méthodes

+ +

The NavigatorOnLine interface neither implements, nor inherit any method.

+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + +
SpécificationsStatusCommentaire
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}Pas de changement depuis la dernière version, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Version apportant la définition initiale: {{SpecName('HTML WHATWG')}}
+ +

Compatibilité des naviagteurs

+ + + +

{{Compat("api.NavigatorOnLine")}}

+ +

Voir aussi

+ + diff --git a/files/fr/orphaned/web/api/navigatoronline/online/index.html b/files/fr/orphaned/web/api/navigatoronline/online/index.html new file mode 100644 index 0000000000..07dbaef7a9 --- /dev/null +++ b/files/fr/orphaned/web/api/navigatoronline/online/index.html @@ -0,0 +1,90 @@ +--- +title: window.navigator.onLine +slug: orphaned/Web/API/NavigatorOnLine/onLine +tags: + - API + - DOM Reference + - En ligne + - Navigateur En Ligne + - NavigatorOnLine + - Online + - Propriété + - Reference +translation_of: Web/API/NavigatorOnLine/onLine +original_slug: Web/API/NavigatorOnLine/onLine +--- +
{{ApiRef("HTML DOM")}}
+ +

Renvoie l'état en ligne du navigateur. La propriété renvoie une valeur {{domxref ("Boolean", "Booléenne")}}, avec true signifiant en ligne et false signifiant hors ligne. La propriété envoie des mises à jour chaque fois que la capacité du navigateur à se connecter au réseau change. La mise à jour se produit lorsque l'utilisateur suit des liens ou lorsqu'un script demande une page distante. Par exemple, la propriété doit renvoyer false lorsque les utilisateurs cliquent sur des liens peu de temps après avoir perdu la connexion Internet.

+ +

Les navigateurs implémentent cette propriété différemment.

+ +

Dans Chrome et Safari, si le navigateur ne parvient pas à se connecter à un réseau local (LAN) ou à un routeur, il est hors ligne; toutes les autres conditions renvoient true. Ainsi, bien que vous puissiez supposer que le navigateur est hors ligne lorsqu'il renvoie une valeur false, vous ne pouvez pas supposer qu'une valeur vraie signifie nécessairement que le navigateur peut accéder à Internet. Vous pourriez obtenir de faux positifs, par exemple dans les cas où l'ordinateur exécute un logiciel de virtualisation doté d'adaptateurs Ethernet virtuels toujours «connectés». Par conséquent, si vous souhaitez vraiment déterminer l'état en ligne du navigateur, vous devez développer des moyens supplémentaires de vérification. Pour en savoir plus, consultez l'article HTML5 Rocks, Working Off the Grid.

+ +

Dans Firefox et Internet Explorer, le passage du navigateur en mode hors ligne envoie la valeur false. Jusqu'à Firefox 41, toutes les autres conditions renvoient une valeur vraie; tester le comportement réel sur Nightly 68 sous Windows montre qu'il ne recherche que la connexion LAN comme Chrome et Safari donnant de faux positifs.

+ +

Vous pouvez voir les changements dans l'état du réseau en écoutant les événements sur {{domxref ("Document/ononline", "window.ononline")}} et {{domxref ("Document/onoffline", "window.onoffline")}}.

+ +

Syntaxe

+ +
window.navigator.onLine
+
+ +

Valeur

+ +

online est un {{domxref ("Boolean", "Booléen")}} true ou false.

+ +

Exemple

+ +

Voir un exemple en direct.

+ +

Pour vérifier si vous êtes en ligne, interrogez window.navigator.onLine, comme dans l'exemple suivant:

+ +
console.log(navigator.onLine ? 'online' : 'offline')
+
+ +

Si le navigateur ne prend pas en charge navigator.onLine, l'exemple ci-dessus apparaîtra toujours comme false / undefined.

+ +

Pour voir les modifications de l'état du réseau, utilisez addEventListener pour écouter les événements sur {{domxref ("Window/offline_event", "window.online")}} et {{domxref ("Window/offline_event", "window.offline")}}, comme dans l'exemple suivant:

+ +
window.addEventListener('offline', function(e) { ... })
+window.addEventListener('offline', (e) => { ... })
+
+window.addEventListener('online', function(e) { ... })
+window.addEventListener('online', (e) => { ... })
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaire
{{SpecName("HTML WHATWG", "browsers.html#dom-navigator-online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Définition initiale
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.NavigatorOnLine.onLine")}}

+ +

Notes

+ +

Voir Événements en ligne / hors ligne pour une description plus détaillée de cette propriété ainsi que des nouvelles fonctionnalités hors ligne introduites dans Firefox 3.

+ +

Voir également

+ + diff --git a/files/fr/orphaned/web/api/navigatoronline/online_and_offline_events/index.html b/files/fr/orphaned/web/api/navigatoronline/online_and_offline_events/index.html new file mode 100644 index 0000000000..9d7e92bf60 --- /dev/null +++ b/files/fr/orphaned/web/api/navigatoronline/online_and_offline_events/index.html @@ -0,0 +1,100 @@ +--- +title: Évènements online et offline +slug: orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +tags: + - AJAX + - Applications_web_hors_ligne + - DOM + - Développement_Web +translation_of: Web/API/NavigatorOnLine/Online_and_offline_events +original_slug: Web/API/NavigatorOnLine/Online_and_offline_events +--- +

Firefox 3 implémente les évènements online et offline de la spécification Web Applications 1.0 du WHATWG.

+ +

Aperçu

+ +

Afin de construire une bonne application Web capable de fonctionner hors ligne, il est nécessaire de savoir quand votre application est hors ligne. De même, vous devrez également savoir quand votre application est de nouveau en ligne. Concrètement, ce qui est nécessaire se résume à :

+ +
    +
  1. Savoir quand l'utilisateur est de nouveau en ligne, afin de se resynchroniser avec le serveur.
  2. +
  3. Savoir quand l'utilisateur est hors ligne, afin de s'assurer que les requêtes à faire vers le serveur soient bien enregistrées localement.
  4. +
+ +

C'est ce processus que les évènements online et offline rendent presque trivial.

+ +

Votre application web peut également vouloir indiquer que certains documents doivent être maintenus dans le cache des ressources hors ligne. Pour en savoir plus sur la manière de préciser cette indication, consultez l'article Ressources hors ligne dans Firefox.

+ +

API

+ + + +

navigator.onLine est une propriété qui maintient une valeur true/false (true pour online, false pour offline). Cette propriété est mise à jour chaque fois que l'utilisateur passe en mode « Hors ligne » en sélectionnant l'entrée de menu correspondante (Fichier → Travailler hors connexion dans Firefox).

+ +

De plus, cette propriété doit être mise à jour dès que le navigateur n'arrive plus à se connecter au réseau. D'après la spécification :

+ +
L'attribut navigator.onLine doit renvoyer false si l'agent utilisateur ne va pas contacter le réseau lorsque l'utilisateur suit un lien ou lorsqu'un script demande une page distante (ou sait qu'une telle tentative échouerait)…
+ +

Firefox 2 met à jour cette propriété lors du passage en mode hors connexion du navigateur, et lors de la perte ou de la récupération de la connectivité réseau sous Windows et Linux.

+ +

Cette propriété existait dans de versions plus anciennes de Firefox et Internet Explorer (la spécification se base sur ces implémentations précédentes), vous pouvez donc immédiatement commencer à l'utiliser. La détection de l'état du réseau a été ajoutée dans Firefox 2.

+ +

Les évènements « online » et « offline »

+ +

Firefox 3 introduit deux nouveaux évènements : « online » et « offline ». Ces deux évènements sont déclenchés sur l'élément <body> de chaque page lorsque le navigateur passe d'un mode à l'autre. De plus, les évènements se propagent depuis document.body, vers document, puis vers window. Aucun de ces deux évènements n'est annulable (il n'est pas possible d'empêcher l'utilisateur de passer en ligne ou hors ligne).

+ +

Vous pouvez ajouter des gestionnaires pour ces évènements selon les manières habituelles :

+ + + +

Exemple

+ +

Un cas de test simple peut être exécuté pour vérifier que les évènements fonctionnent. XXX When mochitests for this are created, point to those instead and update this example -nickolay

+ +
 <!doctype html>
+ <html>
+ <head>
+   <script>
+     function updateOnlineStatus(msg) {
+       var status = document.getElementById("status");
+       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
+       status.setAttribute("class", condition);
+       var state = document.getElementById("state");
+       state.innerHTML = condition;
+       var log = document.getElementById("log");
+       log.appendChild(document.createTextNode("Évènement : " + msg + " ; état=" + condition + "\n"));
+     }
+     function loaded() {
+       updateOnlineStatus("load");
+       document.body.addEventListener("offline", function () {
+         updateOnlineStatus("offline")
+       }, false);
+       document.body.addEventListener("online", function () {
+         updateOnlineStatus("online")
+       }, false);
+     }
+   </script>
+   <style>...</style>
+ </head>
+ <body onload="loaded()">
+   <div id="status"><p id="state"></p></div>
+   <div id="log"></div>
+ </body>
+ </html>
+
+ +

Références

+ + + +
 
+ +

{{ languages( { "en": "en/Online_and_offline_events", "es": "es/Eventos_online_y_offline", "ja": "ja/Online_and_offline_events", "pl": "pl/Zdarzenia_online_i_offline", "pt": "pt/Eventos_online_e_offline" } ) }}

diff --git a/files/fr/orphaned/web/api/navigatorstorage/index.html b/files/fr/orphaned/web/api/navigatorstorage/index.html new file mode 100644 index 0000000000..bc0ef8ba92 --- /dev/null +++ b/files/fr/orphaned/web/api/navigatorstorage/index.html @@ -0,0 +1,71 @@ +--- +title: NavigatorStorage +slug: orphaned/Web/API/NavigatorStorage +tags: + - API + - Interface + - Mixin + - Navigator + - NavigatorStorage + - NeedsTranslation + - Reference + - Secure context + - Storage + - Storage Standard + - TopicStub + - WorkerNavigator +translation_of: Web/API/NavigatorStorage +original_slug: Web/API/NavigatorStorage +--- +

{{securecontext_header}}{{APIRef("Storage")}}

+ +

The NavigatorStorage {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} and {{domxref("WorkerNavigator")}} interfaces the {{domxref("Navigator.storage")}} property, which provides access to the {{domxref("StorageManager")}} singleton used for controlling the persistence of data stores as well as obtaining information

+ +

{{AvailableInWorkers}}

+ +

There are many APIs which provide ways for Web content to store data on a user's computer, including {{Glossary("cookies")}}, the Web Storage API ({{domxref("Window.localStorage")}} and {{domxref("Window.sessionStorage")}}), and IndexedDB. The Storage Standard is designed to serve as a common basis for the implementation of all of those APIs and storage technologies, so that their constraints and configurations can be understood and controlled using a common set of methods and properties.

+ +

Properties

+ +
+
{{domxref("NavigatorStorage.storage", "storage")}} {{readonlyinline}}{{securecontext_inline}}
+
Returns the {{domxref("StorageManager")}} singleton object which is used to access the Storage Manager. Through the returned object, you can control persistence of data stores as well as get estimates of how much space is left for your site or appliation to store data.
+
+ +

Methods

+ +

The NavigatorStorage mixin has no methods.

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Storage')}}{{Spec2('Storage')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.NavigatorStorage")}}

+ +

See also

+ + diff --git a/files/fr/orphaned/web/api/navigatorstorage/storage/index.html b/files/fr/orphaned/web/api/navigatorstorage/storage/index.html new file mode 100644 index 0000000000..740cd280eb --- /dev/null +++ b/files/fr/orphaned/web/api/navigatorstorage/storage/index.html @@ -0,0 +1,48 @@ +--- +title: NavigatorStorage.storage +slug: orphaned/Web/API/NavigatorStorage/storage +translation_of: Web/API/NavigatorStorage/storage +original_slug: Web/API/NavigatorStorage/storage +--- +

{{securecontext_header}}{{APIRef("Storage")}}

+ +

La propriété en lecture seule NavigatorStorage.storage renvoie le singleton {{domxref("StorageManager")}} utilisé pour accéder aux capacités globales de stockage du navigateur pour le site actuel ou l’application actuelle. L’objet renvoyé permet d’examiner et de configurer la persistance des stockages de données, et savoir approximativement combien d’espace est encore disponible dans le navigateur pour utiliser le stockage local.

+ +

Syntaxe

+ +
var storageManager = navigator.storage;
+
+ +

Valeur

+ +

Un objet {{domxref("StorageManager")}} permettant de maintenir la persistance des données stockées, et de déterminer grossièrement combien d’espace est disponible pour stocker des données.

+ +

Spécifications

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('Storage', '#navigatorstorage', 'navigator.storage')}}{{Spec2('Storage')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.NavigatorStorage.storage")}}

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/navigatorlanguage/index.html b/files/fr/web/api/navigatorlanguage/index.html deleted file mode 100644 index 856c7dea15..0000000000 --- a/files/fr/web/api/navigatorlanguage/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: NavigatorLanguage -slug: Web/API/NavigatorLanguage -translation_of: Web/API/NavigatorLanguage ---- -
{{APIRef("HTML DOM")}}
- -

NavigatorLanguage contient les méthodes et les propriétés de la langue du navigateur.

- -

Il n'y a pas d'objet de type NavigatorLanguage, mais d'autres interfaces comme {{domxref("Navigator")}} ou {{domxref("WorkerNavigator")}} l'implémentent.

- -

Propriété

- -

L'interface NavigatorLanguage n'hérite d'aucune propriété.

- -
-
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
-
Retourne une {{domxref("DOMString")}} représentant la langue préférée de l'utilisateur, généralement la langue de l'interface utilisateur du navigateur. La valeur null est retournée quand la langue est inconnue.
-
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
-
Retourne un tableau de {{domxref("DOMString")}} représentant les langues connu de l'utilisateur par ordre de préférence.
-
- -

Méthodes

- -

L'interface NavigatorLanguage n'implémente et n'hérite d'aucune méthode.

- -

Spécifications

- - - - - - - - - - - - - - - - - - - - - -
SpécificationsStatusCommentaire
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Depuis la snapshot {{SpecName('HTML5 W3C')}}, la propriété languages a été ajoutée.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Spécification initiale; snapshot de la version anticipé {{SpecName('HTML WHATWG')}}.
- -

Compatibilité des navigateurs

- - - -

{{Compat("api.NavigatorLanguage")}}

- -

Voir aussi

- - diff --git a/files/fr/web/api/navigatorlanguage/language/index.html b/files/fr/web/api/navigatorlanguage/language/index.html deleted file mode 100644 index 0d5192e5ff..0000000000 --- a/files/fr/web/api/navigatorlanguage/language/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: NavigatorLanguage.language -slug: Web/API/NavigatorLanguage/language -translation_of: Web/API/NavigatorLanguage/language ---- -
{{APIRef("HTML DOM")}}
- -

La propriété en lecture seule NavigatorLanguage.language fournit une chaîne de caractère indiquant la langue préférée de l'utilisateur, généralement la langue de l'interface du navigateur.

- -

Syntaxe

- -
const lang = navigator.language
-
- -

Valeur retournée

- -

La constante lang contient une chaîne de caractère indiquant la langue défini dans BCP 47, par exemple "en", "en-US", "fr", "fr-FR", "es-ES", etc.

- -

Notons que dans Safari sur iOS avant la version 10.2, le code du pays était en minuscule, par exemple: "en-us", "fr-fr" etc.

- -

Exemple

- -
if (/^en\b/.test(navigator.language)) {
-  doLangSelect(window.navigator.language);
-}
-
- -

Spécifications

- - - - - - - - - - - - - - - - -
SpécificationsStatusCommentaire
{{SpecName('HTML WHATWG', '#dom-navigator-language', 'NavigatorLanguage: language')}}{{Spec2('HTML WHATWG')}}Définition initiale
- -

Combatibilité des navigateurs

- - - -

{{Compat("api.NavigatorLanguage.language")}}

- -

Voir aussi

- - diff --git a/files/fr/web/api/navigatorlanguage/languages/index.html b/files/fr/web/api/navigatorlanguage/languages/index.html deleted file mode 100644 index 416ffecbc0..0000000000 --- a/files/fr/web/api/navigatorlanguage/languages/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: NavigatorLanguage.languages -slug: Web/API/NavigatorLanguage/languages -translation_of: Web/API/NavigatorLanguage/languages ---- -

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

- -

La propriété en lecture seule NavigatorLanguage.languages retourne un tableau de {{domxref("DOMString")}} représentant les langues préférées de l'utilisateur. Les étiquettes de langue utilisent les étiquettes de langages défini par BCP 47. Le tableau retourné est trié par ordre de préférence décroissante (la langue préférée en premier).

- -

La valeur de {{domxref("NavigatorLanguage.language","navigator.language")}} est le premier élément du tableau retourné.

- -

Quant la valeur change, notamment lorsque l'utilisateur modifie ses préférences de langues, un événement {{event("languagechange")}} est déclenché sur l'objet {{domxref("Window")}}.

- -

L'entête HTTP Accept-Language présent dans chaque requête HTTP issu de la navigation de l'utilisateur contient les mêmes valeurs que navigator.languages, avec en plus un champ qvalues (valeur de qualité), par exemple: en-US;q=0.8.

- -

Syntaxe

- -
preferredLanguages = globalObj.navigator.languages
-
- -

Exemples

- -
navigator.language   //"en-US"
-navigator.languages  //["en-US", "zh-CN", "ja-JP"]
-
- -

Spécifications

- - - - - - - - - - - - - - - - -
SpécificationsStatusCommentaire
{{SpecName('HTML WHATWG', '#dom-navigator-languages', 'NavigatorLanguage: languages')}}{{Spec2('HTML WHATWG')}}Définition initiale
- -

Compatibilité des navigateurs

- - - -

{{Compat("api.NavigatorLanguage.languages")}}

- -

Voir aussi

- - diff --git a/files/fr/web/api/navigatoronline/index.html b/files/fr/web/api/navigatoronline/index.html deleted file mode 100644 index 118222cd81..0000000000 --- a/files/fr/web/api/navigatoronline/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -tags: - - API -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

L'interface NavigatorOnLine contient les méthodes et les propriétés concernant l'état de connexion du navigateur.

- -

Il n'y a pas d'objet de type NavigatorOnLine, mais d'autres interfaces l'implémentent comme {{domxref("Navigator")}} ou {{domxref("WorkerNavigator")}}.

- -

Propriétés

- -

L'interface NavigatorOnLine n'hérite d'aucune propriété.

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
Retourne un {{domxref("Boolean")}} indicant si le navigateur est connecté.
-
- -

Méthodes

- -

The NavigatorOnLine interface neither implements, nor inherit any method.

- -

Spécifications

- - - - - - - - - - - - - - - - - - - - - -
SpécificationsStatusCommentaire
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}Pas de changement depuis la dernière version, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Version apportant la définition initiale: {{SpecName('HTML WHATWG')}}
- -

Compatibilité des naviagteurs

- - - -

{{Compat("api.NavigatorOnLine")}}

- -

Voir aussi

- - diff --git a/files/fr/web/api/navigatoronline/online/index.html b/files/fr/web/api/navigatoronline/online/index.html deleted file mode 100644 index 43f2099960..0000000000 --- a/files/fr/web/api/navigatoronline/online/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: window.navigator.onLine -slug: Web/API/NavigatorOnLine/onLine -tags: - - API - - DOM Reference - - En ligne - - Navigateur En Ligne - - NavigatorOnLine - - Online - - Propriété - - Reference -translation_of: Web/API/NavigatorOnLine/onLine ---- -
{{ApiRef("HTML DOM")}}
- -

Renvoie l'état en ligne du navigateur. La propriété renvoie une valeur {{domxref ("Boolean", "Booléenne")}}, avec true signifiant en ligne et false signifiant hors ligne. La propriété envoie des mises à jour chaque fois que la capacité du navigateur à se connecter au réseau change. La mise à jour se produit lorsque l'utilisateur suit des liens ou lorsqu'un script demande une page distante. Par exemple, la propriété doit renvoyer false lorsque les utilisateurs cliquent sur des liens peu de temps après avoir perdu la connexion Internet.

- -

Les navigateurs implémentent cette propriété différemment.

- -

Dans Chrome et Safari, si le navigateur ne parvient pas à se connecter à un réseau local (LAN) ou à un routeur, il est hors ligne; toutes les autres conditions renvoient true. Ainsi, bien que vous puissiez supposer que le navigateur est hors ligne lorsqu'il renvoie une valeur false, vous ne pouvez pas supposer qu'une valeur vraie signifie nécessairement que le navigateur peut accéder à Internet. Vous pourriez obtenir de faux positifs, par exemple dans les cas où l'ordinateur exécute un logiciel de virtualisation doté d'adaptateurs Ethernet virtuels toujours «connectés». Par conséquent, si vous souhaitez vraiment déterminer l'état en ligne du navigateur, vous devez développer des moyens supplémentaires de vérification. Pour en savoir plus, consultez l'article HTML5 Rocks, Working Off the Grid.

- -

Dans Firefox et Internet Explorer, le passage du navigateur en mode hors ligne envoie la valeur false. Jusqu'à Firefox 41, toutes les autres conditions renvoient une valeur vraie; tester le comportement réel sur Nightly 68 sous Windows montre qu'il ne recherche que la connexion LAN comme Chrome et Safari donnant de faux positifs.

- -

Vous pouvez voir les changements dans l'état du réseau en écoutant les événements sur {{domxref ("Document/ononline", "window.ononline")}} et {{domxref ("Document/onoffline", "window.onoffline")}}.

- -

Syntaxe

- -
window.navigator.onLine
-
- -

Valeur

- -

online est un {{domxref ("Boolean", "Booléen")}} true ou false.

- -

Exemple

- -

Voir un exemple en direct.

- -

Pour vérifier si vous êtes en ligne, interrogez window.navigator.onLine, comme dans l'exemple suivant:

- -
console.log(navigator.onLine ? 'online' : 'offline')
-
- -

Si le navigateur ne prend pas en charge navigator.onLine, l'exemple ci-dessus apparaîtra toujours comme false / undefined.

- -

Pour voir les modifications de l'état du réseau, utilisez addEventListener pour écouter les événements sur {{domxref ("Window/offline_event", "window.online")}} et {{domxref ("Window/offline_event", "window.offline")}}, comme dans l'exemple suivant:

- -
window.addEventListener('offline', function(e) { ... })
-window.addEventListener('offline', (e) => { ... })
-
-window.addEventListener('online', function(e) { ... })
-window.addEventListener('online', (e) => { ... })
-
- -

Spécifications

- - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaire
{{SpecName("HTML WHATWG", "browsers.html#dom-navigator-online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Définition initiale
- -

Compatibilité des navigateurs

- -

{{Compat("api.NavigatorOnLine.onLine")}}

- -

Notes

- -

Voir Événements en ligne / hors ligne pour une description plus détaillée de cette propriété ainsi que des nouvelles fonctionnalités hors ligne introduites dans Firefox 3.

- -

Voir également

- - diff --git a/files/fr/web/api/navigatoronline/online_and_offline_events/index.html b/files/fr/web/api/navigatoronline/online_and_offline_events/index.html deleted file mode 100644 index 67c97d64ad..0000000000 --- a/files/fr/web/api/navigatoronline/online_and_offline_events/index.html +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Évènements online et offline -slug: Web/API/NavigatorOnLine/Online_and_offline_events -tags: - - AJAX - - Applications_web_hors_ligne - - DOM - - Développement_Web -translation_of: Web/API/NavigatorOnLine/Online_and_offline_events -original_slug: Web/API/NavigatorOnLine/Évènements_online_et_offline ---- -

Firefox 3 implémente les évènements online et offline de la spécification Web Applications 1.0 du WHATWG.

- -

Aperçu

- -

Afin de construire une bonne application Web capable de fonctionner hors ligne, il est nécessaire de savoir quand votre application est hors ligne. De même, vous devrez également savoir quand votre application est de nouveau en ligne. Concrètement, ce qui est nécessaire se résume à :

- -
    -
  1. Savoir quand l'utilisateur est de nouveau en ligne, afin de se resynchroniser avec le serveur.
  2. -
  3. Savoir quand l'utilisateur est hors ligne, afin de s'assurer que les requêtes à faire vers le serveur soient bien enregistrées localement.
  4. -
- -

C'est ce processus que les évènements online et offline rendent presque trivial.

- -

Votre application web peut également vouloir indiquer que certains documents doivent être maintenus dans le cache des ressources hors ligne. Pour en savoir plus sur la manière de préciser cette indication, consultez l'article Ressources hors ligne dans Firefox.

- -

API

- - - -

navigator.onLine est une propriété qui maintient une valeur true/false (true pour online, false pour offline). Cette propriété est mise à jour chaque fois que l'utilisateur passe en mode « Hors ligne » en sélectionnant l'entrée de menu correspondante (Fichier → Travailler hors connexion dans Firefox).

- -

De plus, cette propriété doit être mise à jour dès que le navigateur n'arrive plus à se connecter au réseau. D'après la spécification :

- -
L'attribut navigator.onLine doit renvoyer false si l'agent utilisateur ne va pas contacter le réseau lorsque l'utilisateur suit un lien ou lorsqu'un script demande une page distante (ou sait qu'une telle tentative échouerait)…
- -

Firefox 2 met à jour cette propriété lors du passage en mode hors connexion du navigateur, et lors de la perte ou de la récupération de la connectivité réseau sous Windows et Linux.

- -

Cette propriété existait dans de versions plus anciennes de Firefox et Internet Explorer (la spécification se base sur ces implémentations précédentes), vous pouvez donc immédiatement commencer à l'utiliser. La détection de l'état du réseau a été ajoutée dans Firefox 2.

- -

Les évènements « online » et « offline »

- -

Firefox 3 introduit deux nouveaux évènements : « online » et « offline ». Ces deux évènements sont déclenchés sur l'élément <body> de chaque page lorsque le navigateur passe d'un mode à l'autre. De plus, les évènements se propagent depuis document.body, vers document, puis vers window. Aucun de ces deux évènements n'est annulable (il n'est pas possible d'empêcher l'utilisateur de passer en ligne ou hors ligne).

- -

Vous pouvez ajouter des gestionnaires pour ces évènements selon les manières habituelles :

- - - -

Exemple

- -

Un cas de test simple peut être exécuté pour vérifier que les évènements fonctionnent. XXX When mochitests for this are created, point to those instead and update this example -nickolay

- -
 <!doctype html>
- <html>
- <head>
-   <script>
-     function updateOnlineStatus(msg) {
-       var status = document.getElementById("status");
-       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
-       status.setAttribute("class", condition);
-       var state = document.getElementById("state");
-       state.innerHTML = condition;
-       var log = document.getElementById("log");
-       log.appendChild(document.createTextNode("Évènement : " + msg + " ; état=" + condition + "\n"));
-     }
-     function loaded() {
-       updateOnlineStatus("load");
-       document.body.addEventListener("offline", function () {
-         updateOnlineStatus("offline")
-       }, false);
-       document.body.addEventListener("online", function () {
-         updateOnlineStatus("online")
-       }, false);
-     }
-   </script>
-   <style>...</style>
- </head>
- <body onload="loaded()">
-   <div id="status"><p id="state"></p></div>
-   <div id="log"></div>
- </body>
- </html>
-
- -

Références

- - - -
 
- -

{{ languages( { "en": "en/Online_and_offline_events", "es": "es/Eventos_online_y_offline", "ja": "ja/Online_and_offline_events", "pl": "pl/Zdarzenia_online_i_offline", "pt": "pt/Eventos_online_e_offline" } ) }}

diff --git a/files/fr/web/api/navigatorstorage/index.html b/files/fr/web/api/navigatorstorage/index.html deleted file mode 100644 index 0f1524c350..0000000000 --- a/files/fr/web/api/navigatorstorage/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: NavigatorStorage -slug: Web/API/NavigatorStorage -tags: - - API - - Interface - - Mixin - - Navigator - - NavigatorStorage - - NeedsTranslation - - Reference - - Secure context - - Storage - - Storage Standard - - TopicStub - - WorkerNavigator -translation_of: Web/API/NavigatorStorage ---- -

{{securecontext_header}}{{APIRef("Storage")}}

- -

The NavigatorStorage {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} and {{domxref("WorkerNavigator")}} interfaces the {{domxref("Navigator.storage")}} property, which provides access to the {{domxref("StorageManager")}} singleton used for controlling the persistence of data stores as well as obtaining information

- -

{{AvailableInWorkers}}

- -

There are many APIs which provide ways for Web content to store data on a user's computer, including {{Glossary("cookies")}}, the Web Storage API ({{domxref("Window.localStorage")}} and {{domxref("Window.sessionStorage")}}), and IndexedDB. The Storage Standard is designed to serve as a common basis for the implementation of all of those APIs and storage technologies, so that their constraints and configurations can be understood and controlled using a common set of methods and properties.

- -

Properties

- -
-
{{domxref("NavigatorStorage.storage", "storage")}} {{readonlyinline}}{{securecontext_inline}}
-
Returns the {{domxref("StorageManager")}} singleton object which is used to access the Storage Manager. Through the returned object, you can control persistence of data stores as well as get estimates of how much space is left for your site or appliation to store data.
-
- -

Methods

- -

The NavigatorStorage mixin has no methods.

- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Storage')}}{{Spec2('Storage')}}Initial definition.
- -

Browser compatibility

- - - -

{{Compat("api.NavigatorStorage")}}

- -

See also

- - diff --git a/files/fr/web/api/navigatorstorage/storage/index.html b/files/fr/web/api/navigatorstorage/storage/index.html deleted file mode 100644 index 89a0629637..0000000000 --- a/files/fr/web/api/navigatorstorage/storage/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: NavigatorStorage.storage -slug: Web/API/NavigatorStorage/storage -translation_of: Web/API/NavigatorStorage/storage ---- -

{{securecontext_header}}{{APIRef("Storage")}}

- -

La propriété en lecture seule NavigatorStorage.storage renvoie le singleton {{domxref("StorageManager")}} utilisé pour accéder aux capacités globales de stockage du navigateur pour le site actuel ou l’application actuelle. L’objet renvoyé permet d’examiner et de configurer la persistance des stockages de données, et savoir approximativement combien d’espace est encore disponible dans le navigateur pour utiliser le stockage local.

- -

Syntaxe

- -
var storageManager = navigator.storage;
-
- -

Valeur

- -

Un objet {{domxref("StorageManager")}} permettant de maintenir la persistance des données stockées, et de déterminer grossièrement combien d’espace est disponible pour stocker des données.

- -

Spécifications

- - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('Storage', '#navigatorstorage', 'navigator.storage')}}{{Spec2('Storage')}}Définition initiale.
- -

Compatibilité des navigateurs

- -

{{Compat("api.NavigatorStorage.storage")}}

- -

Voir aussi

- - diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 034441a7e9..cb2295bcbd 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -1667,31 +1667,31 @@ /ja/docs/DOM/window.mozInnerScreenY /ja/docs/Web/API/Window/mozInnerScreenY /ja/docs/DOM/window.name /ja/docs/Web/API/Window/name /ja/docs/DOM/window.navigator /ja/docs/Web/API/Window/navigator -/ja/docs/DOM/window.navigator.appCodeName /ja/docs/Web/API/NavigatorID/appCodeName -/ja/docs/DOM/window.navigator.appCodeName-redirect-1 /ja/docs/Web/API/NavigatorID/appCodeName -/ja/docs/DOM/window.navigator.appName /ja/docs/Web/API/NavigatorID/appName -/ja/docs/DOM/window.navigator.appVersion /ja/docs/Web/API/NavigatorID/appVersion +/ja/docs/DOM/window.navigator.appCodeName /ja/docs/orphaned/Web/API/NavigatorID/appCodeName +/ja/docs/DOM/window.navigator.appCodeName-redirect-1 /ja/docs/orphaned/Web/API/NavigatorID/appCodeName +/ja/docs/DOM/window.navigator.appName /ja/docs/orphaned/Web/API/NavigatorID/appName +/ja/docs/DOM/window.navigator.appVersion /ja/docs/orphaned/Web/API/NavigatorID/appVersion /ja/docs/DOM/window.navigator.battery /ja/docs/Web/API/Navigator/battery /ja/docs/DOM/window.navigator.buildID /ja/docs/Web/API/Navigator/buildID /ja/docs/DOM/window.navigator.cookieEnabled /ja/docs/Web/API/Navigator/cookieEnabled /ja/docs/DOM/window.navigator.isLocallyAvailable /ja/docs/Web/API/Navigator/mozIsLocallyAvailable -/ja/docs/DOM/window.navigator.javaEnabled /ja/docs/Web/API/NavigatorPlugins/javaEnabled -/ja/docs/DOM/window.navigator.language /ja/docs/Web/API/NavigatorLanguage/language -/ja/docs/DOM/window.navigator.mimeTypes /ja/docs/Web/API/NavigatorPlugins/mimeTypes +/ja/docs/DOM/window.navigator.javaEnabled /ja/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/ja/docs/DOM/window.navigator.language /ja/docs/orphaned/Web/API/NavigatorLanguage/language +/ja/docs/DOM/window.navigator.mimeTypes /ja/docs/orphaned/Web/API/NavigatorPlugins/mimeTypes /ja/docs/DOM/window.navigator.mozCameras /ja/docs/Web/API/Navigator/mozCameras /ja/docs/DOM/window.navigator.mozIsLocallyAvailable /ja/docs/Web/API/Navigator/mozIsLocallyAvailable /ja/docs/DOM/window.navigator.mozPay /ja/docs/Web/API/Navigator/mozPay /ja/docs/DOM/window.navigator.mozSettings /ja/docs/Web/API/Navigator/mozSettings /ja/docs/DOM/window.navigator.mozSms /ja/docs/Web/API/Navigator/mozSms -/ja/docs/DOM/window.navigator.onLine /ja/docs/Web/API/NavigatorOnLine/onLine +/ja/docs/DOM/window.navigator.onLine /ja/docs/orphaned/Web/API/NavigatorOnLine/onLine /ja/docs/DOM/window.navigator.oscpu /ja/docs/Web/API/Navigator/oscpu -/ja/docs/DOM/window.navigator.platform /ja/docs/Web/API/NavigatorID/platform -/ja/docs/DOM/window.navigator.plugins /ja/docs/Web/API/NavigatorPlugins/plugins -/ja/docs/DOM/window.navigator.product /ja/docs/Web/API/NavigatorID/product +/ja/docs/DOM/window.navigator.platform /ja/docs/orphaned/Web/API/NavigatorID/platform +/ja/docs/DOM/window.navigator.plugins /ja/docs/orphaned/Web/API/NavigatorPlugins/plugins +/ja/docs/DOM/window.navigator.product /ja/docs/orphaned/Web/API/NavigatorID/product /ja/docs/DOM/window.navigator.productSub /ja/docs/Web/API/Navigator/productSub /ja/docs/DOM/window.navigator.registerContentHandler /ja/docs/orphaned/Web/API/Navigator/registerContentHandler /ja/docs/DOM/window.navigator.registerProtocolHandler /ja/docs/Web/API/Navigator/registerProtocolHandler -/ja/docs/DOM/window.navigator.userAgent /ja/docs/Web/API/NavigatorID/userAgent +/ja/docs/DOM/window.navigator.userAgent /ja/docs/orphaned/Web/API/NavigatorID/userAgent /ja/docs/DOM/window.navigator.vendor /ja/docs/Web/API/Navigator/vendor /ja/docs/DOM/window.navigator.vendor-redirect-1 /ja/docs/Web/API/Navigator/vendor /ja/docs/DOM/window.navigator.vendorSub /ja/docs/Web/API/Navigator/vendorSub @@ -1899,25 +1899,25 @@ /ja/docs/DOM:window.moveTo /ja/docs/Web/API/Window/moveTo /ja/docs/DOM:window.name /ja/docs/Web/API/Window/name /ja/docs/DOM:window.navigator /ja/docs/Web/API/Window/navigator -/ja/docs/DOM:window.navigator.appCodeName /ja/docs/Web/API/NavigatorID/appCodeName -/ja/docs/DOM:window.navigator.appName /ja/docs/Web/API/NavigatorID/appName -/ja/docs/DOM:window.navigator.appVersion /ja/docs/Web/API/NavigatorID/appVersion +/ja/docs/DOM:window.navigator.appCodeName /ja/docs/orphaned/Web/API/NavigatorID/appCodeName +/ja/docs/DOM:window.navigator.appName /ja/docs/orphaned/Web/API/NavigatorID/appName +/ja/docs/DOM:window.navigator.appVersion /ja/docs/orphaned/Web/API/NavigatorID/appVersion /ja/docs/DOM:window.navigator.buildID /ja/docs/Web/API/Navigator/buildID /ja/docs/DOM:window.navigator.cookieEnabled /ja/docs/Web/API/Navigator/cookieEnabled /ja/docs/DOM:window.navigator.isLocallyAvailable /ja/docs/Web/API/Navigator/mozIsLocallyAvailable -/ja/docs/DOM:window.navigator.javaEnabled /ja/docs/Web/API/NavigatorPlugins/javaEnabled -/ja/docs/DOM:window.navigator.language /ja/docs/Web/API/NavigatorLanguage/language -/ja/docs/DOM:window.navigator.mimeTypes /ja/docs/Web/API/NavigatorPlugins/mimeTypes +/ja/docs/DOM:window.navigator.javaEnabled /ja/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/ja/docs/DOM:window.navigator.language /ja/docs/orphaned/Web/API/NavigatorLanguage/language +/ja/docs/DOM:window.navigator.mimeTypes /ja/docs/orphaned/Web/API/NavigatorPlugins/mimeTypes /ja/docs/DOM:window.navigator.mozIsLocallyAvailable /ja/docs/Web/API/Navigator/mozIsLocallyAvailable -/ja/docs/DOM:window.navigator.onLine /ja/docs/Web/API/NavigatorOnLine/onLine +/ja/docs/DOM:window.navigator.onLine /ja/docs/orphaned/Web/API/NavigatorOnLine/onLine /ja/docs/DOM:window.navigator.oscpu /ja/docs/Web/API/Navigator/oscpu -/ja/docs/DOM:window.navigator.platform /ja/docs/Web/API/NavigatorID/platform -/ja/docs/DOM:window.navigator.plugins /ja/docs/Web/API/NavigatorPlugins/plugins -/ja/docs/DOM:window.navigator.product /ja/docs/Web/API/NavigatorID/product +/ja/docs/DOM:window.navigator.platform /ja/docs/orphaned/Web/API/NavigatorID/platform +/ja/docs/DOM:window.navigator.plugins /ja/docs/orphaned/Web/API/NavigatorPlugins/plugins +/ja/docs/DOM:window.navigator.product /ja/docs/orphaned/Web/API/NavigatorID/product /ja/docs/DOM:window.navigator.productSub /ja/docs/Web/API/Navigator/productSub /ja/docs/DOM:window.navigator.registerContentHandler /ja/docs/orphaned/Web/API/Navigator/registerContentHandler /ja/docs/DOM:window.navigator.registerProtocolHandler /ja/docs/Web/API/Navigator/registerProtocolHandler -/ja/docs/DOM:window.navigator.userAgent /ja/docs/Web/API/NavigatorID/userAgent +/ja/docs/DOM:window.navigator.userAgent /ja/docs/orphaned/Web/API/NavigatorID/userAgent /ja/docs/DOM:window.navigator.vendor /ja/docs/Web/API/Navigator/vendor /ja/docs/DOM:window.navigator.vendorSub /ja/docs/Web/API/Navigator/vendorSub /ja/docs/DOM:window.onabort /ja/docs/Web/API/GlobalEventHandlers/onabort @@ -3426,7 +3426,7 @@ /ja/docs/Notification_object/title /ja/docs/Web/API/Notification/title /ja/docs/NsIDOMHTMLMediaElement /ja/docs/orphaned/NsIDOMHTMLMediaElement /ja/docs/Offline_resources_in_Firefox/Using_audio_and_video_in_Firefox /ja/docs/Learn/HTML/Multimedia_and_embedding/Video_and_audio_content -/ja/docs/Online_and_offline_events /ja/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/ja/docs/Online_and_offline_events /ja/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /ja/docs/Other_JavaScript_tools /ja/docs/Tools /ja/docs/Parsing_and_serializing_XML /ja/docs/Web/Guide/Parsing_and_serializing_XML /ja/docs/Participating_in_the_Mozilla_project /ja/docs/orphaned/Participating_in_the_Mozilla_project @@ -3899,10 +3899,31 @@ /ja/docs/Web/API/MozSocial.isVisible /ja/docs/Web/API/MozSocial/isVisible /ja/docs/Web/API/Navigator.getUserMedia /ja/docs/Web/API/Navigator/getUserMedia /ja/docs/Web/API/Navigator.mozFMRadio /ja/docs/Web/API/Navigator/mozFMRadio -/ja/docs/Web/API/Navigator/javaEnabled /ja/docs/Web/API/NavigatorPlugins/javaEnabled +/ja/docs/Web/API/Navigator/javaEnabled /ja/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled /ja/docs/Web/API/Navigator/registerContentHandler /ja/docs/orphaned/Web/API/Navigator/registerContentHandler -/ja/docs/Web/API/Navigator/userAgent /ja/docs/Web/API/NavigatorID/userAgent -/ja/docs/Web/API/NavigatorLanguage.languages /ja/docs/Web/API/NavigatorLanguage/languages +/ja/docs/Web/API/Navigator/userAgent /ja/docs/orphaned/Web/API/NavigatorID/userAgent +/ja/docs/Web/API/NavigatorConcurrentHardware /ja/docs/orphaned/Web/API/NavigatorConcurrentHardware +/ja/docs/Web/API/NavigatorConcurrentHardware/hardwareConcurrency /ja/docs/orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency +/ja/docs/Web/API/NavigatorID /ja/docs/orphaned/Web/API/NavigatorID +/ja/docs/Web/API/NavigatorID/appCodeName /ja/docs/orphaned/Web/API/NavigatorID/appCodeName +/ja/docs/Web/API/NavigatorID/appName /ja/docs/orphaned/Web/API/NavigatorID/appName +/ja/docs/Web/API/NavigatorID/appVersion /ja/docs/orphaned/Web/API/NavigatorID/appVersion +/ja/docs/Web/API/NavigatorID/platform /ja/docs/orphaned/Web/API/NavigatorID/platform +/ja/docs/Web/API/NavigatorID/product /ja/docs/orphaned/Web/API/NavigatorID/product +/ja/docs/Web/API/NavigatorID/userAgent /ja/docs/orphaned/Web/API/NavigatorID/userAgent +/ja/docs/Web/API/NavigatorLanguage /ja/docs/orphaned/Web/API/NavigatorLanguage +/ja/docs/Web/API/NavigatorLanguage.languages /ja/docs/orphaned/Web/API/NavigatorLanguage/languages +/ja/docs/Web/API/NavigatorLanguage/language /ja/docs/orphaned/Web/API/NavigatorLanguage/language +/ja/docs/Web/API/NavigatorLanguage/languages /ja/docs/orphaned/Web/API/NavigatorLanguage/languages +/ja/docs/Web/API/NavigatorOnLine /ja/docs/orphaned/Web/API/NavigatorOnLine +/ja/docs/Web/API/NavigatorOnLine/Online_and_offline_events /ja/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/ja/docs/Web/API/NavigatorOnLine/onLine /ja/docs/orphaned/Web/API/NavigatorOnLine/onLine +/ja/docs/Web/API/NavigatorPlugins /ja/docs/orphaned/Web/API/NavigatorPlugins +/ja/docs/Web/API/NavigatorPlugins/javaEnabled /ja/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/ja/docs/Web/API/NavigatorPlugins/mimeTypes /ja/docs/orphaned/Web/API/NavigatorPlugins/mimeTypes +/ja/docs/Web/API/NavigatorPlugins/plugins /ja/docs/orphaned/Web/API/NavigatorPlugins/plugins +/ja/docs/Web/API/NavigatorStorage /ja/docs/orphaned/Web/API/NavigatorStorage +/ja/docs/Web/API/NavigatorStorage/storage /ja/docs/orphaned/Web/API/NavigatorStorage/storage /ja/docs/Web/API/Node.appendChild /ja/docs/Web/API/Node/appendChild /ja/docs/Web/API/Node.attributes /ja/docs/Web/API/Element/attributes /ja/docs/Web/API/Node.baseURIObject /ja/docs/Web/API/Node @@ -4206,21 +4227,21 @@ /ja/docs/Web/API/window.mozRequestAnimationFrame /ja/docs/Web/API/Window/requestAnimationFrame /ja/docs/Web/API/window.name /ja/docs/Web/API/Window/name /ja/docs/Web/API/window.navigator /ja/docs/Web/API/Window/navigator -/ja/docs/Web/API/window.navigator.appCodeName /ja/docs/Web/API/NavigatorID/appCodeName -/ja/docs/Web/API/window.navigator.appName /ja/docs/Web/API/NavigatorID/appName +/ja/docs/Web/API/window.navigator.appCodeName /ja/docs/orphaned/Web/API/NavigatorID/appCodeName +/ja/docs/Web/API/window.navigator.appName /ja/docs/orphaned/Web/API/NavigatorID/appName /ja/docs/Web/API/window.navigator.battery /ja/docs/Web/API/Navigator/battery -/ja/docs/Web/API/window.navigator.language /ja/docs/Web/API/NavigatorLanguage/language +/ja/docs/Web/API/window.navigator.language /ja/docs/orphaned/Web/API/NavigatorLanguage/language /ja/docs/Web/API/window.navigator.mozCameras /ja/docs/Web/API/Navigator/mozCameras /ja/docs/Web/API/window.navigator.mozPay /ja/docs/Web/API/Navigator/mozPay /ja/docs/Web/API/window.navigator.mozSms /ja/docs/Web/API/Navigator/mozSms -/ja/docs/Web/API/window.navigator.onLine /ja/docs/Web/API/NavigatorOnLine/onLine +/ja/docs/Web/API/window.navigator.onLine /ja/docs/orphaned/Web/API/NavigatorOnLine/onLine /ja/docs/Web/API/window.navigator.oscpu /ja/docs/Web/API/Navigator/oscpu -/ja/docs/Web/API/window.navigator.platform /ja/docs/Web/API/NavigatorID/platform -/ja/docs/Web/API/window.navigator.plugins /ja/docs/Web/API/NavigatorPlugins/plugins -/ja/docs/Web/API/window.navigator.product /ja/docs/Web/API/NavigatorID/product +/ja/docs/Web/API/window.navigator.platform /ja/docs/orphaned/Web/API/NavigatorID/platform +/ja/docs/Web/API/window.navigator.plugins /ja/docs/orphaned/Web/API/NavigatorPlugins/plugins +/ja/docs/Web/API/window.navigator.product /ja/docs/orphaned/Web/API/NavigatorID/product /ja/docs/Web/API/window.navigator.productSub /ja/docs/Web/API/Navigator/productSub /ja/docs/Web/API/window.navigator.registerContentHandler /ja/docs/orphaned/Web/API/Navigator/registerContentHandler -/ja/docs/Web/API/window.navigator.userAgent /ja/docs/Web/API/NavigatorID/userAgent +/ja/docs/Web/API/window.navigator.userAgent /ja/docs/orphaned/Web/API/NavigatorID/userAgent /ja/docs/Web/API/window.navigator.vendor /ja/docs/Web/API/Navigator/vendor /ja/docs/Web/API/window.navigator.vendorSub /ja/docs/Web/API/Navigator/vendorSub /ja/docs/Web/API/window.onabort /ja/docs/Web/API/GlobalEventHandlers/onabort @@ -4797,6 +4818,7 @@ /ja/docs/Web/HTTP/HTTP_access_control/Errors/CORSPreflightDidNotSucceed /ja/docs/Web/HTTP/CORS/Errors/CORSPreflightDidNotSucceed /ja/docs/Web/HTTP/HTTP_access_control/Errors/CORSRequestNotHttp /ja/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp /ja/docs/Web/HTTP/HTTP_response_codes /ja/docs/Web/HTTP/Status +/ja/docs/Web/HTTP/Headers/Index /ja/docs/orphaned/Web/HTTP/Headers/Index /ja/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file /ja/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file /ja/docs/Web/HTTP/Response_codes /ja/docs/Web/HTTP/Status /ja/docs/Web/HTTP/Response_codes/204 /ja/docs/Web/HTTP/Status/204 diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index e71911f061..027d42d359 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -19001,183 +19001,6 @@ "Wind1808" ] }, - "Web/API/NavigatorConcurrentHardware": { - "modified": "2020-10-15T22:16:01.086Z", - "contributors": [ - "fscholz" - ] - }, - "Web/API/NavigatorConcurrentHardware/hardwareConcurrency": { - "modified": "2020-10-15T22:16:03.921Z", - "contributors": [ - "shisama" - ] - }, - "Web/API/NavigatorID": { - "modified": "2019-03-23T23:01:19.867Z", - "contributors": [ - "fscholz" - ] - }, - "Web/API/NavigatorID/appCodeName": { - "modified": "2019-03-23T23:49:17.312Z", - "contributors": [ - "fscholz", - "jsx", - "ethertank", - "Potappo" - ] - }, - "Web/API/NavigatorID/appName": { - "modified": "2019-03-23T23:49:11.201Z", - "contributors": [ - "fscholz", - "khalid32", - "ethertank", - "Potappo" - ] - }, - "Web/API/NavigatorID/appVersion": { - "modified": "2019-03-23T23:49:20.671Z", - "contributors": [ - "fscholz", - "khalid32", - "ethertank", - "Potappo" - ] - }, - "Web/API/NavigatorID/platform": { - "modified": "2020-10-15T21:16:44.396Z", - "contributors": [ - "yyss", - "fscholz", - "arunpandianp", - "ethertank", - "Potappo" - ] - }, - "Web/API/NavigatorID/product": { - "modified": "2019-03-23T23:49:28.986Z", - "contributors": [ - "fscholz", - "khalid32", - "ethertank", - "Potappo" - ] - }, - "Web/API/NavigatorID/userAgent": { - "modified": "2020-10-15T21:16:43.171Z", - "contributors": [ - "mfuji09", - "pcw", - "kenmori", - "fscholz", - "khalid32", - "ethertank", - "Potappo" - ] - }, - "Web/API/NavigatorLanguage": { - "modified": "2020-10-15T21:33:12.034Z", - "contributors": [ - "mfuji09", - "fscholz" - ] - }, - "Web/API/NavigatorLanguage/language": { - "modified": "2020-10-15T21:16:44.985Z", - "contributors": [ - "dskmori", - "benishouga", - "fscholz", - "khalid32", - "ethertank", - "Potappo" - ] - }, - "Web/API/NavigatorLanguage/languages": { - "modified": "2019-03-23T23:12:38.148Z", - "contributors": [ - "fscholz", - "nshimizu" - ] - }, - "Web/API/NavigatorOnLine": { - "modified": "2019-03-23T23:00:36.403Z", - "contributors": [ - "fscholz" - ] - }, - "Web/API/NavigatorOnLine/Online_and_offline_events": { - "modified": "2019-03-23T23:53:08.504Z", - "contributors": [ - "chrisdavidmills", - "ethertank", - "Marsf", - "Mgjbot", - "Koyamak" - ] - }, - "Web/API/NavigatorOnLine/onLine": { - "modified": "2020-10-15T21:16:47.171Z", - "contributors": [ - "isdh", - "ryutamaki", - "yyss", - "dextra", - "fscholz", - "khalid32", - "ethertank", - "Potappo", - "Norah", - "Mgjbot" - ] - }, - "Web/API/NavigatorPlugins": { - "modified": "2019-03-23T23:01:18.262Z", - "contributors": [ - "fscholz" - ] - }, - "Web/API/NavigatorPlugins/javaEnabled": { - "modified": "2019-03-23T23:49:36.507Z", - "contributors": [ - "fscholz", - "Hasilt", - "Potappo" - ] - }, - "Web/API/NavigatorPlugins/mimeTypes": { - "modified": "2019-03-23T23:49:36.040Z", - "contributors": [ - "fscholz", - "AshfaqHossain", - "Potappo" - ] - }, - "Web/API/NavigatorPlugins/plugins": { - "modified": "2019-03-23T23:49:27.584Z", - "contributors": [ - "wbamberg", - "yoko0827", - "fscholz", - "khalid32", - "ethertank", - "Potappo" - ] - }, - "Web/API/NavigatorStorage": { - "modified": "2020-10-15T22:20:05.734Z", - "contributors": [ - "Wind1808" - ] - }, - "Web/API/NavigatorStorage/storage": { - "modified": "2020-10-15T22:20:07.668Z", - "contributors": [ - "Wind1808" - ] - }, "Web/API/NetworkInformation": { "modified": "2019-03-23T22:28:27.967Z", "contributors": [ @@ -36453,12 +36276,6 @@ "silverskyvicto" ] }, - "Web/HTTP/Headers/Index": { - "modified": "2019-03-18T21:26:05.914Z", - "contributors": [ - "mfuji09" - ] - }, "Web/HTTP/Headers/Keep-Alive": { "modified": "2020-12-05T09:59:27.852Z", "contributors": [ @@ -51803,6 +51620,183 @@ "Potappo" ] }, + "orphaned/Web/API/NavigatorConcurrentHardware": { + "modified": "2020-10-15T22:16:01.086Z", + "contributors": [ + "fscholz" + ] + }, + "orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency": { + "modified": "2020-10-15T22:16:03.921Z", + "contributors": [ + "shisama" + ] + }, + "orphaned/Web/API/NavigatorID": { + "modified": "2019-03-23T23:01:19.867Z", + "contributors": [ + "fscholz" + ] + }, + "orphaned/Web/API/NavigatorID/appCodeName": { + "modified": "2019-03-23T23:49:17.312Z", + "contributors": [ + "fscholz", + "jsx", + "ethertank", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorID/appName": { + "modified": "2019-03-23T23:49:11.201Z", + "contributors": [ + "fscholz", + "khalid32", + "ethertank", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorID/appVersion": { + "modified": "2019-03-23T23:49:20.671Z", + "contributors": [ + "fscholz", + "khalid32", + "ethertank", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorID/platform": { + "modified": "2020-10-15T21:16:44.396Z", + "contributors": [ + "yyss", + "fscholz", + "arunpandianp", + "ethertank", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorID/product": { + "modified": "2019-03-23T23:49:28.986Z", + "contributors": [ + "fscholz", + "khalid32", + "ethertank", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorID/userAgent": { + "modified": "2020-10-15T21:16:43.171Z", + "contributors": [ + "mfuji09", + "pcw", + "kenmori", + "fscholz", + "khalid32", + "ethertank", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorLanguage": { + "modified": "2020-10-15T21:33:12.034Z", + "contributors": [ + "mfuji09", + "fscholz" + ] + }, + "orphaned/Web/API/NavigatorLanguage/language": { + "modified": "2020-10-15T21:16:44.985Z", + "contributors": [ + "dskmori", + "benishouga", + "fscholz", + "khalid32", + "ethertank", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorLanguage/languages": { + "modified": "2019-03-23T23:12:38.148Z", + "contributors": [ + "fscholz", + "nshimizu" + ] + }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2019-03-23T23:00:36.403Z", + "contributors": [ + "fscholz" + ] + }, + "orphaned/Web/API/NavigatorOnLine/Online_and_offline_events": { + "modified": "2019-03-23T23:53:08.504Z", + "contributors": [ + "chrisdavidmills", + "ethertank", + "Marsf", + "Mgjbot", + "Koyamak" + ] + }, + "orphaned/Web/API/NavigatorOnLine/onLine": { + "modified": "2020-10-15T21:16:47.171Z", + "contributors": [ + "isdh", + "ryutamaki", + "yyss", + "dextra", + "fscholz", + "khalid32", + "ethertank", + "Potappo", + "Norah", + "Mgjbot" + ] + }, + "orphaned/Web/API/NavigatorPlugins": { + "modified": "2019-03-23T23:01:18.262Z", + "contributors": [ + "fscholz" + ] + }, + "orphaned/Web/API/NavigatorPlugins/javaEnabled": { + "modified": "2019-03-23T23:49:36.507Z", + "contributors": [ + "fscholz", + "Hasilt", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorPlugins/mimeTypes": { + "modified": "2019-03-23T23:49:36.040Z", + "contributors": [ + "fscholz", + "AshfaqHossain", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorPlugins/plugins": { + "modified": "2019-03-23T23:49:27.584Z", + "contributors": [ + "wbamberg", + "yoko0827", + "fscholz", + "khalid32", + "ethertank", + "Potappo" + ] + }, + "orphaned/Web/API/NavigatorStorage": { + "modified": "2020-10-15T22:20:05.734Z", + "contributors": [ + "Wind1808" + ] + }, + "orphaned/Web/API/NavigatorStorage/storage": { + "modified": "2020-10-15T22:20:07.668Z", + "contributors": [ + "Wind1808" + ] + }, "orphaned/Web/API/Node/getUserData": { "modified": "2020-10-15T21:14:35.305Z", "contributors": [ @@ -52356,6 +52350,12 @@ "Marsf" ] }, + "orphaned/Web/HTTP/Headers/Index": { + "modified": "2019-03-18T21:26:05.914Z", + "contributors": [ + "mfuji09" + ] + }, "orphaned/Web/JavaScript/Guide/Class-Based_vs._Prototype-Based_Languages": { "modified": "2019-01-16T14:43:33.903Z", "contributors": [ diff --git a/files/ja/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html b/files/ja/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html new file mode 100644 index 0000000000..e325f3ee41 --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html @@ -0,0 +1,70 @@ +--- +title: navigator.hardwareConcurrency +slug: orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency +translation_of: Web/API/NavigatorConcurrentHardware/hardwareConcurrency +original_slug: Web/API/NavigatorConcurrentHardware/hardwareConcurrency +--- +

{{APIRef("HTML DOM")}}

+ +

{{AvailableInWorkers}}

+ +

navigator.hardwareConcurrency はユーザーのコンピューター上でスレッドを実行するために使用可能な論理プロセッサ数を返す読み取り専用のプロパティです。

+ +

構文

+ +
logicalProcessors = window.navigator.hardwareConcurrency
+
+ +

+ +

論理プロセッサのコア数を示す{{jsxref("Number")}}です。

+ +

現代のコンピューターはCPUに複数の物理プロセッサのコアを持っています(通常は2コアか4コア)。しかし、通常それぞれの物理コアは高度なスケジューリング技術を用いて一度に複数スレッドを実行することができます。 したがって、例えば4コアのCPUは8個の論理プロセッサコアを提供することができます。論理プロセッサのコア数は、コンテキストスイッチを必要とせずに一度に効果的に実行できるスレッドの数を測定するために使用できます。

+ +

しかしながら、ブラウザはより少ない論理コア数を報告することを選択することで、一度に実行できる{{domxref("Worker")}}の数をより正確に表すことがあります。したがって、この数値をユーザーのシステムのコア数の絶対的な測定値として扱わないようにしてください。

+ +

+ +

この例では、ブラウザが報告した論理プロセッサごとに{{domxref("Worker")}}が1つ作られ、新しいWorkerへの参照と、そのWorkerをまだ使用しているかどうかを示すBooleanの値を含むレコードを作っています。これらのオブジェクトは後で使用するために配列に順々に格納されています。後でリクエストを処理するために使うWorkerのプールを作っています。

+ +
let workerList = [];
+
+for (let i = 0; i < window.navigator.hardwareConcurrency; i++) {
+  let newWorker = {
+    worker: new Worker('cpuworker.js'),
+    inUse: false
+  };
+  workerList.push(newWorker);
+}
+ +

仕様

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-navigator-hardwareconcurrency', 'navigator.hardwareConcurrency')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

ブラウザでの実装状況

+ +
+ + +

{{Compat("api.NavigatorConcurrentHardware.hardwareConcurrency")}}

+
+ +

関連情報

+ + diff --git a/files/ja/orphaned/web/api/navigatorconcurrenthardware/index.html b/files/ja/orphaned/web/api/navigatorconcurrenthardware/index.html new file mode 100644 index 0000000000..43e5ae1965 --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorconcurrenthardware/index.html @@ -0,0 +1,72 @@ +--- +title: NavigatorConcurrentHardware +slug: orphaned/Web/API/NavigatorConcurrentHardware +tags: + - API + - Concurrency + - HTML DOM + - Interface + - Navigator + - NavigatorCPU + - NavigatorConcurrentHardware + - NeedsBrowserCompatibility + - NeedsTranslation + - Reference + - Threading + - Threads + - TopicStub + - WorkerNavigator + - Workers +translation_of: Web/API/NavigatorConcurrentHardware +original_slug: Web/API/NavigatorConcurrentHardware +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorConcurrentHardware {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} interface features which allow Web content to determine how many logical processors the user has available, in order to let content and Web apps optimize their operations to best take advantage of the user's CPU.

+ +

{{AvailableInWorkers}}

+ +

The number of logical processor cores is a way to measure the number of threads which can effectively be run at once without them having to share CPUs. Modern computers have multiple physical cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may return 8. The browser may, however, choose to reduce the number in order to represent more accurately the number of {{domxref("Worker")}}s that can run at once

+ +

Properties

+ +
+
{{domxref("NavigatorConcurrentHardware.hardwareConcurrency")}} {{readonlyinline}}
+
Returns the number of logical processors which may be available to the user agent. This value is always at least 1, and will be 1 if the actual number of logical processors can't be determined.
+
+ +

Methods

+ +

The NavigatorConcurrentHardware mixin has no methods.

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorconcurrenthardware', 'NavigatorConcurrentHardware')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.NavigatorConcurrentHardware")}}

+ +

See also

+ + diff --git a/files/ja/orphaned/web/api/navigatorid/appcodename/index.html b/files/ja/orphaned/web/api/navigatorid/appcodename/index.html new file mode 100644 index 0000000000..36f09b360f --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorid/appcodename/index.html @@ -0,0 +1,27 @@ +--- +title: window.navigator.appCodeName +slug: orphaned/Web/API/NavigatorID/appCodeName +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference +translation_of: Web/API/NavigatorID/appCodeName +original_slug: Web/API/NavigatorID/appCodeName +--- +
+ {{ApiRef}}
+

概要

+

現在のブラウザの内部 "コード" ネームを返します。

+

構文

+
codeName = window.navigator.appCodeName
+ +

+
console.log(window.navigator.appCodeName);
+
+

注記

+

Mozilla、Netscape 6、IE5 は全て、内部名に "Mozilla" を用いています。

+

仕様

+

{{DOM0()}}

diff --git a/files/ja/orphaned/web/api/navigatorid/appname/index.html b/files/ja/orphaned/web/api/navigatorid/appname/index.html new file mode 100644 index 0000000000..450525027b --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorid/appname/index.html @@ -0,0 +1,27 @@ +--- +title: window.navigator.appName +slug: orphaned/Web/API/NavigatorID/appName +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference + - 要更新 +translation_of: Web/API/NavigatorID/appName +original_slug: Web/API/NavigatorID/appName +--- +
+ {{ApiRef}}
+

概要

+

ブラウザの公式な名前を返します。

+

構文

+
appName = window.navigator.appName
+ +

+
dump(window.navigator.appName);
+// NS6 のコンソールに "Navigator" を出力します。
+
+

仕様

+

{{DOM0}}

diff --git a/files/ja/orphaned/web/api/navigatorid/appversion/index.html b/files/ja/orphaned/web/api/navigatorid/appversion/index.html new file mode 100644 index 0000000000..48436c71ca --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorid/appversion/index.html @@ -0,0 +1,65 @@ +--- +title: NavigatorID.appVersion +slug: orphaned/Web/API/NavigatorID/appVersion +tags: + - API + - Deprecated + - NavigatorID + - Property + - Reference + - appVersion +translation_of: Web/API/NavigatorID/appVersion +original_slug: Web/API/NavigatorID/appVersion +--- +

{{APIRef("HTML DOM")}} {{Deprecated_Header}}

+ +

"4.0" またはそのブラウザーのバージョン情報を表す文字列のどちらかを返します。

+ +
+

+

このプロパティがブラウザーの正しいバージョンを返すことを期待しないでください。

+
+ +

構文

+ +
window.navigator.appVersion
+
+ +

+ +

"4.0" またはそのブラウザーのバージョン情報を表す文字列のどちらかです。

+ +

+ +
alert("このブラウザーのバージョンは " + navigator.appVersion + " と報告されています。");
+
+ +

+ +

window.navigator.userAgent プロパティもバージョン番号を含んでいる場合がありますが ("Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1" など)、ユーザーエージェント文字列を変更したり、他のブラウザー、プラットフォーム、ユーザーエージェントに「偽装」したり、ブラウザーベンダー自身がこれらのプロパティに無頓着であったりすることを意識しておいてください。

+ +

window.navigator.appVersion, window.navigator.appName, window.navigator.userAgent の各プロパティは、「ブラウザー推定」 (browser sniffing) コード、すなわち使用しているブラウザーを検出し、それに従ってページを調整しようとするスクリプトで使われてきました。これにより、一部のウェブサイトから拒否されないようにするために、ブラウザーがこれらのプロパティで偽の情報を返さなければならないという現在の状況が発生したのです。

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-navigator-appversion', + 'NavigatorID.appVersion')}}{{Spec2('HTML WHATWG')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.NavigatorID.appVersion")}}

diff --git a/files/ja/orphaned/web/api/navigatorid/index.html b/files/ja/orphaned/web/api/navigatorid/index.html new file mode 100644 index 0000000000..bea00f1477 --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorid/index.html @@ -0,0 +1,75 @@ +--- +title: NavigatorID +slug: orphaned/Web/API/NavigatorID +tags: + - API +translation_of: Web/API/NavigatorID +original_slug: Web/API/NavigatorID +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorID interface contains methods and properties related to the identity of the browser.

+ +

There is no object of type NavigatorID, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorID interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{deprecated_inline}}
+
Always returns 'Mozilla', on any browser. This property is kept only for compatibility purpose.
+
{{domxref("NavigatorID.appName")}} {{readonlyInline}} {{deprecated_inline}}
+
Returns the official name of the browser. Do not rely on this property to return the correct value.
+
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}} {{deprecated_inline}}
+
Returns the version of the browser as a string. Do not rely on this property to return the correct value.
+
{{domxref("NavigatorID.platform")}} {{readonlyInline}} {{deprecated_inline}}
+
Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.
+
{{domxref("NavigatorID.product")}} {{readonlyInline}} {{deprecated_inline}}
+
Always returns 'Gecko', on any browser. This property is kept only for compatibility purpose.
+
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
+
Returns the user agent string for the current browser.
+
+ +

Methods

+ +

The NavigatorID interface doesn't inherit any method.

+ +
+
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}}
+
Always returns false. JavaScript taint/untaint functions were removed in JavaScript 1.2. This method is only kept for compatibility purpose
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}Added the appCodeName property and the taintEnabled() method,  for compatibility purpose.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}Initial specification.
+ +

Browser compatibility

+ +

{{Compat("api.NavigatorID")}}

+ +

See also

+ + diff --git a/files/ja/orphaned/web/api/navigatorid/platform/index.html b/files/ja/orphaned/web/api/navigatorid/platform/index.html new file mode 100644 index 0000000000..a369a1f12e --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorid/platform/index.html @@ -0,0 +1,66 @@ +--- +title: NavigatorID.platform +slug: orphaned/Web/API/NavigatorID/platform +tags: + - API + - Navigator + - NavigatorID + - Property + - Reference + - platform +translation_of: Web/API/NavigatorID/platform +original_slug: Web/API/NavigatorID/platform +--- +

{{APIRef("HTML DOM")}}

+ +

ブラウザーのプラットフォームを表す文字列を返します。仕様書ではブラウザーが常に空文字列を返すことを許可していますので、信頼できる答えを得るためにこのプロパティを頼らないようにしてください。

+ +

構文

+ +
platform = navigator.platform
+
+ + + +

+ +

ブラウザーを実行しているプラットフォームを識別する {{domxref("DOMString")}}、あるいはブラウザーがプラットフォームの識別を断る (または識別できない) 場合は空文字列になります。platform は空文字列か、ブラウザーを実行しているプラットフォームを表す文字列でなければなりません。

+ +

例: "MacIntel", "Win32", "FreeBSD i386", "WebTV OS"

+ +

+ +
console.log(navigator.platform);
+ +

注記

+ +

Chrome、Edge、Firefox 63 以降を含むほとんどのブラウザーは、64 ビット版の Windows で実行していても "Win32" を返します。Internet Explorer やバージョン 63 より前の Firefox は "Win64" を返します。

+ +

Firefox は設定項目 general.platform.override で、このプロパティが返す値を上書きできます。

+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様書策定状況コメント
{{SpecName('HTML WHATWG', '#dom-navigator-platform', 'NavigatorID.platform')}}{{Spec2('HTML WHATWG')}}初期定義
+ +

ブラウザー実装状況

+ + + +

{{Compat("api.NavigatorID.platform")}}

diff --git a/files/ja/orphaned/web/api/navigatorid/product/index.html b/files/ja/orphaned/web/api/navigatorid/product/index.html new file mode 100644 index 0000000000..7c9649cf3d --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorid/product/index.html @@ -0,0 +1,39 @@ +--- +title: window.navigator.product +slug: orphaned/Web/API/NavigatorID/product +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference +translation_of: Web/API/NavigatorID/product +original_slug: Web/API/NavigatorID/product +--- +
+ {{ApiRef}}
+

概要

+

このプロパティは、現在のブラウザの製品名を返します。

+

構文

+
productName = window.navigator.product
+
+ +

+
<script>
+function prod() {
+  dt = document.getElementById("d");
+  dt.innerHTML = window.navigator.product;
+}
+</script>
+
+<button onclick="prod();">product</button>
+<div id="d"> </div>
+
+<!-- "Gecko" などの文字列が表示される -->
+
+

注記

+

製品名は、ユーザエージェント全体の文字列の一部(プラットフォームの直後)です。例えば、Netscape 6.1 を表すユーザエージェントでは、製品名は、"Gecko" であり、ユーザエージェント文字列全体は、次の通りです。

+
Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1
+

仕様

+

{{DOM0}}

diff --git a/files/ja/orphaned/web/api/navigatorid/useragent/index.html b/files/ja/orphaned/web/api/navigatorid/useragent/index.html new file mode 100644 index 0000000000..6fe20d0c79 --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorid/useragent/index.html @@ -0,0 +1,85 @@ +--- +title: NavigatorID.userAgent +slug: orphaned/Web/API/NavigatorID/userAgent +tags: + - API + - Deprecated + - NavigatorID + - Property + - Read-only + - Reference +translation_of: Web/API/NavigatorID/userAgent +original_slug: Web/API/NavigatorID/userAgent +--- +

{{ApiRef("HTML DOM")}}

+ +

NavigatorID.userAgent は読み取り専用のプロパティで、現在のブラウザーのユーザーエージェント文字列を返します。

+ +
+

仕様書では、ブラウザーがこのフィールドを介して提供する情報をできるだけ少なくすることを求めています。このプロパティの値は、同じブラウザーの将来のバージョンでも同じままであると仮定してはいけません。まったく使用しないようにしたり、ブラウザーの現在のバージョンと過去のバージョンのためだけに使用するようにしてください。新しいブラウザーは、古いブラウザーと同じ UA、またはその一部を使い始めるかもしれません。ブラウザーエージェントが本当にこのプロパティによって広告されたものであるという保証は本当にありません。
+
+また、ブラウザのユーザーはこのフィールドの値を変更することができることを覚えておいてください (UA なりすまし)。

+
+ +

ユーザーエージェント文字列の検出に基づくブラウザーの識別は信頼性が低く、ユーザーエージェント文字列はユーザーが設定可能なので推奨されません。例えば、以下のようになります。

+ + + +

構文

+ +
var ua = navigator.userAgent;
+
+ +

+ +

{{domxref("DOMString")}} で、ブラウザーが {{Glossary("HTTP")}} ヘッダーで提供する完全なユーザーエージェント文字列と、 {{domxref("Navigator")}} オブジェクト上のメソッドやその他の関連メソッドへのレスポンスを指定します。

+ +

ユーザーエージェント文字列は形式的な構造に基づいて構築されており、いくつかの情報に分解することができます。これらの情報の各部分は、ユーザ-が設定可能な他の Navigator のプロパティから来ています。Gecko ベースのブラウザは以下の一般的な構造に準拠しています。

+ +
userAgent = appCodeName/appVersion number (Platform; Security; OS-or-CPU;
+Localization; rv: revision-version-number) product/productSub
+Application-Name Application-Name-version
+
+ +

+ +
alert(window.navigator.userAgent)
+// alerts "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"
+
+ + + +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-navigator-useragent', 'NavigatorID.userAgent')}}{{Spec2('HTML WHATWG')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.NavigatorID.userAgent")}}

+ +

関連情報

+ + diff --git a/files/ja/orphaned/web/api/navigatorlanguage/index.html b/files/ja/orphaned/web/api/navigatorlanguage/index.html new file mode 100644 index 0000000000..05a2180b9f --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorlanguage/index.html @@ -0,0 +1,64 @@ +--- +title: NavigatorLanguage +slug: orphaned/Web/API/NavigatorLanguage +tags: + - API + - HTML-DOM + - Reference +translation_of: Web/API/NavigatorLanguage +original_slug: Web/API/NavigatorLanguage +--- +
{{APIRef("HTML DOM")}}
+ +

NavigatorLanguage はナビゲーターの言語に関するメソッドやプロパティを含んでいます。

+ +

NavigatorLanguage 型のオブジェクトはありませんが、 {{domxref("Navigator")}} や {{domxref("WorkerNavigator")}} 等の他のインターフェイスが実装しています。

+ +

プロパティ

+ +

NavigatorLanguage インターフェイスが継承するプロパティはありません。

+ +
+
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
+
ユーザーの推奨言語、ふつうはブラウザーの UI の言語を表す {{domxref("DOMString")}} を返します。これが分からない場合は null 値を返します。
+
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
+
ユーザーが理解できる言語を表す {{domxref("DOMString")}} の設定順の配列を返します。
+
+ +

メソッド

+ +

NavigatorLanguage インターフェイスが実装・継承するメソッドはありません。

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}{{SpecName('HTML5 W3C')}} のスナップショット以降、 languages プロパティが追加された。
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}初回の仕様書。早期版の {{SpecName('HTML WHATWG')}} のスナップショット。
+ +

ブラウザーの対応

+ +

{{Compat("api.NavigatorLanguage")}}

+ +

関連情報

+ + diff --git a/files/ja/orphaned/web/api/navigatorlanguage/language/index.html b/files/ja/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..1fd6c7b55f --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,66 @@ +--- +title: window.navigator.language +slug: orphaned/Web/API/NavigatorLanguage/language +tags: + - API + - Language + - NavigatorLanguage + - Property + - Read-only + - Reference +translation_of: Web/API/NavigatorLanguage/language +original_slug: Web/API/NavigatorLanguage/language +--- +
{{APIRef("HTML DOM")}}
+ +

NavigatorLanguage.language は、読み取り専用プロパティで、ユーザーの言語を表す文字列を返します。普通、ブラウザー UI の言語が返されます。

+ +

構文

+ +
const lang = navigator.language
+
+ +

+ +

{{domxref("DOMString")}}。lang は、BCP 47 で定義された言語バージョンを表す文字列が格納されます。例えば、"en", "en-US", "fr", "fr-FR", "es-ES" などが含まれます。

+ +

iOS 10.2 以前の Safari では、国コードは小文字で返されます: "en-us", "fr-fr"

+ +

+ +
if (window.navigator.language.slice(0, 2) !== 'en') {
+  doLangSelect(window.navigator.language);
+}
+
+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様ステータスコメント
{{SpecName('HTML WHATWG', '#dom-navigator-language', 'NavigatorLanguage: language')}}{{Spec2('HTML WHATWG')}}初回定義
+ +

ブラウザー実装状況

+ + + +

{{Compat("api.NavigatorLanguage.language")}}

+ +

関連情報

+ + diff --git a/files/ja/orphaned/web/api/navigatorlanguage/languages/index.html b/files/ja/orphaned/web/api/navigatorlanguage/languages/index.html new file mode 100644 index 0000000000..106a5975b2 --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorlanguage/languages/index.html @@ -0,0 +1,44 @@ +--- +title: navigator.languages +slug: orphaned/Web/API/NavigatorLanguage/languages +translation_of: Web/API/NavigatorLanguage/languages +original_slug: Web/API/NavigatorLanguage/languages +--- +

{{APIRef}}

+

概要

+

navigator.languages を参照することで、ユーザの使用する言語を表すタグを取得できます。

+

構文

+
preferredLanguages = navigator.languages
+
+

説明

+

navigator.languages 属性を参照することで、ユーザが使用する言語の配列を取得できます。この配列は読み取り専用で、各要素は BCP 47 言語タグです。並び順はユーザの設定した優先度順となっています。この配列の先頭にある、もっとも優先される言語タグは  {{domxref("NavigatorLanguage.language","navigator.language")}} を参照することで取得できます。

+

Firefox の場合、navigator.languages 属性には、 intl.accept_languages の値が利用されます.

+

ユーザが言語設定を変更した場合、{{domxref("window")}} に対して languagechange イベントが発生します。

+

全ての HTTP リクエストの Accept-Language ヘッダは、qvalues (quality values) がつくことを除き、 navigator.languages と同じ値でなければなりません。 (例: en-US;q=0.8).

+

+
navigator.language   //"en-US"
+navigator.languages  //["en-US", "zh-CN", "ja-JP"]
+
+

仕様

+ + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('HTML5 Web application', '#dom-navigator-languages', 'navigator.languages') }}{{ Spec2('HTML5.1') }}Initial definition.
+

ブラウザ互換性

+

{{Compat("api.NavigatorLanguage.languages")}}

+

関連情報

+ diff --git a/files/ja/orphaned/web/api/navigatoronline/index.html b/files/ja/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..35fed754da --- /dev/null +++ b/files/ja/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,60 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +tags: + - API +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

+ +

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorOnLine interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
+
+ +

Methods

+ +

The NavigatorOnLine interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
+ +

Browser compatibility

+ +

{{Compat("api.NavigatorOnLine")}}

+ +

See also

+ + diff --git a/files/ja/orphaned/web/api/navigatoronline/online/index.html b/files/ja/orphaned/web/api/navigatoronline/online/index.html new file mode 100644 index 0000000000..162165986b --- /dev/null +++ b/files/ja/orphaned/web/api/navigatoronline/online/index.html @@ -0,0 +1,89 @@ +--- +title: window.navigator.onLine +slug: orphaned/Web/API/NavigatorOnLine/onLine +tags: + - API + - DOM Reference + - NavigatorOnLine + - Online + - Property + - Reference +translation_of: Web/API/NavigatorOnLine/onLine +original_slug: Web/API/NavigatorOnLine/onLine +--- +
{{ApiRef("HTML DOM")}}
+ +

ブラウザの接続状態を返します。このプロパティは真偽値を返して true はオンライン、false はオフラインを表します。ブラウザのネットワーク接続状態が変化するたびに、プロパティを更新します。この更新はユーザがリンクをたどる、あるいはスクリプトがリモートページを要求するときに発生します。例えばインターネットへの接続が失われた後にユーザがリンクをクリックすると、このプロパティは false を返します。

+ +

このプロパティの実装は、ブラウザにより異なります。

+ +

Chrome および Safari は、ブラウザがローカルエリアネットワーク (LAN) またはルータに接続できないときにオフライン、それ以外の状況では true を返します。従って、false 値が返る場合はブラウザがオフラインであると考えることができますが、true 値は必ずインターネットにアクセスできると考えることはできません。仮想イーサネットアダプタを持つ仮想化ソフトウェアを実行しているコンピュータでは常に "接続中" になるなど、偽陽性になる可能性があります。よって、実際のブラウザのオンライン状態を検出したい場合は、付加的なチェック方法を開発するべきでしょう。詳しくは HTML5 Rocks の記事 Working Off the Grid をご覧ください。

+ +

Firefox および Internet Explorer は、ブラウザをオフラインモードに切り替えると false 値を送信します。Firefox 41 まで、他の状態では true 値を返していました。Firefox 41 より OS X および Windows で、実際のネットワーク接続状態に従って値を返します。

+ +

window.ononline および window.onoffline イベントをリッスンすることにより、ネットワーク接続状態の変化を確認できます。

+ +

構文

+ +
online = window.navigator.onLine;
+
+ +

+ +

online には truefalse の真偽値が返されます。

+ +

+ +

live example をご覧ください。

+ +

オンラインであるかを確認するには、以下のサンプルのように window.navigator.onLine を確認します:

+ +
if (navigator.onLine) {
+  console.log('online');
+} else {
+  console.log('offline');
+}
+ +

ブラウザが navigator.onLine をサポートしない場合は、上記のサンプルでは常に false/undefined が返ります。

+ +

ネットワーク接続状態の変化を確認するには、以下のように window.online および window.offline をリッスンするため addEventListener を使用します:

+ +
window.addEventListener("offline", function(e) { console.log("offline"); });
+
+window.addEventListener("online", function(e) { console.log("online"); });
+
+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様書策定状況コメント
{{SpecName("HTML WHATWG", "browsers.html#navigator.online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}最初期の定義
+ +

ブラウザ実装状況

+ +
{{Compat("api.NavigatorOnLine.onLine")}}
+ +

注記

+ +

Firefox 3 で導入された新しいオフライン関連イベントと、このプロパティの詳しい説明は、Online/Offline Events‎ を参照してください。

+ +

関連情報

+ + diff --git a/files/ja/orphaned/web/api/navigatoronline/online_and_offline_events/index.html b/files/ja/orphaned/web/api/navigatoronline/online_and_offline_events/index.html new file mode 100644 index 0000000000..4a136cde1c --- /dev/null +++ b/files/ja/orphaned/web/api/navigatoronline/online_and_offline_events/index.html @@ -0,0 +1,74 @@ +--- +title: Online and offline events +slug: orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +translation_of: Web/API/NavigatorOnLine/Online_and_offline_events +original_slug: Web/API/NavigatorOnLine/Online_and_offline_events +--- +
{{outdated()}}
+

Firefox 3WHATWG Web Applications 1.0 仕様に従い Online/Offline イベントを実装します。

+

概観

+

オフラインに対応する良い Web アプリケーションを構築するためには、アプリケーションが実際にいつオフラインなのか知る必要があります。ついでに言えば、アプリケーションが 'オンライン' の状態に再び戻ったのがいつかを知る必要もあります。効果的に、その要件は次のように分解されます。

+
    +
  1. ユーザがいつオンラインに戻るか知らなければなりません。そうすることでサーバと再び同期を取ることができます。
  2. +
  3. ユーザがいつオフラインになるのかを知らなければなりません。そうすることでサーバへの要求を後で用いるようキューに貯めることができます。
  4. +
+

オンライン/オフラインイベントがこのプロセスを一般化することを手助けします。

+

あなたの Web アプリケーションは、オフラインリソースのキャッシュで確実に管理されるドキュメントを確立する必要があります。これを行うための方法を Firefox のオフラインリソースの記事で学んでください。

+

API

+ +

navigator.onLinetrue/false の値を保持するプロパティで、true はオンラインを、false はオフラインを意味します。このプロパティはユーザが対応するメニューアイテム (ファイル→オフライン作業) を選択することによりオフラインモードに移行する度に更新されます。

+

加えて、このプロパティはブラウザがネットワークに接続することがそれ以降不可能になった時にもその度に更新される必要があります。次の仕様に従います。

+
+ navigator.onLine 属性はユーザがリンクを押した時やスクリプトが外部のページを要求したときに、ユーザエージェントがネットワークに連絡できない場合(またはそのような試みが失敗した場合)に必ず false を返す必要があります。
+

Firefox 2 はこのプロパティをブラウザのオフラインモードが切り替わる度に更新していました。また Windows と Linux においてネットワークへの接続が失われたとき、復活したときにも更新していました。

+

このプロパティは Firefox と Internet Explorer の古いバージョンにも存在しました。(仕様はこれらの先の実装を基にしました。) 従って今すぐこのプロパティを使い始めることができます。ネットワーク状態の自動判断は Firefox 2 にて実装されました。

+

"online" および "offline" イベント

+

Firefox 3の 2 つの新しいイベントを紹介します。"online" と "offline" です。これらの 2 つのイベントは各ページの <body> にてブラウザがオンラインとオフラインのモードを切り替えるたびに発生します。加えてこのイベントは document.body から document へと浮上し、window までたどり着きます。これらのイベントはキャンセルできません (ユーザのオンラインモードやオフラインモードへの移行を防ぐことはできません)。

+

これらのイベントに対するリスナを登録することもいくつかの馴染みのある方法にて可能です。

+ +

実行例

+

簡単なテストケースを実行してこれらのイベントの動作を確認することができます。 XXX When mochitests for this are created, point to those instead and update this example -nickolay

+
 <!doctype html>
+ <html>
+ <head>
+   <script>
+     function updateOnlineStatus(msg) {
+       var status = document.getElementById("status");
+       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
+       status.setAttribute("class", condition);
+       var state = document.getElementById("state");
+       state.innerHTML = condition;
+       var log = document.getElementById("log");
+       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
+     }
+     function loaded() {
+       updateOnlineStatus("load");
+       document.body.addEventListener("offline", function () {
+         updateOnlineStatus("offline")
+       }, false);
+       document.body.addEventListener("online", function () {
+         updateOnlineStatus("online")
+       }, false);
+     }
+   </script>
+   <style>...</style>
+ </head>
+ <body onload="loaded()">
+   <div id="status"><p id="state"></p></div>
+   <div id="log"></div>
+ </body>
+ </html>
+
+

参考

+ +
+ {{HTML5ArticleTOC()}}
diff --git a/files/ja/orphaned/web/api/navigatorplugins/index.html b/files/ja/orphaned/web/api/navigatorplugins/index.html new file mode 100644 index 0000000000..ce4dfaf3fb --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorplugins/index.html @@ -0,0 +1,60 @@ +--- +title: NavigatorPlugins +slug: orphaned/Web/API/NavigatorPlugins +tags: + - API +translation_of: Web/API/NavigatorPlugins +original_slug: Web/API/NavigatorPlugins +--- +

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

+ +

The NavigatorPlugins interface contains methods and properties related to the plugins installed in the browser.

+ +

There is no object of type NavigatorPlugins, but other interfaces, like {{domxref("Navigator")}}, implement it.

+ +

Properties

+ +
+
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
+
Returns an {{domxref("MimeTypeArray")}} listing the MIME types supported by the browser.
+
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
+
Returns a {{domxref("PluginArray")}} listing the plugins installed in the browser.
+
+ +

Methods

+ +

The NavigatorPlugins interface doesn't inherit any method.

+ +
+
{{domxref("NavigatorPlugins.javaEnabled")}} {{readonlyInline}}{{experimental_inline}}
+
Returns a {{domxref("Boolean")}} flag indicating whether the host browser is Java-enabled or not.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

Browser compatibility

+ +

{{Compat("api.NavigatorPlugins")}}

+ +

See also

+ + diff --git a/files/ja/orphaned/web/api/navigatorplugins/javaenabled/index.html b/files/ja/orphaned/web/api/navigatorplugins/javaenabled/index.html new file mode 100644 index 0000000000..9b47d74b9c --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorplugins/javaenabled/index.html @@ -0,0 +1,48 @@ +--- +title: NavigatorPlugins.javaEnabled() +slug: orphaned/Web/API/NavigatorPlugins/javaEnabled +tags: + - API + - Method + - Reference +translation_of: Web/API/NavigatorPlugins/javaEnabled +original_slug: Web/API/NavigatorPlugins/javaEnabled +--- +

{{ APIRef("HTML DOM") }}

+ +

このメソッドは常に false を返します。

+ +

構文

+ +
result = window.navigator.javaEnabled()
+
+ +

+ +
if (window.navigator.javaEnabled()) {
+   // コードは実行されることはありません。条件は常に false になります。
+}
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-navigator-javaenabled', 'NavigatorPlugins.javaEnabled')}}{{Spec2('HTML WHATWG')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.NavigatorPlugins.javaEnabled")}}

diff --git a/files/ja/orphaned/web/api/navigatorplugins/mimetypes/index.html b/files/ja/orphaned/web/api/navigatorplugins/mimetypes/index.html new file mode 100644 index 0000000000..e1a350cfa0 --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorplugins/mimetypes/index.html @@ -0,0 +1,64 @@ +--- +title: mimeTypes +slug: orphaned/Web/API/NavigatorPlugins/mimeTypes +tags: + - API + - Property + - Reference +translation_of: Web/API/NavigatorPlugins/mimeTypes +original_slug: Web/API/NavigatorPlugins/mimeTypes +--- +
{{ ApiRef("HTML DOM") }}{{deprecated_header}}
+ +

{{domxref("MimeTypeArray")}} オブジェクトを返します。これにはブラウザーが解釈する MIME タイプを表す {{domxref("MimeType")}} のリストが入っています。

+ +
+

: 最新のバージョンのブラウザーでは、 {{domxref("MimeTypeArray")}} オブジェクトの名前付きプロパティは列挙可能ではなくなっています。

+
+ +

構文

+ +
var mimeTypes[] = navigator.mimeTypes;
+
+ +

mimeTypesMimeTypeArray オブジェクトであり、これは length プロパティと item(index) および namedItem(name) メソッドを持っています。

+ +

+ +
function isJavaPresent() {
+  return 'application/x-java-applet' in navigator.mimeTypes;
+}
+
+function getJavaPluginDescription() {
+  var mimetype = navigator.mimeTypes['application/x-java-applet'];
+  if (mimetype === undefined) {
+    // no Java plugin present
+    return undefined;
+  }
+  return mimetype.enabledPlugin.description;
+}
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-navigator-mimetypes', + 'NavigatorPlugins.mimeTypes')}}{{Spec2('HTML WHATWG')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.NavigatorPlugins.mimeTypes")}}

diff --git a/files/ja/orphaned/web/api/navigatorplugins/plugins/index.html b/files/ja/orphaned/web/api/navigatorplugins/plugins/index.html new file mode 100644 index 0000000000..630197a24f --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorplugins/plugins/index.html @@ -0,0 +1,60 @@ +--- +title: window.navigator.plugins +slug: orphaned/Web/API/NavigatorPlugins/plugins +tags: + - DOM + - DOM_0 + - Gecko +translation_of: Web/API/NavigatorPlugins/plugins +original_slug: Web/API/NavigatorPlugins/plugins +--- +
{{ApiRef}} {{non-standard_header}}
+ +

概要

+ +

アプリケーションにインストールされたプラグインをリスト化した、{{domxref("PluginArray")}} オブジェクトを返します。

+ +

構文

+ +
plugins = navigator.plugins;
+
+ + + +

戻り値は JavaScript の配列ではありませんが、length プロパティを持っています。また、各要素にアクセスする方法として、item(index )namedItem("name" ) メソッド経由だけでなく、plugins[2] のように、角括弧を使う方法もサポートしています。

+ +

+ +

以下の例は、高位の文書のためにインストールされたプラグインについての情報を出力します。注意:Plugin オブジェクトに用意されているプロパティは namefilenamedescription です。

+ +
{{gecko_minversion_note("1.9.2", "Gecko 1.9.2 で version プロパティが追加されました。")}}
+ +
var L = navigator.plugins.length;
+
+document.write(
+  L.toString() + " Plugin(s)<br>" +
+  "Name | Filename | description<br>"
+);
+
+for(var i = 0; i < L; i++) {
+  document.write(
+    navigator.plugins[i].name +
+    " | " +
+    navigator.plugins[i].filename +
+    " | " +
+    navigator.plugins[i].description +
+    " | " +
+    navigator.plugins[i].version +
+    "<br>"
+  );
+}
+ +

注記

+ +

{{domxref("Plugin")}} オブジェクトは、ブラウザにインストールされた様々なプラグインについての情報を取得して表示する小さなインタフェースです。 プラグインの一覧は、ブラウザのアドレスバーに about:plugins と入力することでも閲覧可能です。

+ +

仕様

+ +

{{DOM0}}

diff --git a/files/ja/orphaned/web/api/navigatorstorage/index.html b/files/ja/orphaned/web/api/navigatorstorage/index.html new file mode 100644 index 0000000000..5390a4b485 --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorstorage/index.html @@ -0,0 +1,69 @@ +--- +title: NavigatorStorage +slug: orphaned/Web/API/NavigatorStorage +tags: + - API + - Interface + - Mixin + - Navigator + - NavigatorStorage + - Reference + - Secure context + - Storage + - Storage Standard + - WorkerNavigator +translation_of: Web/API/NavigatorStorage +original_slug: Web/API/NavigatorStorage +--- +

{{securecontext_header}}{{APIRef("Storage")}}

+ +

NavigatorStorage {{Glossary("mixin","ミックスイン")}}は、{{domxref("Navigator")}} および {{domxref("WorkerNavigator")}} インターフェース に {{domxref("Navigator.storage")}} プロパティを追加します。 これにより、データストアの永続性の制御と情報の取得に使用する {{domxref("StorageManager")}} シングルトンへのアクセスが提供されます。

+ +

{{AvailableInWorkers}}

+ +

{{Glossary("Cookie","クッキー")}}、Web Storage API({{domxref("Window.localStorage")}} および {{domxref("Window.sessionStorage")}})、IndexedDB など、ウェブコンテンツがユーザーのコンピューターにデータを保存する方法を提供する API は数多くあります。 ストレージ標準は、それらすべての API とストレージテクノロジーを実装するための共通基盤として機能するように設計されているため、共通のメソッドとプロパティを使用してそれらの制約と構成を理解および制御できます。

+ +

プロパティ

+ +
+
{{domxref("NavigatorStorage.storage", "storage")}} {{readonlyinline}}{{securecontext_inline}}
+
Storage Manager へのアクセスに使用する{{domxref("StorageManager")}} シングルトンオブジェクトを返します。 返されたオブジェクトを通じて、データストアの永続性を制御したり、サイトやアプリがデータを格納するために必要なスペースの量を見積もることができます。
+
+ +

メソッド

+ +

NavigatorStorage ミックスインにはメソッドがありません。

+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Storage')}}{{Spec2('Storage')}}初期定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.NavigatorStorage")}}

+ +

関連情報

+ + diff --git a/files/ja/orphaned/web/api/navigatorstorage/storage/index.html b/files/ja/orphaned/web/api/navigatorstorage/storage/index.html new file mode 100644 index 0000000000..986086f25d --- /dev/null +++ b/files/ja/orphaned/web/api/navigatorstorage/storage/index.html @@ -0,0 +1,61 @@ +--- +title: NavigatorStorage.storage +slug: orphaned/Web/API/NavigatorStorage/storage +tags: + - API + - Navigator + - NavigatorStorage + - Property + - Reference + - Secure context + - Storage + - WorkerNavigator +translation_of: Web/API/NavigatorStorage/storage +original_slug: Web/API/NavigatorStorage/storage +--- +

{{securecontext_header}}{{APIRef("Storage")}}

+ +

NavigatorStorage.storage 読み取り専用プロパティは、現在のサイトまたはアプリのブラウザーの全体的なストレージ機能にアクセスするために使用するシングルトンの {{domxref("StorageManager")}} オブジェクトを返します。 返されたオブジェクトを使用すると、データストアの永続性を調べて設定し、ブラウザーがローカルストレージで使用するためのスペースがどれだけあるかを概算できます。

+ +

構文

+ +
var storageManager = navigator.storage;
+
+ +

+ +

格納されたデータの永続性を維持したり、データを格納するスペースの大まかな決定に使用できる {{domxref("StorageManager")}} オブジェクト。

+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Storage', '#navigatorstorage', 'navigator.storage')}}{{Spec2('Storage')}}初期定義
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("api.NavigatorStorage.storage")}}

+
+ +

関連情報

+ + diff --git a/files/ja/orphaned/web/http/headers/index/index.html b/files/ja/orphaned/web/http/headers/index/index.html new file mode 100644 index 0000000000..3018bbf0eb --- /dev/null +++ b/files/ja/orphaned/web/http/headers/index/index.html @@ -0,0 +1,14 @@ +--- +title: 索引 +slug: orphaned/Web/HTTP/Headers/Index +tags: + - HTTP + - HTTP ヘッダー + - ヘッダー + - 索引 +translation_of: Web/HTTP/Headers/Index +original_slug: Web/HTTP/Headers/Index +--- +
{{HTTPSidebar}}
+ +

{{Index("/ja/docs/Web/HTTP/Headers")}}

diff --git a/files/ja/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html b/files/ja/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html deleted file mode 100644 index 077125a53d..0000000000 --- a/files/ja/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: navigator.hardwareConcurrency -slug: Web/API/NavigatorConcurrentHardware/hardwareConcurrency -translation_of: Web/API/NavigatorConcurrentHardware/hardwareConcurrency ---- -

{{APIRef("HTML DOM")}}

- -

{{AvailableInWorkers}}

- -

navigator.hardwareConcurrency はユーザーのコンピューター上でスレッドを実行するために使用可能な論理プロセッサ数を返す読み取り専用のプロパティです。

- -

構文

- -
logicalProcessors = window.navigator.hardwareConcurrency
-
- -

- -

論理プロセッサのコア数を示す{{jsxref("Number")}}です。

- -

現代のコンピューターはCPUに複数の物理プロセッサのコアを持っています(通常は2コアか4コア)。しかし、通常それぞれの物理コアは高度なスケジューリング技術を用いて一度に複数スレッドを実行することができます。 したがって、例えば4コアのCPUは8個の論理プロセッサコアを提供することができます。論理プロセッサのコア数は、コンテキストスイッチを必要とせずに一度に効果的に実行できるスレッドの数を測定するために使用できます。

- -

しかしながら、ブラウザはより少ない論理コア数を報告することを選択することで、一度に実行できる{{domxref("Worker")}}の数をより正確に表すことがあります。したがって、この数値をユーザーのシステムのコア数の絶対的な測定値として扱わないようにしてください。

- -

- -

この例では、ブラウザが報告した論理プロセッサごとに{{domxref("Worker")}}が1つ作られ、新しいWorkerへの参照と、そのWorkerをまだ使用しているかどうかを示すBooleanの値を含むレコードを作っています。これらのオブジェクトは後で使用するために配列に順々に格納されています。後でリクエストを処理するために使うWorkerのプールを作っています。

- -
let workerList = [];
-
-for (let i = 0; i < window.navigator.hardwareConcurrency; i++) {
-  let newWorker = {
-    worker: new Worker('cpuworker.js'),
-    inUse: false
-  };
-  workerList.push(newWorker);
-}
- -

仕様

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-navigator-hardwareconcurrency', 'navigator.hardwareConcurrency')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

ブラウザでの実装状況

- -
- - -

{{Compat("api.NavigatorConcurrentHardware.hardwareConcurrency")}}

-
- -

関連情報

- - diff --git a/files/ja/web/api/navigatorconcurrenthardware/index.html b/files/ja/web/api/navigatorconcurrenthardware/index.html deleted file mode 100644 index d7cee835c0..0000000000 --- a/files/ja/web/api/navigatorconcurrenthardware/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: NavigatorConcurrentHardware -slug: Web/API/NavigatorConcurrentHardware -tags: - - API - - Concurrency - - HTML DOM - - Interface - - Navigator - - NavigatorCPU - - NavigatorConcurrentHardware - - NeedsBrowserCompatibility - - NeedsTranslation - - Reference - - Threading - - Threads - - TopicStub - - WorkerNavigator - - Workers -translation_of: Web/API/NavigatorConcurrentHardware ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorConcurrentHardware {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} interface features which allow Web content to determine how many logical processors the user has available, in order to let content and Web apps optimize their operations to best take advantage of the user's CPU.

- -

{{AvailableInWorkers}}

- -

The number of logical processor cores is a way to measure the number of threads which can effectively be run at once without them having to share CPUs. Modern computers have multiple physical cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may return 8. The browser may, however, choose to reduce the number in order to represent more accurately the number of {{domxref("Worker")}}s that can run at once

- -

Properties

- -
-
{{domxref("NavigatorConcurrentHardware.hardwareConcurrency")}} {{readonlyinline}}
-
Returns the number of logical processors which may be available to the user agent. This value is always at least 1, and will be 1 if the actual number of logical processors can't be determined.
-
- -

Methods

- -

The NavigatorConcurrentHardware mixin has no methods.

- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorconcurrenthardware', 'NavigatorConcurrentHardware')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- - - -

{{Compat("api.NavigatorConcurrentHardware")}}

- -

See also

- - diff --git a/files/ja/web/api/navigatorid/appcodename/index.html b/files/ja/web/api/navigatorid/appcodename/index.html deleted file mode 100644 index 42f0aaccbc..0000000000 --- a/files/ja/web/api/navigatorid/appcodename/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: window.navigator.appCodeName -slug: Web/API/NavigatorID/appCodeName -tags: - - DOM - - DOM_0 - - Gecko - - Gecko DOM Reference -translation_of: Web/API/NavigatorID/appCodeName ---- -
- {{ApiRef}}
-

概要

-

現在のブラウザの内部 "コード" ネームを返します。

-

構文

-
codeName = window.navigator.appCodeName
- -

-
console.log(window.navigator.appCodeName);
-
-

注記

-

Mozilla、Netscape 6、IE5 は全て、内部名に "Mozilla" を用いています。

-

仕様

-

{{DOM0()}}

diff --git a/files/ja/web/api/navigatorid/appname/index.html b/files/ja/web/api/navigatorid/appname/index.html deleted file mode 100644 index eef3b58fe9..0000000000 --- a/files/ja/web/api/navigatorid/appname/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: window.navigator.appName -slug: Web/API/NavigatorID/appName -tags: - - DOM - - DOM_0 - - Gecko - - Gecko DOM Reference - - 要更新 -translation_of: Web/API/NavigatorID/appName ---- -
- {{ApiRef}}
-

概要

-

ブラウザの公式な名前を返します。

-

構文

-
appName = window.navigator.appName
- -

-
dump(window.navigator.appName);
-// NS6 のコンソールに "Navigator" を出力します。
-
-

仕様

-

{{DOM0}}

diff --git a/files/ja/web/api/navigatorid/appversion/index.html b/files/ja/web/api/navigatorid/appversion/index.html deleted file mode 100644 index 191bd8dbdc..0000000000 --- a/files/ja/web/api/navigatorid/appversion/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: NavigatorID.appVersion -slug: Web/API/NavigatorID/appVersion -tags: -- API -- Deprecated -- NavigatorID -- Property -- Reference -- appVersion -translation_of: Web/API/NavigatorID/appVersion ---- -

{{APIRef("HTML DOM")}} {{Deprecated_Header}}

- -

"4.0" またはそのブラウザーのバージョン情報を表す文字列のどちらかを返します。

- -
-

-

このプロパティがブラウザーの正しいバージョンを返すことを期待しないでください。

-
- -

構文

- -
window.navigator.appVersion
-
- -

- -

"4.0" またはそのブラウザーのバージョン情報を表す文字列のどちらかです。

- -

- -
alert("このブラウザーのバージョンは " + navigator.appVersion + " と報告されています。");
-
- -

- -

window.navigator.userAgent プロパティもバージョン番号を含んでいる場合がありますが ("Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1" など)、ユーザーエージェント文字列を変更したり、他のブラウザー、プラットフォーム、ユーザーエージェントに「偽装」したり、ブラウザーベンダー自身がこれらのプロパティに無頓着であったりすることを意識しておいてください。

- -

window.navigator.appVersion, window.navigator.appName, window.navigator.userAgent の各プロパティは、「ブラウザー推定」 (browser sniffing) コード、すなわち使用しているブラウザーを検出し、それに従ってページを調整しようとするスクリプトで使われてきました。これにより、一部のウェブサイトから拒否されないようにするために、ブラウザーがこれらのプロパティで偽の情報を返さなければならないという現在の状況が発生したのです。

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-navigator-appversion', - 'NavigatorID.appVersion')}}{{Spec2('HTML WHATWG')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.NavigatorID.appVersion")}}

diff --git a/files/ja/web/api/navigatorid/index.html b/files/ja/web/api/navigatorid/index.html deleted file mode 100644 index e0aee86017..0000000000 --- a/files/ja/web/api/navigatorid/index.html +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: NavigatorID -slug: Web/API/NavigatorID -tags: - - API -translation_of: Web/API/NavigatorID ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorID interface contains methods and properties related to the identity of the browser.

- -

There is no object of type NavigatorID, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorID interface doesn't inherit any property.

- -
-
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{deprecated_inline}}
-
Always returns 'Mozilla', on any browser. This property is kept only for compatibility purpose.
-
{{domxref("NavigatorID.appName")}} {{readonlyInline}} {{deprecated_inline}}
-
Returns the official name of the browser. Do not rely on this property to return the correct value.
-
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}} {{deprecated_inline}}
-
Returns the version of the browser as a string. Do not rely on this property to return the correct value.
-
{{domxref("NavigatorID.platform")}} {{readonlyInline}} {{deprecated_inline}}
-
Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.
-
{{domxref("NavigatorID.product")}} {{readonlyInline}} {{deprecated_inline}}
-
Always returns 'Gecko', on any browser. This property is kept only for compatibility purpose.
-
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
-
Returns the user agent string for the current browser.
-
- -

Methods

- -

The NavigatorID interface doesn't inherit any method.

- -
-
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}}
-
Always returns false. JavaScript taint/untaint functions were removed in JavaScript 1.2. This method is only kept for compatibility purpose
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}Added the appCodeName property and the taintEnabled() method,  for compatibility purpose.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}Initial specification.
- -

Browser compatibility

- -

{{Compat("api.NavigatorID")}}

- -

See also

- - diff --git a/files/ja/web/api/navigatorid/platform/index.html b/files/ja/web/api/navigatorid/platform/index.html deleted file mode 100644 index 508dec6cfc..0000000000 --- a/files/ja/web/api/navigatorid/platform/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: NavigatorID.platform -slug: Web/API/NavigatorID/platform -tags: - - API - - Navigator - - NavigatorID - - Property - - Reference - - platform -translation_of: Web/API/NavigatorID/platform ---- -

{{APIRef("HTML DOM")}}

- -

ブラウザーのプラットフォームを表す文字列を返します。仕様書ではブラウザーが常に空文字列を返すことを許可していますので、信頼できる答えを得るためにこのプロパティを頼らないようにしてください。

- -

構文

- -
platform = navigator.platform
-
- - - -

- -

ブラウザーを実行しているプラットフォームを識別する {{domxref("DOMString")}}、あるいはブラウザーがプラットフォームの識別を断る (または識別できない) 場合は空文字列になります。platform は空文字列か、ブラウザーを実行しているプラットフォームを表す文字列でなければなりません。

- -

例: "MacIntel", "Win32", "FreeBSD i386", "WebTV OS"

- -

- -
console.log(navigator.platform);
- -

注記

- -

Chrome、Edge、Firefox 63 以降を含むほとんどのブラウザーは、64 ビット版の Windows で実行していても "Win32" を返します。Internet Explorer やバージョン 63 より前の Firefox は "Win64" を返します。

- -

Firefox は設定項目 general.platform.override で、このプロパティが返す値を上書きできます。

- -

仕様

- - - - - - - - - - - - - - - - -
仕様書策定状況コメント
{{SpecName('HTML WHATWG', '#dom-navigator-platform', 'NavigatorID.platform')}}{{Spec2('HTML WHATWG')}}初期定義
- -

ブラウザー実装状況

- - - -

{{Compat("api.NavigatorID.platform")}}

diff --git a/files/ja/web/api/navigatorid/product/index.html b/files/ja/web/api/navigatorid/product/index.html deleted file mode 100644 index 33d2f462c1..0000000000 --- a/files/ja/web/api/navigatorid/product/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: window.navigator.product -slug: Web/API/NavigatorID/product -tags: - - DOM - - DOM_0 - - Gecko - - Gecko DOM Reference -translation_of: Web/API/NavigatorID/product ---- -
- {{ApiRef}}
-

概要

-

このプロパティは、現在のブラウザの製品名を返します。

-

構文

-
productName = window.navigator.product
-
- -

-
<script>
-function prod() {
-  dt = document.getElementById("d");
-  dt.innerHTML = window.navigator.product;
-}
-</script>
-
-<button onclick="prod();">product</button>
-<div id="d"> </div>
-
-<!-- "Gecko" などの文字列が表示される -->
-
-

注記

-

製品名は、ユーザエージェント全体の文字列の一部(プラットフォームの直後)です。例えば、Netscape 6.1 を表すユーザエージェントでは、製品名は、"Gecko" であり、ユーザエージェント文字列全体は、次の通りです。

-
Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1
-

仕様

-

{{DOM0}}

diff --git a/files/ja/web/api/navigatorid/useragent/index.html b/files/ja/web/api/navigatorid/useragent/index.html deleted file mode 100644 index cbc921869b..0000000000 --- a/files/ja/web/api/navigatorid/useragent/index.html +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: NavigatorID.userAgent -slug: Web/API/NavigatorID/userAgent -tags: - - API - - Deprecated - - NavigatorID - - Property - - Read-only - - Reference -translation_of: Web/API/NavigatorID/userAgent ---- -

{{ApiRef("HTML DOM")}}

- -

NavigatorID.userAgent は読み取り専用のプロパティで、現在のブラウザーのユーザーエージェント文字列を返します。

- -
-

仕様書では、ブラウザーがこのフィールドを介して提供する情報をできるだけ少なくすることを求めています。このプロパティの値は、同じブラウザーの将来のバージョンでも同じままであると仮定してはいけません。まったく使用しないようにしたり、ブラウザーの現在のバージョンと過去のバージョンのためだけに使用するようにしてください。新しいブラウザーは、古いブラウザーと同じ UA、またはその一部を使い始めるかもしれません。ブラウザーエージェントが本当にこのプロパティによって広告されたものであるという保証は本当にありません。
-
-また、ブラウザのユーザーはこのフィールドの値を変更することができることを覚えておいてください (UA なりすまし)。

-
- -

ユーザーエージェント文字列の検出に基づくブラウザーの識別は信頼性が低く、ユーザーエージェント文字列はユーザーが設定可能なので推奨されません。例えば、以下のようになります。

- - - -

構文

- -
var ua = navigator.userAgent;
-
- -

- -

{{domxref("DOMString")}} で、ブラウザーが {{Glossary("HTTP")}} ヘッダーで提供する完全なユーザーエージェント文字列と、 {{domxref("Navigator")}} オブジェクト上のメソッドやその他の関連メソッドへのレスポンスを指定します。

- -

ユーザーエージェント文字列は形式的な構造に基づいて構築されており、いくつかの情報に分解することができます。これらの情報の各部分は、ユーザ-が設定可能な他の Navigator のプロパティから来ています。Gecko ベースのブラウザは以下の一般的な構造に準拠しています。

- -
userAgent = appCodeName/appVersion number (Platform; Security; OS-or-CPU;
-Localization; rv: revision-version-number) product/productSub
-Application-Name Application-Name-version
-
- -

- -
alert(window.navigator.userAgent)
-// alerts "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"
-
- - - -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-navigator-useragent', 'NavigatorID.userAgent')}}{{Spec2('HTML WHATWG')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.NavigatorID.userAgent")}}

- -

関連情報

- - diff --git a/files/ja/web/api/navigatorlanguage/index.html b/files/ja/web/api/navigatorlanguage/index.html deleted file mode 100644 index f05cf147ed..0000000000 --- a/files/ja/web/api/navigatorlanguage/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: NavigatorLanguage -slug: Web/API/NavigatorLanguage -tags: - - API - - HTML-DOM - - Reference -translation_of: Web/API/NavigatorLanguage ---- -
{{APIRef("HTML DOM")}}
- -

NavigatorLanguage はナビゲーターの言語に関するメソッドやプロパティを含んでいます。

- -

NavigatorLanguage 型のオブジェクトはありませんが、 {{domxref("Navigator")}} や {{domxref("WorkerNavigator")}} 等の他のインターフェイスが実装しています。

- -

プロパティ

- -

NavigatorLanguage インターフェイスが継承するプロパティはありません。

- -
-
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
-
ユーザーの推奨言語、ふつうはブラウザーの UI の言語を表す {{domxref("DOMString")}} を返します。これが分からない場合は null 値を返します。
-
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
-
ユーザーが理解できる言語を表す {{domxref("DOMString")}} の設定順の配列を返します。
-
- -

メソッド

- -

NavigatorLanguage インターフェイスが実装・継承するメソッドはありません。

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}{{SpecName('HTML5 W3C')}} のスナップショット以降、 languages プロパティが追加された。
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}初回の仕様書。早期版の {{SpecName('HTML WHATWG')}} のスナップショット。
- -

ブラウザーの対応

- -

{{Compat("api.NavigatorLanguage")}}

- -

関連情報

- - diff --git a/files/ja/web/api/navigatorlanguage/language/index.html b/files/ja/web/api/navigatorlanguage/language/index.html deleted file mode 100644 index 1a8a9d6379..0000000000 --- a/files/ja/web/api/navigatorlanguage/language/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: window.navigator.language -slug: Web/API/NavigatorLanguage/language -tags: - - API - - Language - - NavigatorLanguage - - Property - - Read-only - - Reference -translation_of: Web/API/NavigatorLanguage/language ---- -
{{APIRef("HTML DOM")}}
- -

NavigatorLanguage.language は、読み取り専用プロパティで、ユーザーの言語を表す文字列を返します。普通、ブラウザー UI の言語が返されます。

- -

構文

- -
const lang = navigator.language
-
- -

- -

{{domxref("DOMString")}}。lang は、BCP 47 で定義された言語バージョンを表す文字列が格納されます。例えば、"en", "en-US", "fr", "fr-FR", "es-ES" などが含まれます。

- -

iOS 10.2 以前の Safari では、国コードは小文字で返されます: "en-us", "fr-fr"

- -

- -
if (window.navigator.language.slice(0, 2) !== 'en') {
-  doLangSelect(window.navigator.language);
-}
-
- -

仕様

- - - - - - - - - - - - - - - - -
仕様ステータスコメント
{{SpecName('HTML WHATWG', '#dom-navigator-language', 'NavigatorLanguage: language')}}{{Spec2('HTML WHATWG')}}初回定義
- -

ブラウザー実装状況

- - - -

{{Compat("api.NavigatorLanguage.language")}}

- -

関連情報

- - diff --git a/files/ja/web/api/navigatorlanguage/languages/index.html b/files/ja/web/api/navigatorlanguage/languages/index.html deleted file mode 100644 index d647bc00af..0000000000 --- a/files/ja/web/api/navigatorlanguage/languages/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: navigator.languages -slug: Web/API/NavigatorLanguage/languages -translation_of: Web/API/NavigatorLanguage/languages ---- -

{{APIRef}}

-

概要

-

navigator.languages を参照することで、ユーザの使用する言語を表すタグを取得できます。

-

構文

-
preferredLanguages = navigator.languages
-
-

説明

-

navigator.languages 属性を参照することで、ユーザが使用する言語の配列を取得できます。この配列は読み取り専用で、各要素は BCP 47 言語タグです。並び順はユーザの設定した優先度順となっています。この配列の先頭にある、もっとも優先される言語タグは  {{domxref("NavigatorLanguage.language","navigator.language")}} を参照することで取得できます。

-

Firefox の場合、navigator.languages 属性には、 intl.accept_languages の値が利用されます.

-

ユーザが言語設定を変更した場合、{{domxref("window")}} に対して languagechange イベントが発生します。

-

全ての HTTP リクエストの Accept-Language ヘッダは、qvalues (quality values) がつくことを除き、 navigator.languages と同じ値でなければなりません。 (例: en-US;q=0.8).

-

-
navigator.language   //"en-US"
-navigator.languages  //["en-US", "zh-CN", "ja-JP"]
-
-

仕様

- - - - - - - - - - - - - -
SpecificationStatusComment
{{ SpecName('HTML5 Web application', '#dom-navigator-languages', 'navigator.languages') }}{{ Spec2('HTML5.1') }}Initial definition.
-

ブラウザ互換性

-

{{Compat("api.NavigatorLanguage.languages")}}

-

関連情報

- diff --git a/files/ja/web/api/navigatoronline/index.html b/files/ja/web/api/navigatoronline/index.html deleted file mode 100644 index 5e9b5f92f7..0000000000 --- a/files/ja/web/api/navigatoronline/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -tags: - - API -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

- -

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorOnLine interface doesn't inherit any property.

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
-
- -

Methods

- -

The NavigatorOnLine interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
- -

Browser compatibility

- -

{{Compat("api.NavigatorOnLine")}}

- -

See also

- - diff --git a/files/ja/web/api/navigatoronline/online/index.html b/files/ja/web/api/navigatoronline/online/index.html deleted file mode 100644 index 5382a1b272..0000000000 --- a/files/ja/web/api/navigatoronline/online/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: window.navigator.onLine -slug: Web/API/NavigatorOnLine/onLine -tags: - - API - - DOM Reference - - NavigatorOnLine - - Online - - Property - - Reference -translation_of: Web/API/NavigatorOnLine/onLine ---- -
{{ApiRef("HTML DOM")}}
- -

ブラウザの接続状態を返します。このプロパティは真偽値を返して true はオンライン、false はオフラインを表します。ブラウザのネットワーク接続状態が変化するたびに、プロパティを更新します。この更新はユーザがリンクをたどる、あるいはスクリプトがリモートページを要求するときに発生します。例えばインターネットへの接続が失われた後にユーザがリンクをクリックすると、このプロパティは false を返します。

- -

このプロパティの実装は、ブラウザにより異なります。

- -

Chrome および Safari は、ブラウザがローカルエリアネットワーク (LAN) またはルータに接続できないときにオフライン、それ以外の状況では true を返します。従って、false 値が返る場合はブラウザがオフラインであると考えることができますが、true 値は必ずインターネットにアクセスできると考えることはできません。仮想イーサネットアダプタを持つ仮想化ソフトウェアを実行しているコンピュータでは常に "接続中" になるなど、偽陽性になる可能性があります。よって、実際のブラウザのオンライン状態を検出したい場合は、付加的なチェック方法を開発するべきでしょう。詳しくは HTML5 Rocks の記事 Working Off the Grid をご覧ください。

- -

Firefox および Internet Explorer は、ブラウザをオフラインモードに切り替えると false 値を送信します。Firefox 41 まで、他の状態では true 値を返していました。Firefox 41 より OS X および Windows で、実際のネットワーク接続状態に従って値を返します。

- -

window.ononline および window.onoffline イベントをリッスンすることにより、ネットワーク接続状態の変化を確認できます。

- -

構文

- -
online = window.navigator.onLine;
-
- -

- -

online には truefalse の真偽値が返されます。

- -

- -

live example をご覧ください。

- -

オンラインであるかを確認するには、以下のサンプルのように window.navigator.onLine を確認します:

- -
if (navigator.onLine) {
-  console.log('online');
-} else {
-  console.log('offline');
-}
- -

ブラウザが navigator.onLine をサポートしない場合は、上記のサンプルでは常に false/undefined が返ります。

- -

ネットワーク接続状態の変化を確認するには、以下のように window.online および window.offline をリッスンするため addEventListener を使用します:

- -
window.addEventListener("offline", function(e) { console.log("offline"); });
-
-window.addEventListener("online", function(e) { console.log("online"); });
-
- -

仕様

- - - - - - - - - - - - - - - - -
仕様書策定状況コメント
{{SpecName("HTML WHATWG", "browsers.html#navigator.online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}最初期の定義
- -

ブラウザ実装状況

- -
{{Compat("api.NavigatorOnLine.onLine")}}
- -

注記

- -

Firefox 3 で導入された新しいオフライン関連イベントと、このプロパティの詳しい説明は、Online/Offline Events‎ を参照してください。

- -

関連情報

- - diff --git a/files/ja/web/api/navigatoronline/online_and_offline_events/index.html b/files/ja/web/api/navigatoronline/online_and_offline_events/index.html deleted file mode 100644 index 55b21eaa18..0000000000 --- a/files/ja/web/api/navigatoronline/online_and_offline_events/index.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Online and offline events -slug: Web/API/NavigatorOnLine/Online_and_offline_events -translation_of: Web/API/NavigatorOnLine/Online_and_offline_events ---- -
{{outdated()}}
-

Firefox 3WHATWG Web Applications 1.0 仕様に従い Online/Offline イベントを実装します。

-

概観

-

オフラインに対応する良い Web アプリケーションを構築するためには、アプリケーションが実際にいつオフラインなのか知る必要があります。ついでに言えば、アプリケーションが 'オンライン' の状態に再び戻ったのがいつかを知る必要もあります。効果的に、その要件は次のように分解されます。

-
    -
  1. ユーザがいつオンラインに戻るか知らなければなりません。そうすることでサーバと再び同期を取ることができます。
  2. -
  3. ユーザがいつオフラインになるのかを知らなければなりません。そうすることでサーバへの要求を後で用いるようキューに貯めることができます。
  4. -
-

オンライン/オフラインイベントがこのプロセスを一般化することを手助けします。

-

あなたの Web アプリケーションは、オフラインリソースのキャッシュで確実に管理されるドキュメントを確立する必要があります。これを行うための方法を Firefox のオフラインリソースの記事で学んでください。

-

API

- -

navigator.onLinetrue/false の値を保持するプロパティで、true はオンラインを、false はオフラインを意味します。このプロパティはユーザが対応するメニューアイテム (ファイル→オフライン作業) を選択することによりオフラインモードに移行する度に更新されます。

-

加えて、このプロパティはブラウザがネットワークに接続することがそれ以降不可能になった時にもその度に更新される必要があります。次の仕様に従います。

-
- navigator.onLine 属性はユーザがリンクを押した時やスクリプトが外部のページを要求したときに、ユーザエージェントがネットワークに連絡できない場合(またはそのような試みが失敗した場合)に必ず false を返す必要があります。
-

Firefox 2 はこのプロパティをブラウザのオフラインモードが切り替わる度に更新していました。また Windows と Linux においてネットワークへの接続が失われたとき、復活したときにも更新していました。

-

このプロパティは Firefox と Internet Explorer の古いバージョンにも存在しました。(仕様はこれらの先の実装を基にしました。) 従って今すぐこのプロパティを使い始めることができます。ネットワーク状態の自動判断は Firefox 2 にて実装されました。

-

"online" および "offline" イベント

-

Firefox 3の 2 つの新しいイベントを紹介します。"online" と "offline" です。これらの 2 つのイベントは各ページの <body> にてブラウザがオンラインとオフラインのモードを切り替えるたびに発生します。加えてこのイベントは document.body から document へと浮上し、window までたどり着きます。これらのイベントはキャンセルできません (ユーザのオンラインモードやオフラインモードへの移行を防ぐことはできません)。

-

これらのイベントに対するリスナを登録することもいくつかの馴染みのある方法にて可能です。

- -

実行例

-

簡単なテストケースを実行してこれらのイベントの動作を確認することができます。 XXX When mochitests for this are created, point to those instead and update this example -nickolay

-
 <!doctype html>
- <html>
- <head>
-   <script>
-     function updateOnlineStatus(msg) {
-       var status = document.getElementById("status");
-       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
-       status.setAttribute("class", condition);
-       var state = document.getElementById("state");
-       state.innerHTML = condition;
-       var log = document.getElementById("log");
-       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
-     }
-     function loaded() {
-       updateOnlineStatus("load");
-       document.body.addEventListener("offline", function () {
-         updateOnlineStatus("offline")
-       }, false);
-       document.body.addEventListener("online", function () {
-         updateOnlineStatus("online")
-       }, false);
-     }
-   </script>
-   <style>...</style>
- </head>
- <body onload="loaded()">
-   <div id="status"><p id="state"></p></div>
-   <div id="log"></div>
- </body>
- </html>
-
-

参考

- -
- {{HTML5ArticleTOC()}}
diff --git a/files/ja/web/api/navigatorplugins/index.html b/files/ja/web/api/navigatorplugins/index.html deleted file mode 100644 index 516f690870..0000000000 --- a/files/ja/web/api/navigatorplugins/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: NavigatorPlugins -slug: Web/API/NavigatorPlugins -tags: - - API -translation_of: Web/API/NavigatorPlugins ---- -

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

- -

The NavigatorPlugins interface contains methods and properties related to the plugins installed in the browser.

- -

There is no object of type NavigatorPlugins, but other interfaces, like {{domxref("Navigator")}}, implement it.

- -

Properties

- -
-
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
-
Returns an {{domxref("MimeTypeArray")}} listing the MIME types supported by the browser.
-
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
-
Returns a {{domxref("PluginArray")}} listing the plugins installed in the browser.
-
- -

Methods

- -

The NavigatorPlugins interface doesn't inherit any method.

- -
-
{{domxref("NavigatorPlugins.javaEnabled")}} {{readonlyInline}}{{experimental_inline}}
-
Returns a {{domxref("Boolean")}} flag indicating whether the host browser is Java-enabled or not.
-
- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{Compat("api.NavigatorPlugins")}}

- -

See also

- - diff --git a/files/ja/web/api/navigatorplugins/javaenabled/index.html b/files/ja/web/api/navigatorplugins/javaenabled/index.html deleted file mode 100644 index 188e4cb87e..0000000000 --- a/files/ja/web/api/navigatorplugins/javaenabled/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: NavigatorPlugins.javaEnabled() -slug: Web/API/NavigatorPlugins/javaEnabled -tags: - - API - - Method - - Reference -translation_of: Web/API/NavigatorPlugins/javaEnabled ---- -

{{ APIRef("HTML DOM") }}

- -

このメソッドは常に false を返します。

- -

構文

- -
result = window.navigator.javaEnabled()
-
- -

- -
if (window.navigator.javaEnabled()) {
-   // コードは実行されることはありません。条件は常に false になります。
-}
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-navigator-javaenabled', 'NavigatorPlugins.javaEnabled')}}{{Spec2('HTML WHATWG')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.NavigatorPlugins.javaEnabled")}}

diff --git a/files/ja/web/api/navigatorplugins/mimetypes/index.html b/files/ja/web/api/navigatorplugins/mimetypes/index.html deleted file mode 100644 index cafffadc06..0000000000 --- a/files/ja/web/api/navigatorplugins/mimetypes/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: mimeTypes -slug: Web/API/NavigatorPlugins/mimeTypes -tags: -- API -- Property -- Reference -translation_of: Web/API/NavigatorPlugins/mimeTypes ---- -
{{ ApiRef("HTML DOM") }}{{deprecated_header}}
- -

{{domxref("MimeTypeArray")}} オブジェクトを返します。これにはブラウザーが解釈する MIME タイプを表す {{domxref("MimeType")}} のリストが入っています。

- -
-

: 最新のバージョンのブラウザーでは、 {{domxref("MimeTypeArray")}} オブジェクトの名前付きプロパティは列挙可能ではなくなっています。

-
- -

構文

- -
var mimeTypes[] = navigator.mimeTypes;
-
- -

mimeTypesMimeTypeArray オブジェクトであり、これは length プロパティと item(index) および namedItem(name) メソッドを持っています。

- -

- -
function isJavaPresent() {
-  return 'application/x-java-applet' in navigator.mimeTypes;
-}
-
-function getJavaPluginDescription() {
-  var mimetype = navigator.mimeTypes['application/x-java-applet'];
-  if (mimetype === undefined) {
-    // no Java plugin present
-    return undefined;
-  }
-  return mimetype.enabledPlugin.description;
-}
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-navigator-mimetypes', - 'NavigatorPlugins.mimeTypes')}}{{Spec2('HTML WHATWG')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.NavigatorPlugins.mimeTypes")}}

diff --git a/files/ja/web/api/navigatorplugins/plugins/index.html b/files/ja/web/api/navigatorplugins/plugins/index.html deleted file mode 100644 index fa0e482b6d..0000000000 --- a/files/ja/web/api/navigatorplugins/plugins/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: window.navigator.plugins -slug: Web/API/NavigatorPlugins/plugins -tags: - - DOM - - DOM_0 - - Gecko -translation_of: Web/API/NavigatorPlugins/plugins ---- -
{{ApiRef}} {{non-standard_header}}
- -

概要

- -

アプリケーションにインストールされたプラグインをリスト化した、{{domxref("PluginArray")}} オブジェクトを返します。

- -

構文

- -
plugins = navigator.plugins;
-
- - - -

戻り値は JavaScript の配列ではありませんが、length プロパティを持っています。また、各要素にアクセスする方法として、item(index )namedItem("name" ) メソッド経由だけでなく、plugins[2] のように、角括弧を使う方法もサポートしています。

- -

- -

以下の例は、高位の文書のためにインストールされたプラグインについての情報を出力します。注意:Plugin オブジェクトに用意されているプロパティは namefilenamedescription です。

- -
{{gecko_minversion_note("1.9.2", "Gecko 1.9.2 で version プロパティが追加されました。")}}
- -
var L = navigator.plugins.length;
-
-document.write(
-  L.toString() + " Plugin(s)<br>" +
-  "Name | Filename | description<br>"
-);
-
-for(var i = 0; i < L; i++) {
-  document.write(
-    navigator.plugins[i].name +
-    " | " +
-    navigator.plugins[i].filename +
-    " | " +
-    navigator.plugins[i].description +
-    " | " +
-    navigator.plugins[i].version +
-    "<br>"
-  );
-}
- -

注記

- -

{{domxref("Plugin")}} オブジェクトは、ブラウザにインストールされた様々なプラグインについての情報を取得して表示する小さなインタフェースです。 プラグインの一覧は、ブラウザのアドレスバーに about:plugins と入力することでも閲覧可能です。

- -

仕様

- -

{{DOM0}}

diff --git a/files/ja/web/api/navigatorstorage/index.html b/files/ja/web/api/navigatorstorage/index.html deleted file mode 100644 index 17d4d65f69..0000000000 --- a/files/ja/web/api/navigatorstorage/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: NavigatorStorage -slug: Web/API/NavigatorStorage -tags: - - API - - Interface - - Mixin - - Navigator - - NavigatorStorage - - Reference - - Secure context - - Storage - - Storage Standard - - WorkerNavigator -translation_of: Web/API/NavigatorStorage ---- -

{{securecontext_header}}{{APIRef("Storage")}}

- -

NavigatorStorage {{Glossary("mixin","ミックスイン")}}は、{{domxref("Navigator")}} および {{domxref("WorkerNavigator")}} インターフェース に {{domxref("Navigator.storage")}} プロパティを追加します。 これにより、データストアの永続性の制御と情報の取得に使用する {{domxref("StorageManager")}} シングルトンへのアクセスが提供されます。

- -

{{AvailableInWorkers}}

- -

{{Glossary("Cookie","クッキー")}}、Web Storage API({{domxref("Window.localStorage")}} および {{domxref("Window.sessionStorage")}})、IndexedDB など、ウェブコンテンツがユーザーのコンピューターにデータを保存する方法を提供する API は数多くあります。 ストレージ標準は、それらすべての API とストレージテクノロジーを実装するための共通基盤として機能するように設計されているため、共通のメソッドとプロパティを使用してそれらの制約と構成を理解および制御できます。

- -

プロパティ

- -
-
{{domxref("NavigatorStorage.storage", "storage")}} {{readonlyinline}}{{securecontext_inline}}
-
Storage Manager へのアクセスに使用する{{domxref("StorageManager")}} シングルトンオブジェクトを返します。 返されたオブジェクトを通じて、データストアの永続性を制御したり、サイトやアプリがデータを格納するために必要なスペースの量を見積もることができます。
-
- -

メソッド

- -

NavigatorStorage ミックスインにはメソッドがありません。

- -

仕様

- - - - - - - - - - - - - - - - -
仕様状態コメント
{{SpecName('Storage')}}{{Spec2('Storage')}}初期定義
- -

ブラウザーの互換性

- - - -

{{Compat("api.NavigatorStorage")}}

- -

関連情報

- - diff --git a/files/ja/web/api/navigatorstorage/storage/index.html b/files/ja/web/api/navigatorstorage/storage/index.html deleted file mode 100644 index d10bdfaadf..0000000000 --- a/files/ja/web/api/navigatorstorage/storage/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: NavigatorStorage.storage -slug: Web/API/NavigatorStorage/storage -tags: - - API - - Navigator - - NavigatorStorage - - Property - - Reference - - Secure context - - Storage - - WorkerNavigator -translation_of: Web/API/NavigatorStorage/storage ---- -

{{securecontext_header}}{{APIRef("Storage")}}

- -

NavigatorStorage.storage 読み取り専用プロパティは、現在のサイトまたはアプリのブラウザーの全体的なストレージ機能にアクセスするために使用するシングルトンの {{domxref("StorageManager")}} オブジェクトを返します。 返されたオブジェクトを使用すると、データストアの永続性を調べて設定し、ブラウザーがローカルストレージで使用するためのスペースがどれだけあるかを概算できます。

- -

構文

- -
var storageManager = navigator.storage;
-
- -

- -

格納されたデータの永続性を維持したり、データを格納するスペースの大まかな決定に使用できる {{domxref("StorageManager")}} オブジェクト。

- -

仕様

- - - - - - - - - - - - - - -
仕様状態コメント
{{SpecName('Storage', '#navigatorstorage', 'navigator.storage')}}{{Spec2('Storage')}}初期定義
- -

ブラウザーの互換性

- -
- - -

{{Compat("api.NavigatorStorage.storage")}}

-
- -

関連情報

- - diff --git a/files/ja/web/http/headers/index/index.html b/files/ja/web/http/headers/index/index.html deleted file mode 100644 index de4df1e89a..0000000000 --- a/files/ja/web/http/headers/index/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: 索引 -slug: Web/HTTP/Headers/Index -tags: - - HTTP - - HTTP ヘッダー - - ヘッダー - - 索引 -translation_of: Web/HTTP/Headers/Index ---- -
{{HTTPSidebar}}
- -

{{Index("/ja/docs/Web/HTTP/Headers")}}

diff --git a/files/ko/_redirects.txt b/files/ko/_redirects.txt index 49274088fa..da45ff5a19 100644 --- a/files/ko/_redirects.txt +++ b/files/ko/_redirects.txt @@ -423,7 +423,7 @@ /ko/docs/New_in_JavaScript_1.8 /ko/docs/Web/JavaScript/New_in_JavaScript/1.8 /ko/docs/Node_server_without_framework /ko/docs/Learn/Server-side/Node_server_without_framework /ko/docs/Notable_bugs_fixed_in_Firefox_3 /ko/docs/Mozilla/Firefox/Releases/3/Notable_bugs_fixed -/ko/docs/Online_and_offline_events /ko/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/ko/docs/Online_and_offline_events /ko/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /ko/docs/SVG /ko/docs/Web/SVG /ko/docs/SVG/Tutorial /ko/docs/Web/SVG/Tutorial /ko/docs/SVG:Tutorial /ko/docs/Web/SVG/Tutorial @@ -479,6 +479,11 @@ /ko/docs/Web/API/Navigator.battery /ko/docs/Web/API/Navigator/battery /ko/docs/Web/API/Navigator.battery/window.navigator.battery /ko/docs/Web/API/Navigator/battery /ko/docs/Web/API/Navigator.connection/window.navigator.connection /ko/docs/Web/API/Navigator/connection +/ko/docs/Web/API/NavigatorID /ko/docs/orphaned/Web/API/NavigatorID +/ko/docs/Web/API/NavigatorLanguage /ko/docs/orphaned/Web/API/NavigatorLanguage +/ko/docs/Web/API/NavigatorLanguage/language /ko/docs/orphaned/Web/API/NavigatorLanguage/language +/ko/docs/Web/API/NavigatorOnLine /ko/docs/orphaned/Web/API/NavigatorOnLine +/ko/docs/Web/API/NavigatorOnLine/Online_and_offline_events /ko/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /ko/docs/Web/API/NetworkInformation.connection /ko/docs/Web/API/Navigator/connection /ko/docs/Web/API/NetworkInformation.connection/window.navigator.connection /ko/docs/Web/API/Navigator/connection /ko/docs/Web/API/NetworkInformation/connection /ko/docs/Web/API/Navigator/connection @@ -996,4 +1001,3 @@ /ko/docs/도구들/WebIDE/문제해결 /ko/docs/Tools/WebIDE/문제해결 /ko/docs/도구들/Web_Console /ko/docs/Tools/Web_Console /ko/docs/호환_모드와_표준_모드 /ko/docs/Web/HTML/Quirks_Mode_and_Standards_Mode - diff --git a/files/ko/_wikihistory.json b/files/ko/_wikihistory.json index d893c3cc17..9547a8024f 100644 --- a/files/ko/_wikihistory.json +++ b/files/ko/_wikihistory.json @@ -5808,42 +5808,6 @@ "dragmove" ] }, - "Web/API/NavigatorID": { - "modified": "2020-10-15T22:04:17.452Z", - "contributors": [ - "fscholz", - "SSJ-unclear" - ] - }, - "Web/API/NavigatorLanguage": { - "modified": "2020-10-15T21:59:32.837Z", - "contributors": [ - "alattalatta", - "teoli" - ] - }, - "Web/API/NavigatorLanguage/language": { - "modified": "2019-03-18T21:46:11.388Z", - "contributors": [ - "yuj25" - ] - }, - "Web/API/NavigatorOnLine": { - "modified": "2020-10-15T21:59:06.261Z", - "contributors": [ - "alattalatta", - "chrisdavidmills" - ] - }, - "Web/API/NavigatorOnLine/Online_and_offline_events": { - "modified": "2019-03-23T23:51:10.400Z", - "contributors": [ - "chrisdavidmills", - "teoli", - "Jeongkyu", - "조경빈" - ] - }, "Web/API/NetworkInformation": { "modified": "2020-10-15T21:33:00.164Z", "contributors": [ @@ -18261,6 +18225,42 @@ "JoonghunPark" ] }, + "orphaned/Web/API/NavigatorID": { + "modified": "2020-10-15T22:04:17.452Z", + "contributors": [ + "fscholz", + "SSJ-unclear" + ] + }, + "orphaned/Web/API/NavigatorLanguage": { + "modified": "2020-10-15T21:59:32.837Z", + "contributors": [ + "alattalatta", + "teoli" + ] + }, + "orphaned/Web/API/NavigatorLanguage/language": { + "modified": "2019-03-18T21:46:11.388Z", + "contributors": [ + "yuj25" + ] + }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2020-10-15T21:59:06.261Z", + "contributors": [ + "alattalatta", + "chrisdavidmills" + ] + }, + "orphaned/Web/API/NavigatorOnLine/Online_and_offline_events": { + "modified": "2019-03-23T23:51:10.400Z", + "contributors": [ + "chrisdavidmills", + "teoli", + "Jeongkyu", + "조경빈" + ] + }, "orphaned/Web/API/OffscreenCanvas/toBlob": { "modified": "2020-10-15T22:14:42.795Z", "contributors": [ diff --git a/files/ko/orphaned/web/api/navigatorid/index.html b/files/ko/orphaned/web/api/navigatorid/index.html new file mode 100644 index 0000000000..cd0a71fcb3 --- /dev/null +++ b/files/ko/orphaned/web/api/navigatorid/index.html @@ -0,0 +1,75 @@ +--- +title: NavigatorID +slug: orphaned/Web/API/NavigatorID +translation_of: Web/API/NavigatorID +original_slug: Web/API/NavigatorID +--- +

{{APIRef("HTML DOM")}}

+ +

NavigatorID 인터페이스에는 브라우저의 ID와 관련된 메소드 및 특성이 들어있습니다.

+ +

NavigatorID, 에는 유형의 객체가 없지만, {{domxref("Navigator")}} 또는 {{domxref("WorkerNavigator")}}와 같은 인터페이스는 이를 포함합니다.

+ +

Properties

+ +

NavigatorID 인터페이스는 속성을 상속하지 않습니다.

+ +
+
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{deprecated_inline}}
+
모든 브라우저에서 항상 'Mozilla'를 반환합니다. 이 속성은 호환성 목적으로만 유지됩니다.
+
{{domxref("NavigatorID.appName")}} {{readonlyInline}} {{deprecated_inline}}
+
브라우저의 공식명을 반환합니다. 올바른 값을 반환하려면 이 속성에 의존하지 마세요.
+
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}} {{deprecated_inline}}
+
브라우저의 버젼을 문자열로 반환합니다. 올바른 값을 반환하려면 이 속성에 의존하지 마세요.
+
{{domxref("NavigatorID.platform")}} {{readonlyInline}} {{deprecated_inline}}
+
브라우저의 플랫폼을 문자열로 반환합니다. 올바른 값을 반환하려면 이 속성에 의존하지 마세요.
+
{{domxref("NavigatorID.product")}} {{readonlyInline}} {{deprecated_inline}}
+
모든 브라우저에서 항상 'Gecko' 를 반환합니다. 이 속성은 호환성 목적으로만 유지됩니다.
+
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
+
현재 브라우저의 사용자 에이전트 문자열을 반환합니다.
+
+ +

Methods

+ +

NavigatorID 인터페이스는 메소드를 상속하지 않습니다.

+ +
+
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}}
+
언제나 false를 반환합니다. 자바스크립트의 taint/untaint 함수는 1.2 버젼에서 없어졌습니다. 이 방법은 호환성 목적으로만 유지됩니다.Not available in workers.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}호환성을 위해 appCodeName 속성과 taintEnabled() 메서드를 추가했습니다.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}초기 사양
+ +

브라우저 호환성

+ + + +

{{Compat("api.NavigatorID")}}

+ +

그외에 볼 것

+ + diff --git a/files/ko/orphaned/web/api/navigatorlanguage/index.html b/files/ko/orphaned/web/api/navigatorlanguage/index.html new file mode 100644 index 0000000000..7e378dd179 --- /dev/null +++ b/files/ko/orphaned/web/api/navigatorlanguage/index.html @@ -0,0 +1,66 @@ +--- +title: NavigatorLanguage +slug: orphaned/Web/API/NavigatorLanguage +tags: + - API + - HTML-DOM + - Reference +translation_of: Web/API/NavigatorLanguage +original_slug: Web/API/NavigatorLanguage +--- +

{{APIRef("HTML DOM")}}

+ +

NavigatorLanguage contains methods and properties related to the language of the navigator.

+ +

There is no object of type NavigatorLanguage, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorLanguage interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
+
Returns a {{domxref("DOMString")}} representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
+
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
+
Returns an array of {{domxref("DOMString")}} representing the languages known to the user, by order of preference.
+
+ +

Methods

+ +

The NavigatorLanguage interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Since the {{SpecName('HTML5 W3C')}} snapshot, the languages property has been added.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Initial specification; snapshot of  an early version{{SpecName('HTML WHATWG')}}.
+ +

Browser compatibility

+ + + +

{{Compat("api.NavigatorLanguage")}}

+ +

See also

+ + diff --git a/files/ko/orphaned/web/api/navigatorlanguage/language/index.html b/files/ko/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..8b8f1b48bc --- /dev/null +++ b/files/ko/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,57 @@ +--- +title: NavigatorLanguage.language +slug: orphaned/Web/API/NavigatorLanguage/language +translation_of: Web/API/NavigatorLanguage/language +original_slug: Web/API/NavigatorLanguage/language +--- +
{{APIRef("HTML DOM")}}
+ +

 

+ +

NavigatorLanguage.language 읽기 전용 속성은 사용자의 기본 언어 (일반적으로 브라우저 UI의 언어)를 나타내는 문자열을 반환합니다.

+ +

Syntax

+ +
var lang = navigator.language
+
+ +

Value

+ +

A {{domxref("DOMString")}}. lang stores a string representing the language version as defined in BCP 47. Examples of valid language codes include "en", "en-US", "fr", "fr-FR", "es-ES", etc.

+ +

Note that in Safari on macOS and iOS prior to 10.2, the country code returned is lowercase: "en-us", "fr-fr" etc.

+ +

Example

+ +
if (window.navigator.language != 'en') {
+  doLangSelect(window.navigator.language);
+}
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('HTML5.1', '#dom-navigator-language', 'NavigatorLanguage.language') }}{{ Spec2('HTML5.1') }}Initial definition
+ +

Browser compatibility

+ +

{{Compat("api.NavigatorLanguage.language")}}

+ +

See also

+ + diff --git a/files/ko/orphaned/web/api/navigatoronline/index.html b/files/ko/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..9354cb2464 --- /dev/null +++ b/files/ko/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,64 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +tags: + - API + - HTML-DOM +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

+ +

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorOnLine interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
+
+ +

Methods

+ +

The NavigatorOnLine interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
+ +

Browser compatibility

+ + + +

{{Compat("api.NavigatorOnLine")}}

+ +

See also

+ + diff --git a/files/ko/orphaned/web/api/navigatoronline/online_and_offline_events/index.html b/files/ko/orphaned/web/api/navigatoronline/online_and_offline_events/index.html new file mode 100644 index 0000000000..1057aea5f8 --- /dev/null +++ b/files/ko/orphaned/web/api/navigatoronline/online_and_offline_events/index.html @@ -0,0 +1,108 @@ +--- +title: Online and offline events +slug: orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +tags: + - AJAX + - DOM + - Web Development +translation_of: Web/API/NavigatorOnLine/Online_and_offline_events +original_slug: Web/API/NavigatorOnLine/Online_and_offline_events +--- +

In progress Firefox 3WHATWG 웹 애플리케이션 1.0 명세에 기술된 온라인/오프라인 이벤트를 구현합니다.

+ +

개요

+ +

좋은 오프라인 가능(offline-capable) 웹 애플리케이션을 작성하려면 여러분의 애플리케이션이 실제로 오프라인이 되는 때를 알아야 합니다. 덧붙여, 여러분의 애플리케이션이 '온라인' 상태로 돌아오는 때도 알아야 합니다. 사실, 이 요구사항은 다음과 같이 정리할 수 있습니다.

+ +
    +
  1. 여러분이 서버와 재동기화할 수 있도록 사용자가 온라인으로 돌아오는 때를 알아야 합니다.
  2. +
  3. 여러분의 서버 요청을 나중에 처리하기 위해 대기시킬 수 있도록 사용자가 오프라인이 되는 때를 알아야 합니다.
  4. +
+ +

온라인/오프라인 이벤트는 이 과정을 단순하게 만드는 것을 도와줍니다.

+ +

여러분의 웹 애플리케이션은 특정 문서가 오프라인 자원 캐시에 보관되는 것을 확실하게 할 필요도 있습니다. 이를 위해서는 다음과 같이 HEAD 섹션에 LINK 요소를 포함합니다.

+ +
<link rel="offline-resource" href="myresource">
+
+ +

이는 Firefox 3 및 이후 버전에서 HTML을 처리할 때, 참조하는 자원을 오프라인에서 사용할 수 있도록 특별한 오프라인 자원 캐시에 저장하도록 합니다.

+ +

API

+ + + +

navigator.onLinetrue/false(온라인은 true, 오프라인은 false)를 보관하는 속성입니다. 이 속성은 사용자가 해당 메뉴 항목(파일 -> 오프라인 작업)을 선택하여 "오프라인 모드"로 전환할 때마다 갱신됩니다.

+ +

또한 이 속성은 브라우저가 네트워크에 더 이상 연결할 수 없을 때마다 갱신됩니다. 명세에 따르면:

+ +
사용자가 링크를 따라가거나 스크립트가 원격 페이지를 요청할 때 사용자 에이전트가 네트워크에 접속할 수 없으면 (혹은 그러한 시도가 실패할 것이라는 것을 안다면) navigator.onLine 속성은 false를 반환해야 합니다...
+ +

Firefox 2는 윈도우와 리눅스에서 브라우저의 온라인/오프라인 모드가 바뀔 때와 네트워크가 끊어지거나 다시 접속될 때 이 속성을 갱신합니다.

+ +

이 속성은 Firefox와 Internet Explorer의 이전 버전에도 있으므로 (명세는 이러한 기존 구현을 바탕으로 합니다) 이를 즉시 사용할 수 있습니다. 네트워크 상태의 자동 감지는 Firefox 2에서 구현되었습니다.

+ +

"online"과 "offline" 이벤트

+ +

Firefox 3는 두 가지 새로운 이벤트를 도입하고 있습니다: 바로 "online"과 "offline"입니다. 이 두 가지 이벤트는 브라우저가 온라인과 오프라인 모드를 전환할 때 각 페이지의 <body>에서 발생합니다. 덧붙여, 이 이벤트는 document.body에서 document로 전달되고 window에서 끝납니다. 두 가지 이벤트 모두 취소 불가능한(non-cancellable) 이벤트입니다(여러분은 사용자가 온라인이 되거나 오프라인이 되는 것을 막을 수 없습니다).

+ +

널리 알려진 몇 가지 방법으로 해당 이벤트에 대한 리스너(listener)를 등록할 수 있습니다.

+ + + +

예제

+ +

이벤트가 동작하는지 확인할 수 있는 간단한 테스트 케이스가 있습니다. XXX When mochitests for this are created, point to those instead and update this example -nickolay

+ +
 <!doctype html>
+ <html>
+ <head>
+   <script>
+     function updateOnlineStatus(msg) {
+       var status = document.getElementById("status");
+       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
+       status.setAttribute("class", condition);
+       var state = document.getElementById("state");
+       state.innerHTML = condition;
+       var log = document.getElementById("log");
+       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
+     }
+     function loaded() {
+       updateOnlineStatus("load");
+       document.body.addEventListener("offline", function () {
+         updateOnlineStatus("offline")
+       }, false);
+       document.body.addEventListener("online", function () {
+         updateOnlineStatus("online")
+       }, false);
+     }
+   </script>
+   <style>...</style>
+ </head>
+ <body onload="loaded()">
+   <div id="status"><p id="state"></p></div>
+   <div id="log"></div>
+ </body>
+ </html>
+
+ +

참고

+ + + +

 

+ +

 

+ +
 
+ +

{{ languages( { "en": "en/Online_and_offline_events", "es": "es/Eventos_online_y_offline", "fr": "fr/\u00c9v\u00e8nements_online_et_offline", "ja": "ja/Online_and_offline_events", "pl": "pl/Zdarzenia_online_i_offline", "pt": "pt/Eventos_online_e_offline" } ) }}

diff --git a/files/ko/web/api/navigatorid/index.html b/files/ko/web/api/navigatorid/index.html deleted file mode 100644 index d3f1159cc4..0000000000 --- a/files/ko/web/api/navigatorid/index.html +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: NavigatorID -slug: Web/API/NavigatorID -translation_of: Web/API/NavigatorID ---- -

{{APIRef("HTML DOM")}}

- -

NavigatorID 인터페이스에는 브라우저의 ID와 관련된 메소드 및 특성이 들어있습니다.

- -

NavigatorID, 에는 유형의 객체가 없지만, {{domxref("Navigator")}} 또는 {{domxref("WorkerNavigator")}}와 같은 인터페이스는 이를 포함합니다.

- -

Properties

- -

NavigatorID 인터페이스는 속성을 상속하지 않습니다.

- -
-
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{deprecated_inline}}
-
모든 브라우저에서 항상 'Mozilla'를 반환합니다. 이 속성은 호환성 목적으로만 유지됩니다.
-
{{domxref("NavigatorID.appName")}} {{readonlyInline}} {{deprecated_inline}}
-
브라우저의 공식명을 반환합니다. 올바른 값을 반환하려면 이 속성에 의존하지 마세요.
-
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}} {{deprecated_inline}}
-
브라우저의 버젼을 문자열로 반환합니다. 올바른 값을 반환하려면 이 속성에 의존하지 마세요.
-
{{domxref("NavigatorID.platform")}} {{readonlyInline}} {{deprecated_inline}}
-
브라우저의 플랫폼을 문자열로 반환합니다. 올바른 값을 반환하려면 이 속성에 의존하지 마세요.
-
{{domxref("NavigatorID.product")}} {{readonlyInline}} {{deprecated_inline}}
-
모든 브라우저에서 항상 'Gecko' 를 반환합니다. 이 속성은 호환성 목적으로만 유지됩니다.
-
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
-
현재 브라우저의 사용자 에이전트 문자열을 반환합니다.
-
- -

Methods

- -

NavigatorID 인터페이스는 메소드를 상속하지 않습니다.

- -
-
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}}
-
언제나 false를 반환합니다. 자바스크립트의 taint/untaint 함수는 1.2 버젼에서 없어졌습니다. 이 방법은 호환성 목적으로만 유지됩니다.Not available in workers.
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}호환성을 위해 appCodeName 속성과 taintEnabled() 메서드를 추가했습니다.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}초기 사양
- -

브라우저 호환성

- - - -

{{Compat("api.NavigatorID")}}

- -

그외에 볼 것

- - diff --git a/files/ko/web/api/navigatorlanguage/index.html b/files/ko/web/api/navigatorlanguage/index.html deleted file mode 100644 index 0bec377b46..0000000000 --- a/files/ko/web/api/navigatorlanguage/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: NavigatorLanguage -slug: Web/API/NavigatorLanguage -tags: - - API - - HTML-DOM - - Reference -translation_of: Web/API/NavigatorLanguage ---- -

{{APIRef("HTML DOM")}}

- -

NavigatorLanguage contains methods and properties related to the language of the navigator.

- -

There is no object of type NavigatorLanguage, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorLanguage interface doesn't inherit any property.

- -
-
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
-
Returns a {{domxref("DOMString")}} representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
-
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
-
Returns an array of {{domxref("DOMString")}} representing the languages known to the user, by order of preference.
-
- -

Methods

- -

The NavigatorLanguage interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Since the {{SpecName('HTML5 W3C')}} snapshot, the languages property has been added.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Initial specification; snapshot of  an early version{{SpecName('HTML WHATWG')}}.
- -

Browser compatibility

- - - -

{{Compat("api.NavigatorLanguage")}}

- -

See also

- - diff --git a/files/ko/web/api/navigatorlanguage/language/index.html b/files/ko/web/api/navigatorlanguage/language/index.html deleted file mode 100644 index 9efbc98b06..0000000000 --- a/files/ko/web/api/navigatorlanguage/language/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: NavigatorLanguage.language -slug: Web/API/NavigatorLanguage/language -translation_of: Web/API/NavigatorLanguage/language ---- -
{{APIRef("HTML DOM")}}
- -

 

- -

NavigatorLanguage.language 읽기 전용 속성은 사용자의 기본 언어 (일반적으로 브라우저 UI의 언어)를 나타내는 문자열을 반환합니다.

- -

Syntax

- -
var lang = navigator.language
-
- -

Value

- -

A {{domxref("DOMString")}}. lang stores a string representing the language version as defined in BCP 47. Examples of valid language codes include "en", "en-US", "fr", "fr-FR", "es-ES", etc.

- -

Note that in Safari on macOS and iOS prior to 10.2, the country code returned is lowercase: "en-us", "fr-fr" etc.

- -

Example

- -
if (window.navigator.language != 'en') {
-  doLangSelect(window.navigator.language);
-}
-
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{ SpecName('HTML5.1', '#dom-navigator-language', 'NavigatorLanguage.language') }}{{ Spec2('HTML5.1') }}Initial definition
- -

Browser compatibility

- -

{{Compat("api.NavigatorLanguage.language")}}

- -

See also

- - diff --git a/files/ko/web/api/navigatoronline/index.html b/files/ko/web/api/navigatoronline/index.html deleted file mode 100644 index 9c61e0f858..0000000000 --- a/files/ko/web/api/navigatoronline/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -tags: - - API - - HTML-DOM -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

- -

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorOnLine interface doesn't inherit any property.

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
-
- -

Methods

- -

The NavigatorOnLine interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
- -

Browser compatibility

- - - -

{{Compat("api.NavigatorOnLine")}}

- -

See also

- - diff --git a/files/ko/web/api/navigatoronline/online_and_offline_events/index.html b/files/ko/web/api/navigatoronline/online_and_offline_events/index.html deleted file mode 100644 index 2dd25b3819..0000000000 --- a/files/ko/web/api/navigatoronline/online_and_offline_events/index.html +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: Online and offline events -slug: Web/API/NavigatorOnLine/Online_and_offline_events -tags: - - AJAX - - DOM - - Web Development -translation_of: Web/API/NavigatorOnLine/Online_and_offline_events ---- -

In progress Firefox 3WHATWG 웹 애플리케이션 1.0 명세에 기술된 온라인/오프라인 이벤트를 구현합니다.

- -

개요

- -

좋은 오프라인 가능(offline-capable) 웹 애플리케이션을 작성하려면 여러분의 애플리케이션이 실제로 오프라인이 되는 때를 알아야 합니다. 덧붙여, 여러분의 애플리케이션이 '온라인' 상태로 돌아오는 때도 알아야 합니다. 사실, 이 요구사항은 다음과 같이 정리할 수 있습니다.

- -
    -
  1. 여러분이 서버와 재동기화할 수 있도록 사용자가 온라인으로 돌아오는 때를 알아야 합니다.
  2. -
  3. 여러분의 서버 요청을 나중에 처리하기 위해 대기시킬 수 있도록 사용자가 오프라인이 되는 때를 알아야 합니다.
  4. -
- -

온라인/오프라인 이벤트는 이 과정을 단순하게 만드는 것을 도와줍니다.

- -

여러분의 웹 애플리케이션은 특정 문서가 오프라인 자원 캐시에 보관되는 것을 확실하게 할 필요도 있습니다. 이를 위해서는 다음과 같이 HEAD 섹션에 LINK 요소를 포함합니다.

- -
<link rel="offline-resource" href="myresource">
-
- -

이는 Firefox 3 및 이후 버전에서 HTML을 처리할 때, 참조하는 자원을 오프라인에서 사용할 수 있도록 특별한 오프라인 자원 캐시에 저장하도록 합니다.

- -

API

- - - -

navigator.onLinetrue/false(온라인은 true, 오프라인은 false)를 보관하는 속성입니다. 이 속성은 사용자가 해당 메뉴 항목(파일 -> 오프라인 작업)을 선택하여 "오프라인 모드"로 전환할 때마다 갱신됩니다.

- -

또한 이 속성은 브라우저가 네트워크에 더 이상 연결할 수 없을 때마다 갱신됩니다. 명세에 따르면:

- -
사용자가 링크를 따라가거나 스크립트가 원격 페이지를 요청할 때 사용자 에이전트가 네트워크에 접속할 수 없으면 (혹은 그러한 시도가 실패할 것이라는 것을 안다면) navigator.onLine 속성은 false를 반환해야 합니다...
- -

Firefox 2는 윈도우와 리눅스에서 브라우저의 온라인/오프라인 모드가 바뀔 때와 네트워크가 끊어지거나 다시 접속될 때 이 속성을 갱신합니다.

- -

이 속성은 Firefox와 Internet Explorer의 이전 버전에도 있으므로 (명세는 이러한 기존 구현을 바탕으로 합니다) 이를 즉시 사용할 수 있습니다. 네트워크 상태의 자동 감지는 Firefox 2에서 구현되었습니다.

- -

"online"과 "offline" 이벤트

- -

Firefox 3는 두 가지 새로운 이벤트를 도입하고 있습니다: 바로 "online"과 "offline"입니다. 이 두 가지 이벤트는 브라우저가 온라인과 오프라인 모드를 전환할 때 각 페이지의 <body>에서 발생합니다. 덧붙여, 이 이벤트는 document.body에서 document로 전달되고 window에서 끝납니다. 두 가지 이벤트 모두 취소 불가능한(non-cancellable) 이벤트입니다(여러분은 사용자가 온라인이 되거나 오프라인이 되는 것을 막을 수 없습니다).

- -

널리 알려진 몇 가지 방법으로 해당 이벤트에 대한 리스너(listener)를 등록할 수 있습니다.

- - - -

예제

- -

이벤트가 동작하는지 확인할 수 있는 간단한 테스트 케이스가 있습니다. XXX When mochitests for this are created, point to those instead and update this example -nickolay

- -
 <!doctype html>
- <html>
- <head>
-   <script>
-     function updateOnlineStatus(msg) {
-       var status = document.getElementById("status");
-       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
-       status.setAttribute("class", condition);
-       var state = document.getElementById("state");
-       state.innerHTML = condition;
-       var log = document.getElementById("log");
-       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
-     }
-     function loaded() {
-       updateOnlineStatus("load");
-       document.body.addEventListener("offline", function () {
-         updateOnlineStatus("offline")
-       }, false);
-       document.body.addEventListener("online", function () {
-         updateOnlineStatus("online")
-       }, false);
-     }
-   </script>
-   <style>...</style>
- </head>
- <body onload="loaded()">
-   <div id="status"><p id="state"></p></div>
-   <div id="log"></div>
- </body>
- </html>
-
- -

참고

- - - -

 

- -

 

- -
 
- -

{{ languages( { "en": "en/Online_and_offline_events", "es": "es/Eventos_online_y_offline", "fr": "fr/\u00c9v\u00e8nements_online_et_offline", "ja": "ja/Online_and_offline_events", "pl": "pl/Zdarzenia_online_i_offline", "pt": "pt/Eventos_online_e_offline" } ) }}

diff --git a/files/pl/_redirects.txt b/files/pl/_redirects.txt index 2075c5e0ee..ef4b558231 100644 --- a/files/pl/_redirects.txt +++ b/files/pl/_redirects.txt @@ -498,19 +498,19 @@ /pl/docs/DOM/window.getSelection /pl/docs/Web/API/Window/getSelection /pl/docs/DOM/window.name /pl/docs/Web/API/Window/name /pl/docs/DOM/window.navigator /pl/docs/Web/API/Window/navigator -/pl/docs/DOM/window.navigator.appCodeName /pl/docs/Web/API/NavigatorID/appCodeName -/pl/docs/DOM/window.navigator.appName /pl/docs/Web/API/NavigatorID/appName -/pl/docs/DOM/window.navigator.appVersion /pl/docs/Web/API/NavigatorID/appVersion +/pl/docs/DOM/window.navigator.appCodeName /pl/docs/orphaned/Web/API/NavigatorID/appCodeName +/pl/docs/DOM/window.navigator.appName /pl/docs/orphaned/Web/API/NavigatorID/appName +/pl/docs/DOM/window.navigator.appVersion /pl/docs/orphaned/Web/API/NavigatorID/appVersion /pl/docs/DOM/window.navigator.buildID /pl/docs/Web/API/Navigator/buildID /pl/docs/DOM/window.navigator.cookieEnabled /pl/docs/Web/API/Navigator/cookieEnabled -/pl/docs/DOM/window.navigator.javaEnabled /pl/docs/Web/API/NavigatorPlugins/javaEnabled -/pl/docs/DOM/window.navigator.language /pl/docs/Web/API/NavigatorLanguage/language -/pl/docs/DOM/window.navigator.mimeTypes /pl/docs/Web/API/NavigatorPlugins/mimeTypes -/pl/docs/DOM/window.navigator.onLine /pl/docs/Web/API/NavigatorOnLine/onLine +/pl/docs/DOM/window.navigator.javaEnabled /pl/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/pl/docs/DOM/window.navigator.language /pl/docs/orphaned/Web/API/NavigatorLanguage/language +/pl/docs/DOM/window.navigator.mimeTypes /pl/docs/orphaned/Web/API/NavigatorPlugins/mimeTypes +/pl/docs/DOM/window.navigator.onLine /pl/docs/orphaned/Web/API/NavigatorOnLine/onLine /pl/docs/DOM/window.navigator.oscpu /pl/docs/Web/API/Navigator/oscpu -/pl/docs/DOM/window.navigator.platform /pl/docs/Web/API/NavigatorID/platform -/pl/docs/DOM/window.navigator.plugins /pl/docs/Web/API/NavigatorPlugins/plugins -/pl/docs/DOM/window.navigator.product /pl/docs/Web/API/NavigatorID/product +/pl/docs/DOM/window.navigator.platform /pl/docs/orphaned/Web/API/NavigatorID/platform +/pl/docs/DOM/window.navigator.plugins /pl/docs/orphaned/Web/API/NavigatorPlugins/plugins +/pl/docs/DOM/window.navigator.product /pl/docs/orphaned/Web/API/NavigatorID/product /pl/docs/DOM/window.navigator.productSub /pl/docs/Web/API/Navigator/productSub /pl/docs/DOM/window.navigator.registerProtocolHandler /pl/docs/Web/API/Navigator/registerProtocolHandler /pl/docs/DOM/window.onload /pl/docs/Web/API/GlobalEventHandlers/onload @@ -735,19 +735,19 @@ /pl/docs/DOM:window.getSelection /pl/docs/Web/API/Window/getSelection /pl/docs/DOM:window.name /pl/docs/Web/API/Window/name /pl/docs/DOM:window.navigator /pl/docs/Web/API/Window/navigator -/pl/docs/DOM:window.navigator.appCodeName /pl/docs/Web/API/NavigatorID/appCodeName -/pl/docs/DOM:window.navigator.appName /pl/docs/Web/API/NavigatorID/appName -/pl/docs/DOM:window.navigator.appVersion /pl/docs/Web/API/NavigatorID/appVersion +/pl/docs/DOM:window.navigator.appCodeName /pl/docs/orphaned/Web/API/NavigatorID/appCodeName +/pl/docs/DOM:window.navigator.appName /pl/docs/orphaned/Web/API/NavigatorID/appName +/pl/docs/DOM:window.navigator.appVersion /pl/docs/orphaned/Web/API/NavigatorID/appVersion /pl/docs/DOM:window.navigator.buildID /pl/docs/Web/API/Navigator/buildID /pl/docs/DOM:window.navigator.cookieEnabled /pl/docs/Web/API/Navigator/cookieEnabled -/pl/docs/DOM:window.navigator.javaEnabled /pl/docs/Web/API/NavigatorPlugins/javaEnabled -/pl/docs/DOM:window.navigator.language /pl/docs/Web/API/NavigatorLanguage/language -/pl/docs/DOM:window.navigator.mimeTypes /pl/docs/Web/API/NavigatorPlugins/mimeTypes -/pl/docs/DOM:window.navigator.onLine /pl/docs/Web/API/NavigatorOnLine/onLine +/pl/docs/DOM:window.navigator.javaEnabled /pl/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/pl/docs/DOM:window.navigator.language /pl/docs/orphaned/Web/API/NavigatorLanguage/language +/pl/docs/DOM:window.navigator.mimeTypes /pl/docs/orphaned/Web/API/NavigatorPlugins/mimeTypes +/pl/docs/DOM:window.navigator.onLine /pl/docs/orphaned/Web/API/NavigatorOnLine/onLine /pl/docs/DOM:window.navigator.oscpu /pl/docs/Web/API/Navigator/oscpu -/pl/docs/DOM:window.navigator.platform /pl/docs/Web/API/NavigatorID/platform -/pl/docs/DOM:window.navigator.plugins /pl/docs/Web/API/NavigatorPlugins/plugins -/pl/docs/DOM:window.navigator.product /pl/docs/Web/API/NavigatorID/product +/pl/docs/DOM:window.navigator.platform /pl/docs/orphaned/Web/API/NavigatorID/platform +/pl/docs/DOM:window.navigator.plugins /pl/docs/orphaned/Web/API/NavigatorPlugins/plugins +/pl/docs/DOM:window.navigator.product /pl/docs/orphaned/Web/API/NavigatorID/product /pl/docs/DOM:window.navigator.productSub /pl/docs/Web/API/Navigator/productSub /pl/docs/DOM:window.navigator.registerProtocolHandler /pl/docs/Web/API/Navigator/registerProtocolHandler /pl/docs/DOM:window.onload /pl/docs/Web/API/GlobalEventHandlers/onload @@ -1619,17 +1619,31 @@ /pl/docs/Web/API/Event/view /pl/docs/Web/API/UIEvent/view /pl/docs/Web/API/HTMLOrForeignElement/blur /pl/docs/orphaned/Web/API/HTMLOrForeignElement/blur /pl/docs/Web/API/HTMLOrForeignElement/focus /pl/docs/orphaned/Web/API/HTMLOrForeignElement/focus -/pl/docs/Web/API/Navigator/appCodeName /pl/docs/Web/API/NavigatorID/appCodeName -/pl/docs/Web/API/Navigator/appName /pl/docs/Web/API/NavigatorID/appName -/pl/docs/Web/API/Navigator/appVersion /pl/docs/Web/API/NavigatorID/appVersion -/pl/docs/Web/API/Navigator/javaEnabled /pl/docs/Web/API/NavigatorPlugins/javaEnabled -/pl/docs/Web/API/Navigator/language /pl/docs/Web/API/NavigatorLanguage/language -/pl/docs/Web/API/Navigator/mimeTypes /pl/docs/Web/API/NavigatorPlugins/mimeTypes -/pl/docs/Web/API/Navigator/onLine /pl/docs/Web/API/NavigatorOnLine/onLine -/pl/docs/Web/API/Navigator/platform /pl/docs/Web/API/NavigatorID/platform -/pl/docs/Web/API/Navigator/plugins /pl/docs/Web/API/NavigatorPlugins/plugins -/pl/docs/Web/API/Navigator/product /pl/docs/Web/API/NavigatorID/product -/pl/docs/Web/API/NavigatorOnLine/Zdarzenia_online_i_offline /pl/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/pl/docs/Web/API/Navigator/appCodeName /pl/docs/orphaned/Web/API/NavigatorID/appCodeName +/pl/docs/Web/API/Navigator/appName /pl/docs/orphaned/Web/API/NavigatorID/appName +/pl/docs/Web/API/Navigator/appVersion /pl/docs/orphaned/Web/API/NavigatorID/appVersion +/pl/docs/Web/API/Navigator/javaEnabled /pl/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/pl/docs/Web/API/Navigator/language /pl/docs/orphaned/Web/API/NavigatorLanguage/language +/pl/docs/Web/API/Navigator/mimeTypes /pl/docs/orphaned/Web/API/NavigatorPlugins/mimeTypes +/pl/docs/Web/API/Navigator/onLine /pl/docs/orphaned/Web/API/NavigatorOnLine/onLine +/pl/docs/Web/API/Navigator/platform /pl/docs/orphaned/Web/API/NavigatorID/platform +/pl/docs/Web/API/Navigator/plugins /pl/docs/orphaned/Web/API/NavigatorPlugins/plugins +/pl/docs/Web/API/Navigator/product /pl/docs/orphaned/Web/API/NavigatorID/product +/pl/docs/Web/API/NavigatorID/appCodeName /pl/docs/orphaned/Web/API/NavigatorID/appCodeName +/pl/docs/Web/API/NavigatorID/appName /pl/docs/orphaned/Web/API/NavigatorID/appName +/pl/docs/Web/API/NavigatorID/appVersion /pl/docs/orphaned/Web/API/NavigatorID/appVersion +/pl/docs/Web/API/NavigatorID/platform /pl/docs/orphaned/Web/API/NavigatorID/platform +/pl/docs/Web/API/NavigatorID/product /pl/docs/orphaned/Web/API/NavigatorID/product +/pl/docs/Web/API/NavigatorLanguage /pl/docs/orphaned/Web/API/NavigatorLanguage +/pl/docs/Web/API/NavigatorLanguage/language /pl/docs/orphaned/Web/API/NavigatorLanguage/language +/pl/docs/Web/API/NavigatorOnLine /pl/docs/orphaned/Web/API/NavigatorOnLine +/pl/docs/Web/API/NavigatorOnLine/Online_and_offline_events /pl/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/pl/docs/Web/API/NavigatorOnLine/Zdarzenia_online_i_offline /pl/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/pl/docs/Web/API/NavigatorOnLine/onLine /pl/docs/orphaned/Web/API/NavigatorOnLine/onLine +/pl/docs/Web/API/NavigatorPlugins /pl/docs/orphaned/Web/API/NavigatorPlugins +/pl/docs/Web/API/NavigatorPlugins/javaEnabled /pl/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/pl/docs/Web/API/NavigatorPlugins/mimeTypes /pl/docs/orphaned/Web/API/NavigatorPlugins/mimeTypes +/pl/docs/Web/API/NavigatorPlugins/plugins /pl/docs/orphaned/Web/API/NavigatorPlugins/plugins /pl/docs/Web/API/Node/localName /pl/docs/Web/API/Element/localName /pl/docs/Web/API/Node/namespaceURI /pl/docs/Web/API/Element/namespaceURI /pl/docs/Web/API/Node/prefix /pl/docs/Web/API/Element/prefix @@ -2578,7 +2592,7 @@ /pl/docs/XSLT:when /pl/docs/Web/XSLT/Element/when /pl/docs/XSLT:with-param /pl/docs/Web/XSLT/Element/with-param /pl/docs/Zasoby_języka_JavaScript /pl/docs/Web/JavaScript/Language_Resources -/pl/docs/Zdarzenia_online_i_offline /pl/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/pl/docs/Zdarzenia_online_i_offline /pl/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /pl/docs/Zmiany_XMLHttpRequest_dla_Gecko_1.8 /pl/docs/Zmiany_w_obiekcie_XMLHttpRequest_w_Gecko_1.8 /pl/docs/appendChild /pl/docs/Web/API/Node/appendChild /pl/docs/blur /pl/docs/orphaned/Web/API/HTMLOrForeignElement/blur diff --git a/files/pl/_wikihistory.json b/files/pl/_wikihistory.json index b821a64d3f..9c4da3afc6 100644 --- a/files/pl/_wikihistory.json +++ b/files/pl/_wikihistory.json @@ -3185,131 +3185,6 @@ "Flaneur" ] }, - "Web/API/NavigatorID/appCodeName": { - "modified": "2019-03-23T23:49:13.430Z", - "contributors": [ - "teoli", - "xuancanh", - "Mgjbot", - "Diablownik", - "Ptak82" - ] - }, - "Web/API/NavigatorID/appName": { - "modified": "2019-03-23T23:49:12.926Z", - "contributors": [ - "teoli", - "jsx", - "Mgjbot", - "Diablownik" - ] - }, - "Web/API/NavigatorID/appVersion": { - "modified": "2019-03-23T23:49:23.089Z", - "contributors": [ - "teoli", - "jsx", - "Mgjbot", - "Diablownik", - "Internauta1024A" - ] - }, - "Web/API/NavigatorID/platform": { - "modified": "2019-03-23T23:49:28.729Z", - "contributors": [ - "teoli", - "AshfaqHossain", - "Mgjbot", - "Diablownik" - ] - }, - "Web/API/NavigatorID/product": { - "modified": "2019-03-23T23:49:35.115Z", - "contributors": [ - "teoli", - "khalid32", - "Mgjbot", - "Diablownik" - ] - }, - "Web/API/NavigatorLanguage": { - "modified": "2019-03-23T23:01:34.390Z", - "contributors": [ - "maniekbarty", - "teoli" - ] - }, - "Web/API/NavigatorLanguage/language": { - "modified": "2019-03-23T23:49:32.556Z", - "contributors": [ - "teoli", - "khalid32", - "Mgjbot", - "Diablownik", - "Ptak82" - ] - }, - "Web/API/NavigatorOnLine": { - "modified": "2019-03-23T23:01:33.822Z", - "contributors": [ - "teoli" - ] - }, - "Web/API/NavigatorOnLine/Online_and_offline_events": { - "modified": "2019-01-16T15:46:42.070Z", - "contributors": [ - "chrisdavidmills", - "Ptak82", - "Mgjbot", - "Flaneur" - ] - }, - "Web/API/NavigatorOnLine/onLine": { - "modified": "2019-03-23T23:48:52.481Z", - "contributors": [ - "teoli", - "khalid32", - "Mgjbot", - "Diablownik", - "Ptak82" - ] - }, - "Web/API/NavigatorPlugins": { - "modified": "2019-03-23T23:01:33.358Z", - "contributors": [ - "teoli" - ] - }, - "Web/API/NavigatorPlugins/javaEnabled": { - "modified": "2019-03-23T23:49:40.467Z", - "contributors": [ - "teoli", - "jsx", - "Mgjbot", - "Diablownik", - "Ptak82" - ] - }, - "Web/API/NavigatorPlugins/mimeTypes": { - "modified": "2019-03-23T23:49:33.278Z", - "contributors": [ - "teoli", - "khalid32", - "Mgjbot", - "Diablownik" - ] - }, - "Web/API/NavigatorPlugins/plugins": { - "modified": "2019-03-23T23:49:34.992Z", - "contributors": [ - "sheldarr", - "teoli", - "jsx", - "AshfaqHossain", - "Mgjbot", - "Diablownik" - ] - }, "Web/API/Node/appendChild": { "modified": "2019-03-24T00:09:45.110Z", "contributors": [ @@ -11152,6 +11027,131 @@ "Ptak82" ] }, + "orphaned/Web/API/NavigatorID/appCodeName": { + "modified": "2019-03-23T23:49:13.430Z", + "contributors": [ + "teoli", + "xuancanh", + "Mgjbot", + "Diablownik", + "Ptak82" + ] + }, + "orphaned/Web/API/NavigatorID/appName": { + "modified": "2019-03-23T23:49:12.926Z", + "contributors": [ + "teoli", + "jsx", + "Mgjbot", + "Diablownik" + ] + }, + "orphaned/Web/API/NavigatorID/appVersion": { + "modified": "2019-03-23T23:49:23.089Z", + "contributors": [ + "teoli", + "jsx", + "Mgjbot", + "Diablownik", + "Internauta1024A" + ] + }, + "orphaned/Web/API/NavigatorID/platform": { + "modified": "2019-03-23T23:49:28.729Z", + "contributors": [ + "teoli", + "AshfaqHossain", + "Mgjbot", + "Diablownik" + ] + }, + "orphaned/Web/API/NavigatorID/product": { + "modified": "2019-03-23T23:49:35.115Z", + "contributors": [ + "teoli", + "khalid32", + "Mgjbot", + "Diablownik" + ] + }, + "orphaned/Web/API/NavigatorLanguage": { + "modified": "2019-03-23T23:01:34.390Z", + "contributors": [ + "maniekbarty", + "teoli" + ] + }, + "orphaned/Web/API/NavigatorLanguage/language": { + "modified": "2019-03-23T23:49:32.556Z", + "contributors": [ + "teoli", + "khalid32", + "Mgjbot", + "Diablownik", + "Ptak82" + ] + }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2019-03-23T23:01:33.822Z", + "contributors": [ + "teoli" + ] + }, + "orphaned/Web/API/NavigatorOnLine/Online_and_offline_events": { + "modified": "2019-01-16T15:46:42.070Z", + "contributors": [ + "chrisdavidmills", + "Ptak82", + "Mgjbot", + "Flaneur" + ] + }, + "orphaned/Web/API/NavigatorOnLine/onLine": { + "modified": "2019-03-23T23:48:52.481Z", + "contributors": [ + "teoli", + "khalid32", + "Mgjbot", + "Diablownik", + "Ptak82" + ] + }, + "orphaned/Web/API/NavigatorPlugins": { + "modified": "2019-03-23T23:01:33.358Z", + "contributors": [ + "teoli" + ] + }, + "orphaned/Web/API/NavigatorPlugins/javaEnabled": { + "modified": "2019-03-23T23:49:40.467Z", + "contributors": [ + "teoli", + "jsx", + "Mgjbot", + "Diablownik", + "Ptak82" + ] + }, + "orphaned/Web/API/NavigatorPlugins/mimeTypes": { + "modified": "2019-03-23T23:49:33.278Z", + "contributors": [ + "teoli", + "khalid32", + "Mgjbot", + "Diablownik" + ] + }, + "orphaned/Web/API/NavigatorPlugins/plugins": { + "modified": "2019-03-23T23:49:34.992Z", + "contributors": [ + "sheldarr", + "teoli", + "jsx", + "AshfaqHossain", + "Mgjbot", + "Diablownik" + ] + }, "orphaned/Web/API/ParentNode": { "modified": "2020-10-15T22:19:13.921Z" }, diff --git a/files/pl/orphaned/web/api/navigatorid/appcodename/index.html b/files/pl/orphaned/web/api/navigatorid/appcodename/index.html new file mode 100644 index 0000000000..aaf7171551 --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorid/appcodename/index.html @@ -0,0 +1,31 @@ +--- +title: window.navigator.appCodeName +slug: orphaned/Web/API/NavigatorID/appCodeName +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorID/appCodeName +original_slug: Web/API/NavigatorID/appCodeName +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca wewnętrzną nazwę "kodową" aktualnej przeglądarki.

+

Składnia

+
codeName = window.navigator.appCodeName
+
+

Parametry

+ +

Przykład

+
dump(window.navigator.appCodeName);
+
+

Uwagi

+

Mozilla, Netscape 6 i IE5 używają wewnętrznej nazwy "Mozilla".

+

Specyfikacja

+

DOM Level 0. Nie jest częścią specyfikacji.

+
+  
+

{{ languages( { "en": "en/DOM/window.navigator.appCodeName", "ja": "ja/DOM/window.navigator.appCodeName" } ) }}

diff --git a/files/pl/orphaned/web/api/navigatorid/appname/index.html b/files/pl/orphaned/web/api/navigatorid/appname/index.html new file mode 100644 index 0000000000..76ddc93b0e --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorid/appname/index.html @@ -0,0 +1,30 @@ +--- +title: window.navigator.appName +slug: orphaned/Web/API/NavigatorID/appName +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorID/appName +original_slug: Web/API/NavigatorID/appName +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca oficjalną nazwę przeglądarki.

+

Składnia

+
appName = window.navigator.appName
+
+

Parametry

+ +

Przykład

+
dump(window.navigator.appName);
+// dla NS6 wypisuje w konsoli "Navigator"
+
+

Specyfikacja

+

DOM Level 0. Nie jest częścią specyfikacji.

+
+  
+

{{ languages( { "en": "en/DOM/window.navigator.appName", "ja": "ja/DOM/window.navigator.appName" } ) }}

diff --git a/files/pl/orphaned/web/api/navigatorid/appversion/index.html b/files/pl/orphaned/web/api/navigatorid/appversion/index.html new file mode 100644 index 0000000000..4b5aa6ca1b --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorid/appversion/index.html @@ -0,0 +1,33 @@ +--- +title: window.navigator.appVersion +slug: orphaned/Web/API/NavigatorID/appVersion +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorID/appVersion +original_slug: Web/API/NavigatorID/appVersion +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca wersję przeglądarki jako łańcuch znaków.

+

Składnia

+
ver = window.navigator.appVersion
+
+

Parametry

+ +

Przykład

+
if ( navigator.appVersion.charAt(0) == "5" ) {
+    // prawdopodobnie jest to piąta wersja przeglądarki
+ }
+
+

Uwagi

+

Własność window.navigator.userAgent również zawiera numer wersji przeglądarki (przykładowo: "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1"), lecz powinniśmy mieć świadomość jak łatwo jest zmienić ciąg user-agent i "naśladować" inne przeglądarki, platformy lub pośredników użytkownika oraz jak bezmyślni są sami producenci przeglądarek w ustawianiu tej wartości. Własności window.navigator.appVersion i window.navigator.userAgent są dość często stosowane w kodzie "szpiegującym przeglądarki": skryptach, które próbują dowiedzieć się jakiej używasz przeglądarki i wyświetlić stosowną do niej stronę.

+

Specyfikacja

+

DOM Level 0. Nie jest częścią specyfikacji.

+
+  
+

{{ languages( { "en": "en/DOM/window.navigator.appVersion", "ja": "ja/DOM/window.navigator.appVersion" } ) }}

diff --git a/files/pl/orphaned/web/api/navigatorid/platform/index.html b/files/pl/orphaned/web/api/navigatorid/platform/index.html new file mode 100644 index 0000000000..4704893247 --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorid/platform/index.html @@ -0,0 +1,29 @@ +--- +title: window.navigator.platform +slug: orphaned/Web/API/NavigatorID/platform +tags: + - DOM + - DOM_0 + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorID/platform +original_slug: Web/API/NavigatorID/platform +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca łańcuch znaków reprezentujący platformę przeglądarki.

+

Składnia

+
platform =navigator.platform
+
+

platform jest łańcuchem znaków z jedną z następujących wartości: "Win32", "Linux i686", "MacPPC", "MacIntel" lub inną.

+

Przykład

+
alert(navigator.platform);
+
+

Uwagi

+

Jeśli Twój kod nie jest uprzywilejowany (chrome lub przynajmniej kod z uprawnieniem UniversalBrowserRead), może on otrzymać wartość opcji <tt>general.platform.override</tt> zamiast prawdziwej platformy.

+

Specyfikacja

+

{{ DOM0() }}

+
+  
+

{{ languages( { "en": "en/DOM/window.navigator.platform", "ja": "ja/DOM/window.navigator.platform" } ) }}

diff --git a/files/pl/orphaned/web/api/navigatorid/product/index.html b/files/pl/orphaned/web/api/navigatorid/product/index.html new file mode 100644 index 0000000000..74a20f8a1e --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorid/product/index.html @@ -0,0 +1,39 @@ +--- +title: window.navigator.product +slug: orphaned/Web/API/NavigatorID/product +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorID/product +original_slug: Web/API/NavigatorID/product +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Własność ta zwraca nazwę produktu bieżącej przeglądarki.

+

Składnia

+
productName = window.navigator.product
+
+

Parametry

+ +

Przykład

+
<script>
+function prod() {
+  dt = document.getElementById("d");
+  dt.innerHTML = window.navigator.product;
+}
+</script>
+<button onclick="prod();">produkt</button>
+<div id="d"> </div>
+// zwraca "Gecko"
+
+

Uwagi

+

Produkt jest tą częścią pełnego łańcucha identyfikatora przeglądarki, która następuje bezpośrednio po platformie. Na przykład, w identyfikatorze przeglądarki dla Netscape 6.1 produktem jest "Gecko", a pełny ciąg identyfikatora przeglądarki jest następujący: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1

+

Specyfikacja

+

DOM Level 0. Nie jest częścią specyfikacji.

+
+  
+

{{ languages( { "en": "en/DOM/window.navigator.product", "ja": "ja/DOM/window.navigator.product" } ) }}

diff --git a/files/pl/orphaned/web/api/navigatorlanguage/index.html b/files/pl/orphaned/web/api/navigatorlanguage/index.html new file mode 100644 index 0000000000..fc736ce50b --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorlanguage/index.html @@ -0,0 +1,149 @@ +--- +title: NavigatorLanguage +slug: orphaned/Web/API/NavigatorLanguage +tags: + - API + - HTML-DOM + - NeedsTranslation + - No Interface + - Reference + - TopicStub +translation_of: Web/API/NavigatorLanguage +original_slug: Web/API/NavigatorLanguage +--- +

{{APIRef("HTML DOM")}}

+ +

NavigatorLanguage contains methods and properties related to the language of the navigator.

+ +

There is no object of type NavigatorLanguage, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorLanguage interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
+
Returns a {{domxref("DOMString")}} representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
+
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
+
Returns an array of {{domxref("DOMString")}} representing the languages known to the user, by order of preference.
+
+ +

Methods

+ +

The NavigatorLanguage interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Since the {{SpecName('HTML5 W3C')}} snapshot, the languages property has been added.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Initial specification; snapshot of  an early version{{SpecName('HTML WHATWG')}}.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages37{{CompatGeckoDesktop("32")}}{{CompatNo}}24{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages{{CompatUnknown}}{{CompatUnknown}} {{CompatGeckoMobile("32")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
+
+ +

See also

+ + diff --git a/files/pl/orphaned/web/api/navigatorlanguage/language/index.html b/files/pl/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..16876caa55 --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,46 @@ +--- +title: NavigatorLanguage.language +slug: orphaned/Web/API/NavigatorLanguage/language +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorLanguage/language +original_slug: Web/API/NavigatorLanguage/language +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Zwraca łańcuch znaków reprezentujący wersję językową przeglądarki.

+ +

Składnia

+ +
lang = window.navigator.language
+
+ +

Parametry

+ + + +

Przykład

+ +
if ( window.navigator.language != "pl" ) {
+ doLangSelect(window.navigator.language);
+}
+
+ +

Uwagi

+ +

Ta własność pojawia się również jako część łańcucha znaków navigator.userAgent.

+ +

Specyfikacja

+ +

DOM Level 0. Nie jest częścią specyfikacji.

+ +
 
+ +

{{ languages( { "en": "en/DOM/window.navigator.language", "ja": "ja/DOM/window.navigator.language" } ) }}

diff --git a/files/pl/orphaned/web/api/navigatoronline/index.html b/files/pl/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..cf50921490 --- /dev/null +++ b/files/pl/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,128 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +tags: + - API + - HTML-DOM + - NeedsTranslation + - TopicStub +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

+ +

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorOnLine interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
+
+ +

Methods

+ +

The NavigatorOnLine interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

See also

+ + diff --git a/files/pl/orphaned/web/api/navigatoronline/online/index.html b/files/pl/orphaned/web/api/navigatoronline/online/index.html new file mode 100644 index 0000000000..8e968df60f --- /dev/null +++ b/files/pl/orphaned/web/api/navigatoronline/online/index.html @@ -0,0 +1,48 @@ +--- +title: NavigatorOnLine.onLine +slug: orphaned/Web/API/NavigatorOnLine/onLine +tags: + - DOM + - DOM_0 + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorOnLine/onLine +original_slug: Web/API/NavigatorOnLine/onLine +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Zwraca wartość logiczną wskazującą czy przeglądarka jest w trybie online, czy nie.

+ +

Składnia

+ +
online =
+window.navigator.onLine;
+
+ + + +

Przykład

+ +
alert(navigator.onLine ? "Jesteś online" : "Jesteś offline");
+
+ +

Uwagi

+ +

Zobacz Zdarzenia Online/Offline‎, aby uzyskać bardziej szczegółowy opis tej własności, jak również nowych funkcji związanych z trybem offline, wprowadzonych w Firefoksie 3.

+ +

Specyfikacja

+ +

{{ DOM0() }}

+ +

Opisana w szkicu roboczym HTML 5

+ +

 

+ +
 
+ +

{{ languages( { "en": "en/DOM/window.navigator.onLine", "fr": "fr/DOM/window.navigator.onLine", "ja": "ja/DOM/window.navigator.onLine" } ) }}

diff --git a/files/pl/orphaned/web/api/navigatoronline/online_and_offline_events/index.html b/files/pl/orphaned/web/api/navigatoronline/online_and_offline_events/index.html new file mode 100644 index 0000000000..87671f5a2a --- /dev/null +++ b/files/pl/orphaned/web/api/navigatoronline/online_and_offline_events/index.html @@ -0,0 +1,85 @@ +--- +title: Zdarzenia online i offline +slug: orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +tags: + - AJAX + - DOM + - Programowanie_WWW + - Wszystkie_kategorie +translation_of: Web/API/NavigatorOnLine/Online_and_offline_events +original_slug: Web/API/NavigatorOnLine/Online_and_offline_events +--- +

W programie Firefox 3 zaimplementowano obsługę zdarzeń online i offline zdefiniowanych w specyfikacji WHATWG Web Applications 1.0. +

+

Omówienie

+

Do stworzenia dobrej aplikacji internetowej działającej w trybie offline konieczne jest istnienie sposobu na sprawdzenie, kiedy aplikacja faktycznie znajduje się w trybie offline. W niektórych przypadkach potrzebna jest także możliwość stwierdzenia, czy aplikacja powróciła do stanu „online”. W praktyce sprowadza się to do dwóch wymagań: +

+
  1. Konieczne jest stwierdzenie, kiedy użytkownik przełącza przeglądarkę w tryb online, aby można było przeprowadzić ponowną synchronizację z serwerem.
  2. Konieczne jest stwierdzenie, kiedy użytkownik przełącza przeglądarkę w tryb offline, aby można było odłożyć wysłanie żądania do serwera na później.
+

Zdarzenia online i offline pozwalają na uproszczenie powyższych procedur.

W aplikacji internetowej może także być konieczne wymuszenie przechowywania określonych dokumentów w pamięci podręcznej zasobów offline. W tym celu w kodzie sekcji HEAD należy wstawić znacznik LINK przedstawiony poniżej: +

+
<link rel="offline-resource" href="mój_zasób">
+
+

Przy przetwarzaniu kodu HTML przez program Firefox w wersji 3 lub nowszej dokumenty wymienione w znaczniku zostaną zapisane w specjalnej pamięci podręcznej zasobów offline. +

+

Interfejs API

+ +

navigator.onLine to własność, która zwraca wartość true lub false (true dla trybu online, false dla trybu offline). Własność ta jest aktualizowana za każdym razem, gdy użytkownik przełącza przeglądarkę w tryb offline, wybierając odpowiednie polecenie menu (w programie Firefox: Plik -> Pracuj w trybie offline). +

Ponadto ta własność powinna być aktualizowana zawsze, gdy w przeglądarce nie można nawiązać połączenia z siecią. Zgodnie ze specyfikacją: +

+
+Atrybut navigator.onLine musi zwracać wartość false, jeżeli w programie po kliknięciu odsyłacza przez użytkownika lub po wysłaniu przez skrypt żądania do zdalnej witryny nie można połączyć się z siecią (lub wiadomo, że taka próba nie powiedzie się)... +
+

W programie Firefox 2 ta własność jest aktualizowana przy przełączaniu przeglądarki między trybami online i offline oraz przy utracie lub ponownym nawiązaniu połączenia z siecią (dotyczy systemów Windows i Linux). +

Własność istnieje w starszych wersjach przeglądarek Firefox i Internet Explorer (obecna specyfikacja została oparta na tych właśnie wcześniejszych implementacjach), można zatem korzystać z niej już teraz. Automatyczne wykrywanie stanu połączenia sieciowego zostało wprowadzone w programie Firefox 2.

+

Zdarzenia "online" i "offline"

+

W programie Firefox 3 wprowadzono dwa nowe zdarzenia: "online" i "offline". Są one wywoływane w elemencie <body> każdej otwartej strony, gdy przeglądarka jest przełączana między trybem online i offline. Ponadto zdarzenie bąbelkuje od elementu document.body, poprzez element document, aż do elementu window. Żadnego ze zdarzeń nie można anulować (niemożliwe jest zablokowanie możliwości przełączania przeglądarki między trybami online i offline). +

Obserwatory (ang. event listeners) tych zdarzeń można zarejestrować na kilka sposobów: +

+ +

Przykład

+

Dostępny jest prosty przykład zastosowania, który pozwala na sprawdzenie działania zdarzeń. +XXX When mochitests for this are created, point to those instead and update this example -nickolay +

+
 <!doctype html>
+ <html>
+ <head>
+   <script>
+     function updateOnlineStatus(msg) {
+       var status = document.getElementById("status");
+       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
+       status.setAttribute("class", condition);
+       var state = document.getElementById("state");
+       state.innerHTML = condition;
+       var log = document.getElementById("log");
+       log.appendChild(document.createTextNode("Zdarzenie: " + msg + "; stan=" + condition + "\n"));
+     }
+     function loaded() {
+       updateOnlineStatus("load");
+       document.body.addEventListener("offline", function () {
+         updateOnlineStatus("offline")
+       }, false);
+       document.body.addEventListener("online", function () {
+         updateOnlineStatus("online")
+       }, false);
+     }
+   </script>
+   <style>...</style>
+ </head>
+ <body onload="loaded()">
+   <div id="status"><p id="state"></p></div>
+   <div id="log"></div>
+ </body>
+ </html>
+
+

Odsyłacze

+ +
+
+{{ languages( { "en": "en/Online_and_offline_events", "es": "es/Eventos_online_y_offline", "fr": "fr/\u00c9v\u00e8nements_online_et_offline", "ja": "ja/Online_and_offline_events", "pt": "pt/Eventos_online_e_offline" } ) }} diff --git a/files/pl/orphaned/web/api/navigatorplugins/index.html b/files/pl/orphaned/web/api/navigatorplugins/index.html new file mode 100644 index 0000000000..37de32245a --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorplugins/index.html @@ -0,0 +1,112 @@ +--- +title: NavigatorPlugins +slug: orphaned/Web/API/NavigatorPlugins +tags: + - API + - Experimental + - HTML-DOM + - NeedsTranslation + - TopicStub +translation_of: Web/API/NavigatorPlugins +original_slug: Web/API/NavigatorPlugins +--- +

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

+ +

The NavigatorPlugins interface contains methods and properties related to the plugins installed in the browser.

+ +

There is no object of type NavigatorPlugins, but other interfaces, like {{domxref("Navigator")}}, implement it.

+ +

Properties

+ +
+
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
+
Returns an {{domxref("MimeTypeArray")}} listing the MIME types supported by the browser.
+
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
+
Returns a {{domxref("PluginArray")}} listing the plugins installed in the browser.
+
+ +

Methods

+ +

The NavigatorPlugins interface doesn't inherit any method.

+ +
+
{{domxref("NavigatorPlugins.javaEnabled")}} {{readonlyInline}}{{experimental_inline}}
+
Returns a {{domxref("Boolean")}} flag indicating whether the host browser is Java-enabled or not.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

See also

+ + diff --git a/files/pl/orphaned/web/api/navigatorplugins/javaenabled/index.html b/files/pl/orphaned/web/api/navigatorplugins/javaenabled/index.html new file mode 100644 index 0000000000..30f88964de --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorplugins/javaenabled/index.html @@ -0,0 +1,40 @@ +--- +title: NavigatorPlugins.javaEnabled +slug: orphaned/Web/API/NavigatorPlugins/javaEnabled +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorPlugins/javaEnabled +original_slug: Web/API/NavigatorPlugins/javaEnabled +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Ta metoda wskazuje czy w aktualnej przeglądarce została włączona obsługa Javy.

+ +

Składnia

+ +
result = window.navigator.javaEnabled()
+
+ +

Przykład

+ +
if (window.navigator.javaEnabled()) {
+   // przeglądarka posiada Javę
+}
+
+ +

Uwagi

+ +

Zwracana przez tę metodę wartość wskazuje czy Java jest włączona czy też nie - a nie czy przeglądarka w ogóle obsługuje Javę.

+ +

Specyfikacja

+ +

DOM Level 0. Nie jest częścią specyfikacji.

+ +
 
+ +

{{ languages( { "en": "en/DOM/window.navigator.javaEnabled", "ja": "ja/DOM/window.navigator.javaEnabled" } ) }}

diff --git a/files/pl/orphaned/web/api/navigatorplugins/mimetypes/index.html b/files/pl/orphaned/web/api/navigatorplugins/mimetypes/index.html new file mode 100644 index 0000000000..22b82363b7 --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorplugins/mimetypes/index.html @@ -0,0 +1,41 @@ +--- +title: NavigatorPlugins.mimeTypes +slug: orphaned/Web/API/NavigatorPlugins/mimeTypes +tags: + - DOM + - DOM_0 + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorPlugins/mimeTypes +original_slug: Web/API/NavigatorPlugins/mimeTypes +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Zwraca obiekt MimeTypeArray, który zawiera listę obiektów MimeType reprezentujących typy MIME rozpoznawane przez przeglądarkę.

+ +

Składnia

+ +
mimeTypes = navigator.mimeTypes;
+
+ +

mimeTypes jest obiektem MimeTypeArray, który posiada zarówno własność length jak i metody item(index) oraz namedItem(name).

+ +

Przykład

+ +
  alert(window.navigator.mimeTypes.item(0).description); // wyświetli ostrzeżenie "Mozilla Default Plug-in"
+
+ +

Uwagi

+ +

Wartością własności type w zerowym elemencie (obiekt MimeType "Mozilla Default Plug-in") jest * zamiast typowego formatu MIME jak np. "image/x-macpaint"

+ +

Specyfikacja

+ +

{{ DOM0() }}

+ +
 
+ +

{{ languages( { "en": "en/DOM/window.navigator.mimeTypes", "ja": "ja/DOM/window.navigator.mimeTypes" } ) }}

diff --git a/files/pl/orphaned/web/api/navigatorplugins/plugins/index.html b/files/pl/orphaned/web/api/navigatorplugins/plugins/index.html new file mode 100644 index 0000000000..e71708a0b1 --- /dev/null +++ b/files/pl/orphaned/web/api/navigatorplugins/plugins/index.html @@ -0,0 +1,59 @@ +--- +title: NavigatorPlugins.plugins +slug: orphaned/Web/API/NavigatorPlugins/plugins +tags: + - DOM + - DOM_0 + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/NavigatorPlugins/plugins +original_slug: Web/API/NavigatorPlugins/plugins +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Zwraca obiekt PluginArray będący listą wszystkich wtyczek zainstalowanych w aplikacji.

+ +

Składnia

+ +
plugins = navigator.plugins;
+
+ +

plugins jest tabelą PluginArray zawierającą obiekty Plugin reprezentujące zainstalowane wtyczki.

+ +

Zwrócona wartość nie jest jest tablicą JavaScript, ale posiada własność length i obsługuje dostęp do poszczególnych elementów za pomocą notacji nawiasowej (plugins{{ mediawiki.external(2) }}) jak również poprzez metody item(index ) i namedItem("name" ).

+ +

Przykład

+ +

Poniższy przykład wyświetla wewnątrz zaawansowanego dokumentu informacje o zainstalowanych wtyczkach. Zauważ własności dostępne w obiekcie Plugin: name, filename i description.

+ +
<script type="text/javascript">
+   var L = navigator.plugins.length;
+   document.write(L.toString().bold() + " Plugin(s)".bold());
+   document.write("<br>");
+   document.write("Nazwa wtyczki | Nazwa pliku | Opis".bold());
+   document.write("<br>");
+   for(var i=0; i<L; i++) {
+     document.write(navigator.plugins[i].name);
+     document.write(" | ");
+     document.write(navigator.plugins[i].filename);
+     document.write(" | ");
+     document.write(navigator.plugins[i].description);
+     document.write("<br>");
+   }
+</script>
+
+ +

Uwagi

+ +

Obiekt Plugin wyświetla skromny interfejs w celu uzyskania informacji o różnych wtyczkach zainstalowanych w przeglądarce. Lista wtyczek jest również dostępna poprzez wprowadzenie about:plugins w pasku adresu.

+ +

Specyfikacja

+ +

{{ DOM0() }}

+ +
 
+ +

{{ languages( { "en": "en/DOM/window.navigator.plugins", "ja": "ja/DOM/window.navigator.plugins" } ) }}

diff --git a/files/pl/web/api/navigatorid/appcodename/index.html b/files/pl/web/api/navigatorid/appcodename/index.html deleted file mode 100644 index 36b6cdcb2c..0000000000 --- a/files/pl/web/api/navigatorid/appcodename/index.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: window.navigator.appCodeName -slug: Web/API/NavigatorID/appCodeName -tags: - - DOM - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorID/appCodeName -original_slug: Web/API/Navigator/appCodeName ---- -

{{ ApiRef() }}

-

Podsumowanie

-

Zwraca wewnętrzną nazwę "kodową" aktualnej przeglądarki.

-

Składnia

-
codeName = window.navigator.appCodeName
-
-

Parametry

- -

Przykład

-
dump(window.navigator.appCodeName);
-
-

Uwagi

-

Mozilla, Netscape 6 i IE5 używają wewnętrznej nazwy "Mozilla".

-

Specyfikacja

-

DOM Level 0. Nie jest częścią specyfikacji.

-
-  
-

{{ languages( { "en": "en/DOM/window.navigator.appCodeName", "ja": "ja/DOM/window.navigator.appCodeName" } ) }}

diff --git a/files/pl/web/api/navigatorid/appname/index.html b/files/pl/web/api/navigatorid/appname/index.html deleted file mode 100644 index cede259301..0000000000 --- a/files/pl/web/api/navigatorid/appname/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: window.navigator.appName -slug: Web/API/NavigatorID/appName -tags: - - DOM - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorID/appName -original_slug: Web/API/Navigator/appName ---- -

{{ ApiRef() }}

-

Podsumowanie

-

Zwraca oficjalną nazwę przeglądarki.

-

Składnia

-
appName = window.navigator.appName
-
-

Parametry

- -

Przykład

-
dump(window.navigator.appName);
-// dla NS6 wypisuje w konsoli "Navigator"
-
-

Specyfikacja

-

DOM Level 0. Nie jest częścią specyfikacji.

-
-  
-

{{ languages( { "en": "en/DOM/window.navigator.appName", "ja": "ja/DOM/window.navigator.appName" } ) }}

diff --git a/files/pl/web/api/navigatorid/appversion/index.html b/files/pl/web/api/navigatorid/appversion/index.html deleted file mode 100644 index b3146b68b6..0000000000 --- a/files/pl/web/api/navigatorid/appversion/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: window.navigator.appVersion -slug: Web/API/NavigatorID/appVersion -tags: - - DOM - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorID/appVersion -original_slug: Web/API/Navigator/appVersion ---- -

{{ ApiRef() }}

-

Podsumowanie

-

Zwraca wersję przeglądarki jako łańcuch znaków.

-

Składnia

-
ver = window.navigator.appVersion
-
-

Parametry

- -

Przykład

-
if ( navigator.appVersion.charAt(0) == "5" ) {
-    // prawdopodobnie jest to piąta wersja przeglądarki
- }
-
-

Uwagi

-

Własność window.navigator.userAgent również zawiera numer wersji przeglądarki (przykładowo: "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1"), lecz powinniśmy mieć świadomość jak łatwo jest zmienić ciąg user-agent i "naśladować" inne przeglądarki, platformy lub pośredników użytkownika oraz jak bezmyślni są sami producenci przeglądarek w ustawianiu tej wartości. Własności window.navigator.appVersion i window.navigator.userAgent są dość często stosowane w kodzie "szpiegującym przeglądarki": skryptach, które próbują dowiedzieć się jakiej używasz przeglądarki i wyświetlić stosowną do niej stronę.

-

Specyfikacja

-

DOM Level 0. Nie jest częścią specyfikacji.

-
-  
-

{{ languages( { "en": "en/DOM/window.navigator.appVersion", "ja": "ja/DOM/window.navigator.appVersion" } ) }}

diff --git a/files/pl/web/api/navigatorid/platform/index.html b/files/pl/web/api/navigatorid/platform/index.html deleted file mode 100644 index 3e15e51020..0000000000 --- a/files/pl/web/api/navigatorid/platform/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: window.navigator.platform -slug: Web/API/NavigatorID/platform -tags: - - DOM - - DOM_0 - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorID/platform -original_slug: Web/API/Navigator/platform ---- -

{{ ApiRef() }}

-

Podsumowanie

-

Zwraca łańcuch znaków reprezentujący platformę przeglądarki.

-

Składnia

-
platform =navigator.platform
-
-

platform jest łańcuchem znaków z jedną z następujących wartości: "Win32", "Linux i686", "MacPPC", "MacIntel" lub inną.

-

Przykład

-
alert(navigator.platform);
-
-

Uwagi

-

Jeśli Twój kod nie jest uprzywilejowany (chrome lub przynajmniej kod z uprawnieniem UniversalBrowserRead), może on otrzymać wartość opcji <tt>general.platform.override</tt> zamiast prawdziwej platformy.

-

Specyfikacja

-

{{ DOM0() }}

-
-  
-

{{ languages( { "en": "en/DOM/window.navigator.platform", "ja": "ja/DOM/window.navigator.platform" } ) }}

diff --git a/files/pl/web/api/navigatorid/product/index.html b/files/pl/web/api/navigatorid/product/index.html deleted file mode 100644 index 8dbd83400e..0000000000 --- a/files/pl/web/api/navigatorid/product/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: window.navigator.product -slug: Web/API/NavigatorID/product -tags: - - DOM - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorID/product -original_slug: Web/API/Navigator/product ---- -

{{ ApiRef() }}

-

Podsumowanie

-

Własność ta zwraca nazwę produktu bieżącej przeglądarki.

-

Składnia

-
productName = window.navigator.product
-
-

Parametry

- -

Przykład

-
<script>
-function prod() {
-  dt = document.getElementById("d");
-  dt.innerHTML = window.navigator.product;
-}
-</script>
-<button onclick="prod();">produkt</button>
-<div id="d"> </div>
-// zwraca "Gecko"
-
-

Uwagi

-

Produkt jest tą częścią pełnego łańcucha identyfikatora przeglądarki, która następuje bezpośrednio po platformie. Na przykład, w identyfikatorze przeglądarki dla Netscape 6.1 produktem jest "Gecko", a pełny ciąg identyfikatora przeglądarki jest następujący: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1

-

Specyfikacja

-

DOM Level 0. Nie jest częścią specyfikacji.

-
-  
-

{{ languages( { "en": "en/DOM/window.navigator.product", "ja": "ja/DOM/window.navigator.product" } ) }}

diff --git a/files/pl/web/api/navigatorlanguage/index.html b/files/pl/web/api/navigatorlanguage/index.html deleted file mode 100644 index 7d6b0751e7..0000000000 --- a/files/pl/web/api/navigatorlanguage/index.html +++ /dev/null @@ -1,148 +0,0 @@ ---- -title: NavigatorLanguage -slug: Web/API/NavigatorLanguage -tags: - - API - - HTML-DOM - - NeedsTranslation - - No Interface - - Reference - - TopicStub -translation_of: Web/API/NavigatorLanguage ---- -

{{APIRef("HTML DOM")}}

- -

NavigatorLanguage contains methods and properties related to the language of the navigator.

- -

There is no object of type NavigatorLanguage, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorLanguage interface doesn't inherit any property.

- -
-
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
-
Returns a {{domxref("DOMString")}} representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
-
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
-
Returns an array of {{domxref("DOMString")}} representing the languages known to the user, by order of preference.
-
- -

Methods

- -

The NavigatorLanguage interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Since the {{SpecName('HTML5 W3C')}} snapshot, the languages property has been added.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Initial specification; snapshot of  an early version{{SpecName('HTML WHATWG')}}.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages37{{CompatGeckoDesktop("32")}}{{CompatNo}}24{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages{{CompatUnknown}}{{CompatUnknown}} {{CompatGeckoMobile("32")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
-
- -

See also

- - diff --git a/files/pl/web/api/navigatorlanguage/language/index.html b/files/pl/web/api/navigatorlanguage/language/index.html deleted file mode 100644 index 6146d09ce2..0000000000 --- a/files/pl/web/api/navigatorlanguage/language/index.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: NavigatorLanguage.language -slug: Web/API/NavigatorLanguage/language -tags: - - DOM - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorLanguage/language -original_slug: Web/API/Navigator/language ---- -

{{ ApiRef() }}

- -

Podsumowanie

- -

Zwraca łańcuch znaków reprezentujący wersję językową przeglądarki.

- -

Składnia

- -
lang = window.navigator.language
-
- -

Parametry

- - - -

Przykład

- -
if ( window.navigator.language != "pl" ) {
- doLangSelect(window.navigator.language);
-}
-
- -

Uwagi

- -

Ta własność pojawia się również jako część łańcucha znaków navigator.userAgent.

- -

Specyfikacja

- -

DOM Level 0. Nie jest częścią specyfikacji.

- -
 
- -

{{ languages( { "en": "en/DOM/window.navigator.language", "ja": "ja/DOM/window.navigator.language" } ) }}

diff --git a/files/pl/web/api/navigatoronline/index.html b/files/pl/web/api/navigatoronline/index.html deleted file mode 100644 index 11f6707c43..0000000000 --- a/files/pl/web/api/navigatoronline/index.html +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -tags: - - API - - HTML-DOM - - NeedsTranslation - - TopicStub -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

- -

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorOnLine interface doesn't inherit any property.

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
-
- -

Methods

- -

The NavigatorOnLine interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

See also

- - diff --git a/files/pl/web/api/navigatoronline/online/index.html b/files/pl/web/api/navigatoronline/online/index.html deleted file mode 100644 index 7884fc4764..0000000000 --- a/files/pl/web/api/navigatoronline/online/index.html +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: NavigatorOnLine.onLine -slug: Web/API/NavigatorOnLine/onLine -tags: - - DOM - - DOM_0 - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorOnLine/onLine -original_slug: Web/API/Navigator/onLine ---- -

{{ ApiRef() }}

- -

Podsumowanie

- -

Zwraca wartość logiczną wskazującą czy przeglądarka jest w trybie online, czy nie.

- -

Składnia

- -
online =
-window.navigator.onLine;
-
- - - -

Przykład

- -
alert(navigator.onLine ? "Jesteś online" : "Jesteś offline");
-
- -

Uwagi

- -

Zobacz Zdarzenia Online/Offline‎, aby uzyskać bardziej szczegółowy opis tej własności, jak również nowych funkcji związanych z trybem offline, wprowadzonych w Firefoksie 3.

- -

Specyfikacja

- -

{{ DOM0() }}

- -

Opisana w szkicu roboczym HTML 5

- -

 

- -
 
- -

{{ languages( { "en": "en/DOM/window.navigator.onLine", "fr": "fr/DOM/window.navigator.onLine", "ja": "ja/DOM/window.navigator.onLine" } ) }}

diff --git a/files/pl/web/api/navigatoronline/online_and_offline_events/index.html b/files/pl/web/api/navigatoronline/online_and_offline_events/index.html deleted file mode 100644 index f2293654e8..0000000000 --- a/files/pl/web/api/navigatoronline/online_and_offline_events/index.html +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Zdarzenia online i offline -slug: Web/API/NavigatorOnLine/Online_and_offline_events -tags: - - AJAX - - DOM - - Programowanie_WWW - - Wszystkie_kategorie -translation_of: Web/API/NavigatorOnLine/Online_and_offline_events -original_slug: Web/API/NavigatorOnLine/Zdarzenia_online_i_offline ---- -

W programie Firefox 3 zaimplementowano obsługę zdarzeń online i offline zdefiniowanych w specyfikacji WHATWG Web Applications 1.0. -

-

Omówienie

-

Do stworzenia dobrej aplikacji internetowej działającej w trybie offline konieczne jest istnienie sposobu na sprawdzenie, kiedy aplikacja faktycznie znajduje się w trybie offline. W niektórych przypadkach potrzebna jest także możliwość stwierdzenia, czy aplikacja powróciła do stanu „online”. W praktyce sprowadza się to do dwóch wymagań: -

-
  1. Konieczne jest stwierdzenie, kiedy użytkownik przełącza przeglądarkę w tryb online, aby można było przeprowadzić ponowną synchronizację z serwerem.
  2. Konieczne jest stwierdzenie, kiedy użytkownik przełącza przeglądarkę w tryb offline, aby można było odłożyć wysłanie żądania do serwera na później.
-

Zdarzenia online i offline pozwalają na uproszczenie powyższych procedur.

W aplikacji internetowej może także być konieczne wymuszenie przechowywania określonych dokumentów w pamięci podręcznej zasobów offline. W tym celu w kodzie sekcji HEAD należy wstawić znacznik LINK przedstawiony poniżej: -

-
<link rel="offline-resource" href="mój_zasób">
-
-

Przy przetwarzaniu kodu HTML przez program Firefox w wersji 3 lub nowszej dokumenty wymienione w znaczniku zostaną zapisane w specjalnej pamięci podręcznej zasobów offline. -

-

Interfejs API

- -

navigator.onLine to własność, która zwraca wartość true lub false (true dla trybu online, false dla trybu offline). Własność ta jest aktualizowana za każdym razem, gdy użytkownik przełącza przeglądarkę w tryb offline, wybierając odpowiednie polecenie menu (w programie Firefox: Plik -> Pracuj w trybie offline). -

Ponadto ta własność powinna być aktualizowana zawsze, gdy w przeglądarce nie można nawiązać połączenia z siecią. Zgodnie ze specyfikacją: -

-
-Atrybut navigator.onLine musi zwracać wartość false, jeżeli w programie po kliknięciu odsyłacza przez użytkownika lub po wysłaniu przez skrypt żądania do zdalnej witryny nie można połączyć się z siecią (lub wiadomo, że taka próba nie powiedzie się)... -
-

W programie Firefox 2 ta własność jest aktualizowana przy przełączaniu przeglądarki między trybami online i offline oraz przy utracie lub ponownym nawiązaniu połączenia z siecią (dotyczy systemów Windows i Linux). -

Własność istnieje w starszych wersjach przeglądarek Firefox i Internet Explorer (obecna specyfikacja została oparta na tych właśnie wcześniejszych implementacjach), można zatem korzystać z niej już teraz. Automatyczne wykrywanie stanu połączenia sieciowego zostało wprowadzone w programie Firefox 2.

-

Zdarzenia "online" i "offline"

-

W programie Firefox 3 wprowadzono dwa nowe zdarzenia: "online" i "offline". Są one wywoływane w elemencie <body> każdej otwartej strony, gdy przeglądarka jest przełączana między trybem online i offline. Ponadto zdarzenie bąbelkuje od elementu document.body, poprzez element document, aż do elementu window. Żadnego ze zdarzeń nie można anulować (niemożliwe jest zablokowanie możliwości przełączania przeglądarki między trybami online i offline). -

Obserwatory (ang. event listeners) tych zdarzeń można zarejestrować na kilka sposobów: -

- -

Przykład

-

Dostępny jest prosty przykład zastosowania, który pozwala na sprawdzenie działania zdarzeń. -XXX When mochitests for this are created, point to those instead and update this example -nickolay -

-
 <!doctype html>
- <html>
- <head>
-   <script>
-     function updateOnlineStatus(msg) {
-       var status = document.getElementById("status");
-       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
-       status.setAttribute("class", condition);
-       var state = document.getElementById("state");
-       state.innerHTML = condition;
-       var log = document.getElementById("log");
-       log.appendChild(document.createTextNode("Zdarzenie: " + msg + "; stan=" + condition + "\n"));
-     }
-     function loaded() {
-       updateOnlineStatus("load");
-       document.body.addEventListener("offline", function () {
-         updateOnlineStatus("offline")
-       }, false);
-       document.body.addEventListener("online", function () {
-         updateOnlineStatus("online")
-       }, false);
-     }
-   </script>
-   <style>...</style>
- </head>
- <body onload="loaded()">
-   <div id="status"><p id="state"></p></div>
-   <div id="log"></div>
- </body>
- </html>
-
-

Odsyłacze

- -
-
-{{ languages( { "en": "en/Online_and_offline_events", "es": "es/Eventos_online_y_offline", "fr": "fr/\u00c9v\u00e8nements_online_et_offline", "ja": "ja/Online_and_offline_events", "pt": "pt/Eventos_online_e_offline" } ) }} diff --git a/files/pl/web/api/navigatorplugins/index.html b/files/pl/web/api/navigatorplugins/index.html deleted file mode 100644 index c009a19a07..0000000000 --- a/files/pl/web/api/navigatorplugins/index.html +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: NavigatorPlugins -slug: Web/API/NavigatorPlugins -tags: - - API - - Experimental - - HTML-DOM - - NeedsTranslation - - TopicStub -translation_of: Web/API/NavigatorPlugins ---- -

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

- -

The NavigatorPlugins interface contains methods and properties related to the plugins installed in the browser.

- -

There is no object of type NavigatorPlugins, but other interfaces, like {{domxref("Navigator")}}, implement it.

- -

Properties

- -
-
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
-
Returns an {{domxref("MimeTypeArray")}} listing the MIME types supported by the browser.
-
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
-
Returns a {{domxref("PluginArray")}} listing the plugins installed in the browser.
-
- -

Methods

- -

The NavigatorPlugins interface doesn't inherit any method.

- -
-
{{domxref("NavigatorPlugins.javaEnabled")}} {{readonlyInline}}{{experimental_inline}}
-
Returns a {{domxref("Boolean")}} flag indicating whether the host browser is Java-enabled or not.
-
- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

See also

- - diff --git a/files/pl/web/api/navigatorplugins/javaenabled/index.html b/files/pl/web/api/navigatorplugins/javaenabled/index.html deleted file mode 100644 index b4cae7a1b5..0000000000 --- a/files/pl/web/api/navigatorplugins/javaenabled/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: NavigatorPlugins.javaEnabled -slug: Web/API/NavigatorPlugins/javaEnabled -tags: - - DOM - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorPlugins/javaEnabled -original_slug: Web/API/Navigator/javaEnabled ---- -

{{ ApiRef() }}

- -

Podsumowanie

- -

Ta metoda wskazuje czy w aktualnej przeglądarce została włączona obsługa Javy.

- -

Składnia

- -
result = window.navigator.javaEnabled()
-
- -

Przykład

- -
if (window.navigator.javaEnabled()) {
-   // przeglądarka posiada Javę
-}
-
- -

Uwagi

- -

Zwracana przez tę metodę wartość wskazuje czy Java jest włączona czy też nie - a nie czy przeglądarka w ogóle obsługuje Javę.

- -

Specyfikacja

- -

DOM Level 0. Nie jest częścią specyfikacji.

- -
 
- -

{{ languages( { "en": "en/DOM/window.navigator.javaEnabled", "ja": "ja/DOM/window.navigator.javaEnabled" } ) }}

diff --git a/files/pl/web/api/navigatorplugins/mimetypes/index.html b/files/pl/web/api/navigatorplugins/mimetypes/index.html deleted file mode 100644 index 0ad81a61c5..0000000000 --- a/files/pl/web/api/navigatorplugins/mimetypes/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: NavigatorPlugins.mimeTypes -slug: Web/API/NavigatorPlugins/mimeTypes -tags: - - DOM - - DOM_0 - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorPlugins/mimeTypes -original_slug: Web/API/Navigator/mimeTypes ---- -

{{ ApiRef() }}

- -

Podsumowanie

- -

Zwraca obiekt MimeTypeArray, który zawiera listę obiektów MimeType reprezentujących typy MIME rozpoznawane przez przeglądarkę.

- -

Składnia

- -
mimeTypes = navigator.mimeTypes;
-
- -

mimeTypes jest obiektem MimeTypeArray, który posiada zarówno własność length jak i metody item(index) oraz namedItem(name).

- -

Przykład

- -
  alert(window.navigator.mimeTypes.item(0).description); // wyświetli ostrzeżenie "Mozilla Default Plug-in"
-
- -

Uwagi

- -

Wartością własności type w zerowym elemencie (obiekt MimeType "Mozilla Default Plug-in") jest * zamiast typowego formatu MIME jak np. "image/x-macpaint"

- -

Specyfikacja

- -

{{ DOM0() }}

- -
 
- -

{{ languages( { "en": "en/DOM/window.navigator.mimeTypes", "ja": "ja/DOM/window.navigator.mimeTypes" } ) }}

diff --git a/files/pl/web/api/navigatorplugins/plugins/index.html b/files/pl/web/api/navigatorplugins/plugins/index.html deleted file mode 100644 index bb0a730981..0000000000 --- a/files/pl/web/api/navigatorplugins/plugins/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: NavigatorPlugins.plugins -slug: Web/API/NavigatorPlugins/plugins -tags: - - DOM - - DOM_0 - - Dokumentacja_Gecko_DOM - - Gecko - - Wszystkie_kategorie -translation_of: Web/API/NavigatorPlugins/plugins -original_slug: Web/API/Navigator/plugins ---- -

{{ ApiRef() }}

- -

Podsumowanie

- -

Zwraca obiekt PluginArray będący listą wszystkich wtyczek zainstalowanych w aplikacji.

- -

Składnia

- -
plugins = navigator.plugins;
-
- -

plugins jest tabelą PluginArray zawierającą obiekty Plugin reprezentujące zainstalowane wtyczki.

- -

Zwrócona wartość nie jest jest tablicą JavaScript, ale posiada własność length i obsługuje dostęp do poszczególnych elementów za pomocą notacji nawiasowej (plugins{{ mediawiki.external(2) }}) jak również poprzez metody item(index ) i namedItem("name" ).

- -

Przykład

- -

Poniższy przykład wyświetla wewnątrz zaawansowanego dokumentu informacje o zainstalowanych wtyczkach. Zauważ własności dostępne w obiekcie Plugin: name, filename i description.

- -
<script type="text/javascript">
-   var L = navigator.plugins.length;
-   document.write(L.toString().bold() + " Plugin(s)".bold());
-   document.write("<br>");
-   document.write("Nazwa wtyczki | Nazwa pliku | Opis".bold());
-   document.write("<br>");
-   for(var i=0; i<L; i++) {
-     document.write(navigator.plugins[i].name);
-     document.write(" | ");
-     document.write(navigator.plugins[i].filename);
-     document.write(" | ");
-     document.write(navigator.plugins[i].description);
-     document.write("<br>");
-   }
-</script>
-
- -

Uwagi

- -

Obiekt Plugin wyświetla skromny interfejs w celu uzyskania informacji o różnych wtyczkach zainstalowanych w przeglądarce. Lista wtyczek jest również dostępna poprzez wprowadzenie about:plugins w pasku adresu.

- -

Specyfikacja

- -

{{ DOM0() }}

- -
 
- -

{{ languages( { "en": "en/DOM/window.navigator.plugins", "ja": "ja/DOM/window.navigator.plugins" } ) }}

diff --git a/files/pt-br/_redirects.txt b/files/pt-br/_redirects.txt index 4e110b2d75..9485e70753 100644 --- a/files/pt-br/_redirects.txt +++ b/files/pt-br/_redirects.txt @@ -121,7 +121,7 @@ /pt-BR/docs/DragDrop/Arrastar_e_Soltar /pt-BR/docs/Web/API/HTML_Drag_and_Drop_API /pt-BR/docs/DragDrop/Drag_and_Drop /pt-BR/docs/Web/API/HTML_Drag_and_Drop_API /pt-BR/docs/DragDrop/Drag_and_Drop/Arrastar_e_soltar_arquivos /pt-BR/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop -/pt-BR/docs/Eventos_on-line_off-line /pt-BR/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/pt-BR/docs/Eventos_on-line_off-line /pt-BR/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /pt-BR/docs/Games/Introduction_to_HTML5_Game_Gevelopment_(summary) /pt-BR/docs/Games/Introduction_to_HTML5_Game_Development /pt-BR/docs/Glossario /pt-BR/docs/Glossary /pt-BR/docs/Glossario/404 /pt-BR/docs/Glossary/404 @@ -484,7 +484,7 @@ /pt-BR/docs/Mozilla/Add-ons/WebExtensions/user_interface/Itens_do_menu_de_contexto /pt-BR/docs/Mozilla/Add-ons/WebExtensions/user_interface/Context_menu_items /pt-BR/docs/Mozilla/Firefox/Novas_funcionalidades /pt-BR/docs/Mozilla/Firefox/Experimental_features /pt-BR/docs/Mozilla/Firefox/Releases/3/Zoom_de_página_inteira /pt-BR/docs/Mozilla/Firefox/Releases/3/Full_page_zoom -/pt-BR/docs/Online_and_offline_events /pt-BR/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/pt-BR/docs/Online_and_offline_events /pt-BR/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /pt-BR/docs/Projeto:Como_ajudar_com_MDN /pt-BR/docs/conflicting/MDN/Contribute/Getting_started /pt-BR/docs/Projeto:Como_ajudar_com_MDN-redirect-1 /pt-BR/docs/conflicting/MDN/Contribute/Getting_started /pt-BR/docs/Projeto:Como_ajudar_com_MDN-redirect-2 /pt-BR/docs/conflicting/MDN/Contribute/Getting_started @@ -588,7 +588,17 @@ /pt-BR/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB /pt-BR/docs/orphaned/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB /pt-BR/docs/Web/API/IndexedDB_API/Usando_IndexedDB /pt-BR/docs/Web/API/IndexedDB_API/Using_IndexedDB /pt-BR/docs/Web/API/Navigator.battery /pt-BR/docs/Web/API/Navigator/battery -/pt-BR/docs/Web/API/NavigatorID.platform /pt-BR/docs/Web/API/NavigatorID/platform +/pt-BR/docs/Web/API/NavigatorID /pt-BR/docs/orphaned/Web/API/NavigatorID +/pt-BR/docs/Web/API/NavigatorID.platform /pt-BR/docs/orphaned/Web/API/NavigatorID/platform +/pt-BR/docs/Web/API/NavigatorID/platform /pt-BR/docs/orphaned/Web/API/NavigatorID/platform +/pt-BR/docs/Web/API/NavigatorID/userAgent /pt-BR/docs/orphaned/Web/API/NavigatorID/userAgent +/pt-BR/docs/Web/API/NavigatorLanguage /pt-BR/docs/orphaned/Web/API/NavigatorLanguage +/pt-BR/docs/Web/API/NavigatorLanguage/language /pt-BR/docs/orphaned/Web/API/NavigatorLanguage/language +/pt-BR/docs/Web/API/NavigatorOnLine /pt-BR/docs/orphaned/Web/API/NavigatorOnLine +/pt-BR/docs/Web/API/NavigatorOnLine/Online_and_offline_events /pt-BR/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/pt-BR/docs/Web/API/NavigatorOnLine/onLine /pt-BR/docs/orphaned/Web/API/NavigatorOnLine/onLine +/pt-BR/docs/Web/API/NavigatorPlugins /pt-BR/docs/orphaned/Web/API/NavigatorPlugins +/pt-BR/docs/Web/API/NavigatorPlugins/javaEnabled /pt-BR/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled /pt-BR/docs/Web/API/Node.appendChild /pt-BR/docs/Web/API/Node/appendChild /pt-BR/docs/Web/API/Node.childNodes /pt-BR/docs/Web/API/Node/childNodes /pt-BR/docs/Web/API/Node.contains /pt-BR/docs/Web/API/Node/contains diff --git a/files/pt-br/_wikihistory.json b/files/pt-br/_wikihistory.json index ff2f3fae11..e82678edc5 100644 --- a/files/pt-br/_wikihistory.json +++ b/files/pt-br/_wikihistory.json @@ -5862,73 +5862,6 @@ "LucasRuy" ] }, - "Web/API/NavigatorID": { - "modified": "2019-03-23T23:01:42.494Z", - "contributors": [ - "teoli" - ] - }, - "Web/API/NavigatorID/platform": { - "modified": "2020-10-15T21:27:41.688Z", - "contributors": [ - "GarkGarcia", - "teoli", - "khalid32", - "eliezerb" - ] - }, - "Web/API/NavigatorID/userAgent": { - "modified": "2020-10-15T21:58:19.578Z", - "contributors": [ - "GarkGarcia", - "thedjmarcelo" - ] - }, - "Web/API/NavigatorLanguage": { - "modified": "2019-03-23T22:03:53.998Z", - "contributors": [ - "teoli" - ] - }, - "Web/API/NavigatorLanguage/language": { - "modified": "2019-03-23T22:03:54.652Z", - "contributors": [ - "klzns" - ] - }, - "Web/API/NavigatorOnLine": { - "modified": "2019-03-23T22:02:07.133Z", - "contributors": [ - "marciioluucas", - "chrisdavidmills" - ] - }, - "Web/API/NavigatorOnLine/Online_and_offline_events": { - "modified": "2019-03-23T23:39:13.247Z", - "contributors": [ - "chrisdavidmills", - "claudiareginadasilvacorrea", - "jpalharini" - ] - }, - "Web/API/NavigatorOnLine/onLine": { - "modified": "2020-10-15T22:15:18.142Z", - "contributors": [ - "renatoluna" - ] - }, - "Web/API/NavigatorPlugins": { - "modified": "2020-10-15T22:19:29.947Z", - "contributors": [ - "Fernandolrs" - ] - }, - "Web/API/NavigatorPlugins/javaEnabled": { - "modified": "2020-10-15T22:19:29.661Z", - "contributors": [ - "Fernandolrs" - ] - }, "Web/API/Network_Information_API": { "modified": "2019-03-23T23:21:58.235Z", "contributors": [ @@ -17025,6 +16958,73 @@ "IgorGoncalves" ] }, + "orphaned/Web/API/NavigatorID": { + "modified": "2019-03-23T23:01:42.494Z", + "contributors": [ + "teoli" + ] + }, + "orphaned/Web/API/NavigatorID/platform": { + "modified": "2020-10-15T21:27:41.688Z", + "contributors": [ + "GarkGarcia", + "teoli", + "khalid32", + "eliezerb" + ] + }, + "orphaned/Web/API/NavigatorID/userAgent": { + "modified": "2020-10-15T21:58:19.578Z", + "contributors": [ + "GarkGarcia", + "thedjmarcelo" + ] + }, + "orphaned/Web/API/NavigatorLanguage": { + "modified": "2019-03-23T22:03:53.998Z", + "contributors": [ + "teoli" + ] + }, + "orphaned/Web/API/NavigatorLanguage/language": { + "modified": "2019-03-23T22:03:54.652Z", + "contributors": [ + "klzns" + ] + }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2019-03-23T22:02:07.133Z", + "contributors": [ + "marciioluucas", + "chrisdavidmills" + ] + }, + "orphaned/Web/API/NavigatorOnLine/Online_and_offline_events": { + "modified": "2019-03-23T23:39:13.247Z", + "contributors": [ + "chrisdavidmills", + "claudiareginadasilvacorrea", + "jpalharini" + ] + }, + "orphaned/Web/API/NavigatorOnLine/onLine": { + "modified": "2020-10-15T22:15:18.142Z", + "contributors": [ + "renatoluna" + ] + }, + "orphaned/Web/API/NavigatorPlugins": { + "modified": "2020-10-15T22:19:29.947Z", + "contributors": [ + "Fernandolrs" + ] + }, + "orphaned/Web/API/NavigatorPlugins/javaEnabled": { + "modified": "2020-10-15T22:19:29.661Z", + "contributors": [ + "Fernandolrs" + ] + }, "orphaned/Web/API/Node/Entendendo_o_uso_do_método_AppendChild-javascript": { "modified": "2019-03-23T22:40:45.924Z", "contributors": [ diff --git a/files/pt-br/orphaned/web/api/navigatorid/index.html b/files/pt-br/orphaned/web/api/navigatorid/index.html new file mode 100644 index 0000000000..333a59e839 --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatorid/index.html @@ -0,0 +1,121 @@ +--- +title: NavigatorID +slug: orphaned/Web/API/NavigatorID +translation_of: Web/API/NavigatorID +original_slug: Web/API/NavigatorID +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorID interface contains methods and properties related to the identity of the browser.

+ +

There is no object of type NavigatorID, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorID interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{deprecated_inline}}
+
Always returns 'Mozilla', on any browser. This property is kept only for compatibility purpose.
+
{{domxref("NavigatorID.appName")}} {{readonlyInline}} {{deprecated_inline}}
+
Returns the official name of the browser. Do not rely on this property to return the correct value.
+
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}} {{deprecated_inline}}
+
Returns the version of the browser as a string. Do not rely on this property to return the correct value.
+
{{domxref("NavigatorID.platform")}} {{readonlyInline}} {{deprecated_inline}}
+
Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.
+
{{domxref("NavigatorID.product")}} {{readonlyInline}} {{deprecated_inline}}
+
Always returns 'Gecko', on any browser. This property is kept only for compatibility purpose.
+
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
+
Returns the user agent string for the current browser.
+
+ +

Methods

+ +

The NavigatorID interface doesn't inherit any method.

+ +
+
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}}
+
Always returns false. JavaScript taint/untaint functions were removed in JavaScript 1.2. This method is only kept for compatibility purpose
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}Added the appCodeName property and the taintEnabled() method,  for compatibility purpose.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}Initial specification.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

See also

+ + diff --git a/files/pt-br/orphaned/web/api/navigatorid/platform/index.html b/files/pt-br/orphaned/web/api/navigatorid/platform/index.html new file mode 100644 index 0000000000..277f553655 --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatorid/platform/index.html @@ -0,0 +1,64 @@ +--- +title: NavigatorID.platform +slug: orphaned/Web/API/NavigatorID/platform +tags: + - API + - DOM + - DOM_0 + - Gecko + - HTML5 + - Propriedade + - Referencia + - Referência(2) +translation_of: Web/API/NavigatorID/platform +original_slug: Web/API/NavigatorID/platform +--- +

{{ ApiRef("HTML DOM") }}

+ +

Retorna uma string representando a plataforma do navegador. A especificação permite aos navegadores retornar sempre strings vazias, portanto não se utilize dessa propriedade para obter resultados confiáveis.

+ +

Sintaxe

+ +
plataforma = navigator.platform
+
+ +

Valor

+ +

Uma {{domxref("DOMString")}} identificando a plataforma na qual o navegador está sendo executado, ou uma string vazia se o browser se negar a (ou for incapaz de) identificar a plataforma. plataforma é uma string que pode estar vazia ou representar a plataforma na qual o navegador está sendo executado.

+ +

Por exemplo: "MacIntel", "Win32", "FreeBSD i386", "WebTV OS"

+ +

Exemplo

+ +
console.log(navigator.platform);
+ +

Notas

+ +

Na maioria dos browsers, incluindo Chrome, Edge e Firefox 63 em diante, NavegatorID.platform retorna "Win32", mesmo que o browser seja executado em uma versão 64-bit do Windows. No Internet Explorer e em versões do Firefox anteriores à versão 63, a propriedade ainda retorna "Win64".

+ +

No Firefox, a preferência general.platform.override pode ser usada para sobrepor o valor de retorno padrão dessa propriedade.

+ +

Especificações

+ + + + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', '#dom-navigator-platform', 'NavigatorID.platform')}}{{Spec2('HTML WHATWG')}}Definição inicial.
+ +

Compatibilidade

+ + + +

{{Compat("api.NavigatorID.platform")}}

diff --git a/files/pt-br/orphaned/web/api/navigatorid/useragent/index.html b/files/pt-br/orphaned/web/api/navigatorid/useragent/index.html new file mode 100644 index 0000000000..6ab7a96b57 --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatorid/useragent/index.html @@ -0,0 +1,90 @@ +--- +title: NavigatorID.userAgent +slug: orphaned/Web/API/NavigatorID/userAgent +tags: + - API + - Descontinuado + - Propriedade + - Referencia + - Somente Leitura +translation_of: Web/API/NavigatorID/userAgent +original_slug: Web/API/NavigatorID/userAgent +--- +

{{ApiRef("HTML DOM")}}

+ +

A propriedade read-only (apenas leitura) NavigatorID.userAgent retorna a string do agente do usuário (user agent) para o browser atual.

+ +
+

 A especifícação demanda que os navegadores forneçam, nessa propriedade, a menor quantidade de informações posssível. Nunca assuma que o valor dessa propriedade permanecerá o mesmo em verções futuras de um mesmo navegador. Tente não utiliza-la, ou ultileze-a somente para verções presentes ou passadas de um navegador. Novos navegadores podem utilizar-se do mesmo agente do usuário, ou parte dele, que navegadores mais aintigos: não existe qualquer garantia de que o agente do navegador é de fato o enunciado por essa propriedade.
+
+ Além disso, tenha em mente que os usuários do navegador podem manipular o valor dessa propriedade caso queiram (UA spoofing).

+
+ +

A idenficação de browsers baseada na detecção de sua string de agente de usuário não é confiável e não é recomendável, pois a string de agente de usuário pode ser configurada pelo usuário. Por exemplo:

+ + + +

Sintaxe

+ +
var au = window.navigator.userAgent;
+
+ +

Valor

+ +

au guarda o valor da string de agente de usuário do browser atual.

+ +

A string de agente de usuário é contruida em uma estrutura formal que pode ser decomposta em diferentes informações. Cada uma dessas informações é provinda de outras propriedades de window.navigator, que também podem ser configuradas pelo usuário. Navegadores baseados na engine Gecko seguem a seguinte estrutura:

+ +
ageteDeUsuário = códigoDoNomeDoAplicativo/versãoDoAplicativo número (Plataforma; Segurança; OS-ou-CPU;
+Localização; rv: número-da-verção-de-revisão) produto/produtoSub
+Nome-do-Aplicativo versão-do-Nome-do-Aplicativo
+
+ +

Examplo

+ +
alert(window.navigator.userAgent)
+// alerta "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"
+
+ + + +

Especificações

+ + + + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', '#dom-navigator-useragent', 'NavigatorID.userAgent')}}{{Spec2('HTML WHATWG')}}Definição inicial.
+ +

Compatibilidade

+ + + +

{{Compat("api.NavigatorID.userAgent")}}

+ +

Veja também

+ + diff --git a/files/pt-br/orphaned/web/api/navigatorlanguage/index.html b/files/pt-br/orphaned/web/api/navigatorlanguage/index.html new file mode 100644 index 0000000000..fc736ce50b --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatorlanguage/index.html @@ -0,0 +1,149 @@ +--- +title: NavigatorLanguage +slug: orphaned/Web/API/NavigatorLanguage +tags: + - API + - HTML-DOM + - NeedsTranslation + - No Interface + - Reference + - TopicStub +translation_of: Web/API/NavigatorLanguage +original_slug: Web/API/NavigatorLanguage +--- +

{{APIRef("HTML DOM")}}

+ +

NavigatorLanguage contains methods and properties related to the language of the navigator.

+ +

There is no object of type NavigatorLanguage, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorLanguage interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
+
Returns a {{domxref("DOMString")}} representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
+
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
+
Returns an array of {{domxref("DOMString")}} representing the languages known to the user, by order of preference.
+
+ +

Methods

+ +

The NavigatorLanguage interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Since the {{SpecName('HTML5 W3C')}} snapshot, the languages property has been added.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Initial specification; snapshot of  an early version{{SpecName('HTML WHATWG')}}.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages37{{CompatGeckoDesktop("32")}}{{CompatNo}}24{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages{{CompatUnknown}}{{CompatUnknown}} {{CompatGeckoMobile("32")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
+
+ +

See also

+ + diff --git a/files/pt-br/orphaned/web/api/navigatorlanguage/language/index.html b/files/pt-br/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..bf44b42a7b --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,132 @@ +--- +title: NavigatorLanguage.language +slug: orphaned/Web/API/NavigatorLanguage/language +translation_of: Web/API/NavigatorLanguage/language +original_slug: Web/API/NavigatorLanguage/language +--- +
{{APIRef("HTML DOM")}}
+ +

A propriedade NavigatorLanguage.language retorna uma string representando a língua de preferência do usuário, normalmente a língua da interface do navegador.

+ +

Sintaxe

+ +
var lang = navigator.language
+
+ +

Valor

+ +

Uma {{domxref("DOMString")}} lang armazena a string representando a língua como definida em BCP 47. Exemplos de códigos de línguas válidos incluem "en", "en-US", "fr", "fr-FR", "es-ES", etc.

+ +

Atente-se que no Safari no macOS e iOS antes da versão 10.2, o código do país é retornado em caixa baixa: "en-us", "fr-fr" etc.

+ +

Exemplo

+ +
if (window.navigator.language != 'en') {
+  doLangSelect(window.navigator.language);
+}
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComentários
{{ SpecName('HTML5.1', '#dom-navigator-language', 'NavigatorLanguage.language') }}{{ Spec2('HTML5.1') }}Definição inicial
+ +

Compatibilidade com navegadores

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Suporte básico{{CompatVersionUnknown}}[1]{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}[2]
+ {{CompatGeckoDesktop("5.0")}}[3]
11.0[4]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suporte básico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile(1.0)}}{{CompatNo}}[4]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

[1] Retorna a língua da interface do browser, não o valor do HTTP header Accept-Language .

+ +

[2] Antes do Gecko 2.0 {{geckoRelease("2.0")}}, o valor dessa propriedade também fazia parte da string de user agent, como reportado em {{domxref("window.navigator.userAgent", "navigator.userAgent")}}.

+ +

[3] Começando no Gecko 5.0 {{geckoRelease("5.0")}}, o valor dessa propriedade é baseado no valor do HTTP header Accept-Language.

+ +

[4] As propriedades (não padronizadas) mais próximas disponíveis são userLanguage e browserLanguage.

+ +

Veja também

+ + diff --git a/files/pt-br/orphaned/web/api/navigatoronline/index.html b/files/pt-br/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..77fa1b15c8 --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,135 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +tags: + - API + - HTML-DOM +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

A interface NavigatorOnLine contém métodos e propriedades relacionados ao status de conectividade do navegador.

+ +

Não há objetosdo tipo NavigatorOnLine, mas há outras interfaces, como {{domxref("Navigator")}} ou {{domxref("WorkerNavigator")}} que o implementa.

+ +

Propriedades

+ +

A interface NavigatorOnLine não herda nenhuma propriedade.

+ +

 

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
Retorna um {{domxref("Boolean")}} indicando se o browser está online.
+
+ +

Métodos

+ +

A interface NavigatorOnLine não implementa nem herda nenhum método.

+ +

Especificações

+ + + + + + + + + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}Nenhuma mudança desde a ultima atualização, do {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot do {{SpecName('HTML WHATWG')}} com sua especificação inicial
+ +

Compatibilidade de navegadores

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Suporte básico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome para AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suporte básico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

Veja também

+ + diff --git a/files/pt-br/orphaned/web/api/navigatoronline/online/index.html b/files/pt-br/orphaned/web/api/navigatoronline/online/index.html new file mode 100644 index 0000000000..96d7572048 --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatoronline/online/index.html @@ -0,0 +1,92 @@ +--- +title: Navigator.onLine +slug: orphaned/Web/API/NavigatorOnLine/onLine +tags: + - API + - DOM Reference + - NavigatorOnLine + - Offline + - Online + - Propriedade + - Referencia +translation_of: Web/API/NavigatorOnLine/onLine +original_slug: Web/API/NavigatorOnLine/onLine +--- +
{{ApiRef("HTML DOM")}}
+ +

Retorna o estado da conexão do navegador. A propriedade retorna um valor booleano, com true significando online e false significando offline. A propriedade envia atualizações assim que a capacidade do navegador de se conectar a rede muda. A atualização ocorre quando o usuário entra em um link ou quando algum script faz uma requisição a uma página remota. Exemplo, a propriedade deve retornar false quando usuários clicam em links assim que perderem suas conexões com a internet.

+ +

Navegadores implementam esta propriedade de formas diferentes.

+ +

No Chrome e Safari, caso o navegador não for capaz de se conectar a uma rede local (LAN) ou a um roteador, ele está offline; em todas as outras condições, retorna true. Utilizar essa propriedade para determinar que o navegador está offline seja sempre que o navegador retornar false como valor pode gerar falsos positivos, em casos em que o computador está executando um software de virtualização que tem adaptadores de ethernet virtuais que sempre estão "conectados." ou quando o computador estiver conectado ao roteador e este estiver sem internet. Se você realmente quer determinar o estado da conexão do navegador, você deve desenvolver meios adicionais para esta verificação. Para aprender mais, veja o artigo do HTML5 Rocks, Working Off the Grid.

+ +

No Firefox e Internet Explorer, mudar o navegador para o modo offline envia um valor false. Até o Firefox 41, todas as outras condições retornam um valor true; desde o Firefox 41, no OS X e Windows, o valor seguirá a conectividade real da rede.

+ +

Você pode ver mudanças no estado da rede escutando os eventos window.ononline e window.onoffline.

+ +

Sintaxe

+ +
online = window.navigator.onLine;
+
+ +

Valor

+ +

online é um booleano true ou false.

+ +

Exemplo

+ +

Veja  um exemplo ao-vivo.

+ +

Para verificar se você está online, chame window.navigator.onLine, como no exemplo abaixo:

+ +
if (navigator.onLine) {
+  console.log('online');
+} else {
+  console.log('offline');
+}
+ +

Caso o navegador não suporta o exemplo de navigator.onLine acima, ele sempre retornará false/undefined.

+ +

Para ver mudanças no estado da rede, use addEventListener para escutar os eventos em window.online e window.offline, como no exemplo abaixo:

+ +
window.addEventListener('offline', function(e) { console.log('offline'); });
+
+window.addEventListener('online', function(e) { console.log('online'); });
+
+ +

Especificações

+ + + + + + + + + + + + + + + + +
EspecificaçõesStatusComentário
{{SpecName("HTML WHATWG", "browsers.html#dom-navigator-online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Definição inicial
+ +

Compatibilidade com os navegadores

+ + + +

{{Compat("api.NavigatorOnLine.onLine")}}

+ +

Notas

+ +

Veja s eventos Online/Offline para descrições mais detalhadas desta propriedade assim como novas funcionalidades offline introduzidas no Firefox 3.

+ +

Veja também

+ + diff --git a/files/pt-br/orphaned/web/api/navigatoronline/online_and_offline_events/index.html b/files/pt-br/orphaned/web/api/navigatoronline/online_and_offline_events/index.html new file mode 100644 index 0000000000..915b200b01 --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatoronline/online_and_offline_events/index.html @@ -0,0 +1,96 @@ +--- +title: Eventos on-line e off-line +slug: orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +translation_of: Web/API/NavigatorOnLine/Online_and_offline_events +original_slug: Web/API/NavigatorOnLine/Online_and_offline_events +--- +

IAlguns navegadores utilizam Online/Offline events relacionados à WHATWG Web Applications 1.0 specification.

+ +

Introdução

+ +

Para criar um bom aplicativo off-line, primeiramente é necessário que você saiba quando o aplicativo está off-line. Consequentemente, você também precisará saber quando seu aplicativo retorna ao estado on-line novamente, ou seja, os eventos são:

+ +
    +
  1. Você precisa saber quando o usuário está on-line novamente, assim você pode sincronizar novamente com o servidor.
  2. +
  3. Você precisa saber quando o usuário está off-line, então você deverá agendar os acessos ao servidor para mais tarde.
  4. +
+ +

Este é o processo que os eventos on-line/off-line ajudam a facilitar.

+ +

Seu aplicativo também poderá precisar estabelecer que certos documentos deverão ser mantidos em um cache off-line. Você pode saber mais sobre isso no artigo Offline resources in Firefox.

+ +

API

+ + + +

navigator.onLine é uma propriedade que mantém valores true/false (true para on-line, false para off-line). Esta propriedade é atualizada quando o usuário entra em "Modo Off-line" clicando no item de menu correspondente (Arquivo -> Modo Off-line).

+ +

Essa propriedade também deverá ser atualizada toda vez que o navegador perde a conexão com a Internet. De acordo com a especificação:

+ +
A propriedade navigator.onLine deve retornar false se o usuário clicar num link ou se um aplicativo tentar contatar uma página remota e não estiver conectado à Internet ou se o navegador souber que a tentativa irá falhar por qualquer motivo...
+ +

O Firefox 2 atualiza esta propriedade quando se entra em Modo Off-line ou sai do mesmo e também quando a conexão com a Internet é perdida ou reestabelecida no Windows e no Linux.

+ +

Essa propriedade existiu em versões mais antigas do Firefox e do Internet Explorer (a especificação acima foi baseada nestas implementações anteriores), então você pode começar a utilizá-la imediatamente. A auto-detecção de estado de rede foi implementada no Firefox 2.

+ +

Eventos "on-line" e "off-line"

+ +

O Firefox 3 implementou dois novos eventos: "on-line" e "off-line". Estes dois eventos são chamados na tag <body> de cada página quando o navegador muda entre os modos on e off-line. Também, esses eventos são propagados a partir do document.body, para document, terminando em window. Ambos eventos não podem ser interrompidos (você não pode prevenir que o usuário fique on-line ou off-line).

+ +

Você pode resgistrar listeners para esses eventos em caminhos conhecidos:

+ + + +

Example

+ +

a simple test case que você pode rodar para ver como esses eventos funcionam. XXX Quando os testes para isso forem criados, redirecione para eles e atualize este exemplo -nickolay

+ +
 <!doctype html>
+ <html>
+ <head>
+   <script>
+     function updateOnlineStatus(msg) {
+       var status = document.getElementById("status");
+       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
+       status.setAttribute("class", condition);
+       var state = document.getElementById("state");
+       state.innerHTML = condition;
+       var log = document.getElementById("log");
+       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
+     }
+     function loaded() {
+       updateOnlineStatus("load");
+       document.body.addEventListener("offline", function () {
+         updateOnlineStatus("offline")
+       }, false);
+       document.body.addEventListener("online", function () {
+         updateOnlineStatus("online")
+       }, false);
+     }
+   </script>
+   <style>...</style>
+ </head>
+ <body onload="loaded()">
+   <div id="status"><p id="state"></p></div>
+   <div id="log"></div>
+ </body>
+ </html>
+
+ +

Notas

+ +

Se a API não estiver implementada no navegador, você pode usar outros sinais para detectar quando se está off-line, inclusive receber AppCache error events e responses from XMLHttpRequest.

+ +

Referências

+ + diff --git a/files/pt-br/orphaned/web/api/navigatorplugins/index.html b/files/pt-br/orphaned/web/api/navigatorplugins/index.html new file mode 100644 index 0000000000..fbd1296ee2 --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatorplugins/index.html @@ -0,0 +1,70 @@ +--- +title: NavigatorPlugins +slug: orphaned/Web/API/NavigatorPlugins +tags: + - API + - DOM + - Experimental + - HTML + - Interface + - Navigation + - NavigatorPlugins + - Plugins + - Reference +translation_of: Web/API/NavigatorPlugins +original_slug: Web/API/NavigatorPlugins +--- +

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

+ +

O NavigatorPlugins {{Glossary("mixin")}} adiciona na interface do {{domxref ("Navigator")}} métodos e propriedades para descobrir e interagir com plugins instalados no navegador.

+ +

 

+ +

Propriedades

+ +
+
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
+
Retorna um {{domxref ("MimeTypeArray")}} listando os tipos MIME suportados pelo navegador.
+
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
+
Retorna um {{domxref ("PluginArray")}} listando os plugins instalados no navegador.
+
+ +

Métodos

+ +

A interface NavigatorPlugins NavigatorPlugins não herda nenhum método.

+ +
+
{{domxref("NavigatorPlugins.javaEnabled", "NavigatorPlugins.javaEnabled()")}} {{readonlyInline}}{{experimental_inline}}
+
Retorna uma flag {{domxref ("Boolean")}} indicando se o navegador do host tem o Java ativo ou não.
+
+ +

Especificações

+ + + + + + + + + + + + + + + + +
EspecificaçãoEstadoComentário
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Definição inicial.
+ + + + + +

{{Compat("api.NavigatorPlugins")}}

+ +

Veja também

+ + diff --git a/files/pt-br/orphaned/web/api/navigatorplugins/javaenabled/index.html b/files/pt-br/orphaned/web/api/navigatorplugins/javaenabled/index.html new file mode 100644 index 0000000000..c2110137e5 --- /dev/null +++ b/files/pt-br/orphaned/web/api/navigatorplugins/javaenabled/index.html @@ -0,0 +1,55 @@ +--- +title: NavigatorPlugins.javaEnabled() +slug: orphaned/Web/API/NavigatorPlugins/javaEnabled +tags: + - API + - Example + - Method + - Reference +translation_of: Web/API/NavigatorPlugins/javaEnabled +original_slug: Web/API/NavigatorPlugins/javaEnabled +--- +

{{ APIRef("HTML DOM") }}

+ +

Este método indica se o navegador atual tem o Java ativo ou não.

+ +

Sintaxe

+ +
result = window.navigator.javaEnabled()
+
+ +

Exemplo

+ +
if (window.navigator.javaEnabled()) {
+   // browser has java
+}
+
+ +

Notas

+ +

O valor de retorno para este método indica se a preferência que controla o Java está ativado ou desativado - não se o navegador oferece suporte ao Java, em geral.

+ +

Especificações

+ + + + + + + + + + + + + + + + +
EsécificaçõesEstadoComentário
{{SpecName('HTML WHATWG', '#dom-navigator-javaenabled', 'NavigatorPlugins.javaEnabled')}}{{Spec2('HTML WHATWG')}}Definição inicial.
+ + + + + +

{{Compat("api.NavigatorPlugins.javaEnabled")}}

diff --git a/files/pt-br/web/api/navigatorid/index.html b/files/pt-br/web/api/navigatorid/index.html deleted file mode 100644 index c56f1e1b81..0000000000 --- a/files/pt-br/web/api/navigatorid/index.html +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: NavigatorID -slug: Web/API/NavigatorID -translation_of: Web/API/NavigatorID ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorID interface contains methods and properties related to the identity of the browser.

- -

There is no object of type NavigatorID, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorID interface doesn't inherit any property.

- -
-
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{deprecated_inline}}
-
Always returns 'Mozilla', on any browser. This property is kept only for compatibility purpose.
-
{{domxref("NavigatorID.appName")}} {{readonlyInline}} {{deprecated_inline}}
-
Returns the official name of the browser. Do not rely on this property to return the correct value.
-
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}} {{deprecated_inline}}
-
Returns the version of the browser as a string. Do not rely on this property to return the correct value.
-
{{domxref("NavigatorID.platform")}} {{readonlyInline}} {{deprecated_inline}}
-
Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.
-
{{domxref("NavigatorID.product")}} {{readonlyInline}} {{deprecated_inline}}
-
Always returns 'Gecko', on any browser. This property is kept only for compatibility purpose.
-
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
-
Returns the user agent string for the current browser.
-
- -

Methods

- -

The NavigatorID interface doesn't inherit any method.

- -
-
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}}
-
Always returns false. JavaScript taint/untaint functions were removed in JavaScript 1.2. This method is only kept for compatibility purpose
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}Added the appCodeName property and the taintEnabled() method,  for compatibility purpose.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}Initial specification.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

See also

- - diff --git a/files/pt-br/web/api/navigatorid/platform/index.html b/files/pt-br/web/api/navigatorid/platform/index.html deleted file mode 100644 index 590d9bd515..0000000000 --- a/files/pt-br/web/api/navigatorid/platform/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: NavigatorID.platform -slug: Web/API/NavigatorID/platform -tags: - - API - - DOM - - DOM_0 - - Gecko - - HTML5 - - Propriedade - - Referencia - - Referência(2) -translation_of: Web/API/NavigatorID/platform ---- -

{{ ApiRef("HTML DOM") }}

- -

Retorna uma string representando a plataforma do navegador. A especificação permite aos navegadores retornar sempre strings vazias, portanto não se utilize dessa propriedade para obter resultados confiáveis.

- -

Sintaxe

- -
plataforma = navigator.platform
-
- -

Valor

- -

Uma {{domxref("DOMString")}} identificando a plataforma na qual o navegador está sendo executado, ou uma string vazia se o browser se negar a (ou for incapaz de) identificar a plataforma. plataforma é uma string que pode estar vazia ou representar a plataforma na qual o navegador está sendo executado.

- -

Por exemplo: "MacIntel", "Win32", "FreeBSD i386", "WebTV OS"

- -

Exemplo

- -
console.log(navigator.platform);
- -

Notas

- -

Na maioria dos browsers, incluindo Chrome, Edge e Firefox 63 em diante, NavegatorID.platform retorna "Win32", mesmo que o browser seja executado em uma versão 64-bit do Windows. No Internet Explorer e em versões do Firefox anteriores à versão 63, a propriedade ainda retorna "Win64".

- -

No Firefox, a preferência general.platform.override pode ser usada para sobrepor o valor de retorno padrão dessa propriedade.

- -

Especificações

- - - - - - - - - - - - - - - - -
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', '#dom-navigator-platform', 'NavigatorID.platform')}}{{Spec2('HTML WHATWG')}}Definição inicial.
- -

Compatibilidade

- - - -

{{Compat("api.NavigatorID.platform")}}

diff --git a/files/pt-br/web/api/navigatorid/useragent/index.html b/files/pt-br/web/api/navigatorid/useragent/index.html deleted file mode 100644 index c5e6211724..0000000000 --- a/files/pt-br/web/api/navigatorid/useragent/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: NavigatorID.userAgent -slug: Web/API/NavigatorID/userAgent -tags: - - API - - Descontinuado - - Propriedade - - Referencia - - Somente Leitura -translation_of: Web/API/NavigatorID/userAgent ---- -

{{ApiRef("HTML DOM")}}

- -

A propriedade read-only (apenas leitura) NavigatorID.userAgent retorna a string do agente do usuário (user agent) para o browser atual.

- -
-

 A especifícação demanda que os navegadores forneçam, nessa propriedade, a menor quantidade de informações posssível. Nunca assuma que o valor dessa propriedade permanecerá o mesmo em verções futuras de um mesmo navegador. Tente não utiliza-la, ou ultileze-a somente para verções presentes ou passadas de um navegador. Novos navegadores podem utilizar-se do mesmo agente do usuário, ou parte dele, que navegadores mais aintigos: não existe qualquer garantia de que o agente do navegador é de fato o enunciado por essa propriedade.
-
- Além disso, tenha em mente que os usuários do navegador podem manipular o valor dessa propriedade caso queiram (UA spoofing).

-
- -

A idenficação de browsers baseada na detecção de sua string de agente de usuário não é confiável e não é recomendável, pois a string de agente de usuário pode ser configurada pelo usuário. Por exemplo:

- - - -

Sintaxe

- -
var au = window.navigator.userAgent;
-
- -

Valor

- -

au guarda o valor da string de agente de usuário do browser atual.

- -

A string de agente de usuário é contruida em uma estrutura formal que pode ser decomposta em diferentes informações. Cada uma dessas informações é provinda de outras propriedades de window.navigator, que também podem ser configuradas pelo usuário. Navegadores baseados na engine Gecko seguem a seguinte estrutura:

- -
ageteDeUsuário = códigoDoNomeDoAplicativo/versãoDoAplicativo número (Plataforma; Segurança; OS-ou-CPU;
-Localização; rv: número-da-verção-de-revisão) produto/produtoSub
-Nome-do-Aplicativo versão-do-Nome-do-Aplicativo
-
- -

Examplo

- -
alert(window.navigator.userAgent)
-// alerta "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"
-
- - - -

Especificações

- - - - - - - - - - - - - - - - -
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', '#dom-navigator-useragent', 'NavigatorID.userAgent')}}{{Spec2('HTML WHATWG')}}Definição inicial.
- -

Compatibilidade

- - - -

{{Compat("api.NavigatorID.userAgent")}}

- -

Veja também

- - diff --git a/files/pt-br/web/api/navigatorlanguage/index.html b/files/pt-br/web/api/navigatorlanguage/index.html deleted file mode 100644 index 7d6b0751e7..0000000000 --- a/files/pt-br/web/api/navigatorlanguage/index.html +++ /dev/null @@ -1,148 +0,0 @@ ---- -title: NavigatorLanguage -slug: Web/API/NavigatorLanguage -tags: - - API - - HTML-DOM - - NeedsTranslation - - No Interface - - Reference - - TopicStub -translation_of: Web/API/NavigatorLanguage ---- -

{{APIRef("HTML DOM")}}

- -

NavigatorLanguage contains methods and properties related to the language of the navigator.

- -

There is no object of type NavigatorLanguage, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorLanguage interface doesn't inherit any property.

- -
-
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
-
Returns a {{domxref("DOMString")}} representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
-
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
-
Returns an array of {{domxref("DOMString")}} representing the languages known to the user, by order of preference.
-
- -

Methods

- -

The NavigatorLanguage interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Since the {{SpecName('HTML5 W3C')}} snapshot, the languages property has been added.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Initial specification; snapshot of  an early version{{SpecName('HTML WHATWG')}}.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages37{{CompatGeckoDesktop("32")}}{{CompatNo}}24{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
languages{{CompatUnknown}}{{CompatUnknown}} {{CompatGeckoMobile("32")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
-
- -

See also

- - diff --git a/files/pt-br/web/api/navigatorlanguage/language/index.html b/files/pt-br/web/api/navigatorlanguage/language/index.html deleted file mode 100644 index e3c1e69447..0000000000 --- a/files/pt-br/web/api/navigatorlanguage/language/index.html +++ /dev/null @@ -1,131 +0,0 @@ ---- -title: NavigatorLanguage.language -slug: Web/API/NavigatorLanguage/language -translation_of: Web/API/NavigatorLanguage/language ---- -
{{APIRef("HTML DOM")}}
- -

A propriedade NavigatorLanguage.language retorna uma string representando a língua de preferência do usuário, normalmente a língua da interface do navegador.

- -

Sintaxe

- -
var lang = navigator.language
-
- -

Valor

- -

Uma {{domxref("DOMString")}} lang armazena a string representando a língua como definida em BCP 47. Exemplos de códigos de línguas válidos incluem "en", "en-US", "fr", "fr-FR", "es-ES", etc.

- -

Atente-se que no Safari no macOS e iOS antes da versão 10.2, o código do país é retornado em caixa baixa: "en-us", "fr-fr" etc.

- -

Exemplo

- -
if (window.navigator.language != 'en') {
-  doLangSelect(window.navigator.language);
-}
-
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComentários
{{ SpecName('HTML5.1', '#dom-navigator-language', 'NavigatorLanguage.language') }}{{ Spec2('HTML5.1') }}Definição inicial
- -

Compatibilidade com navegadores

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Suporte básico{{CompatVersionUnknown}}[1]{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}[2]
- {{CompatGeckoDesktop("5.0")}}[3]
11.0[4]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suporte básico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile(1.0)}}{{CompatNo}}[4]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop("35")}}{{CompatNo}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] Retorna a língua da interface do browser, não o valor do HTTP header Accept-Language .

- -

[2] Antes do Gecko 2.0 {{geckoRelease("2.0")}}, o valor dessa propriedade também fazia parte da string de user agent, como reportado em {{domxref("window.navigator.userAgent", "navigator.userAgent")}}.

- -

[3] Começando no Gecko 5.0 {{geckoRelease("5.0")}}, o valor dessa propriedade é baseado no valor do HTTP header Accept-Language.

- -

[4] As propriedades (não padronizadas) mais próximas disponíveis são userLanguage e browserLanguage.

- -

Veja também

- - diff --git a/files/pt-br/web/api/navigatoronline/index.html b/files/pt-br/web/api/navigatoronline/index.html deleted file mode 100644 index 6e5118c62b..0000000000 --- a/files/pt-br/web/api/navigatoronline/index.html +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -tags: - - API - - HTML-DOM -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

A interface NavigatorOnLine contém métodos e propriedades relacionados ao status de conectividade do navegador.

- -

Não há objetosdo tipo NavigatorOnLine, mas há outras interfaces, como {{domxref("Navigator")}} ou {{domxref("WorkerNavigator")}} que o implementa.

- -

Propriedades

- -

A interface NavigatorOnLine não herda nenhuma propriedade.

- -

 

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
Retorna um {{domxref("Boolean")}} indicando se o browser está online.
-
- -

Métodos

- -

A interface NavigatorOnLine não implementa nem herda nenhum método.

- -

Especificações

- - - - - - - - - - - - - - - - - - - - - -
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}Nenhuma mudança desde a ultima atualização, do {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot do {{SpecName('HTML WHATWG')}} com sua especificação inicial
- -

Compatibilidade de navegadores

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CaracterísticaChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Suporte básico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CaracterísticaAndroidChrome para AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suporte básico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

Veja também

- - diff --git a/files/pt-br/web/api/navigatoronline/online/index.html b/files/pt-br/web/api/navigatoronline/online/index.html deleted file mode 100644 index acaed23e82..0000000000 --- a/files/pt-br/web/api/navigatoronline/online/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: Navigator.onLine -slug: Web/API/NavigatorOnLine/onLine -tags: - - API - - DOM Reference - - NavigatorOnLine - - Offline - - Online - - Propriedade - - Referencia -translation_of: Web/API/NavigatorOnLine/onLine ---- -
{{ApiRef("HTML DOM")}}
- -

Retorna o estado da conexão do navegador. A propriedade retorna um valor booleano, com true significando online e false significando offline. A propriedade envia atualizações assim que a capacidade do navegador de se conectar a rede muda. A atualização ocorre quando o usuário entra em um link ou quando algum script faz uma requisição a uma página remota. Exemplo, a propriedade deve retornar false quando usuários clicam em links assim que perderem suas conexões com a internet.

- -

Navegadores implementam esta propriedade de formas diferentes.

- -

No Chrome e Safari, caso o navegador não for capaz de se conectar a uma rede local (LAN) ou a um roteador, ele está offline; em todas as outras condições, retorna true. Utilizar essa propriedade para determinar que o navegador está offline seja sempre que o navegador retornar false como valor pode gerar falsos positivos, em casos em que o computador está executando um software de virtualização que tem adaptadores de ethernet virtuais que sempre estão "conectados." ou quando o computador estiver conectado ao roteador e este estiver sem internet. Se você realmente quer determinar o estado da conexão do navegador, você deve desenvolver meios adicionais para esta verificação. Para aprender mais, veja o artigo do HTML5 Rocks, Working Off the Grid.

- -

No Firefox e Internet Explorer, mudar o navegador para o modo offline envia um valor false. Até o Firefox 41, todas as outras condições retornam um valor true; desde o Firefox 41, no OS X e Windows, o valor seguirá a conectividade real da rede.

- -

Você pode ver mudanças no estado da rede escutando os eventos window.ononline e window.onoffline.

- -

Sintaxe

- -
online = window.navigator.onLine;
-
- -

Valor

- -

online é um booleano true ou false.

- -

Exemplo

- -

Veja  um exemplo ao-vivo.

- -

Para verificar se você está online, chame window.navigator.onLine, como no exemplo abaixo:

- -
if (navigator.onLine) {
-  console.log('online');
-} else {
-  console.log('offline');
-}
- -

Caso o navegador não suporta o exemplo de navigator.onLine acima, ele sempre retornará false/undefined.

- -

Para ver mudanças no estado da rede, use addEventListener para escutar os eventos em window.online e window.offline, como no exemplo abaixo:

- -
window.addEventListener('offline', function(e) { console.log('offline'); });
-
-window.addEventListener('online', function(e) { console.log('online'); });
-
- -

Especificações

- - - - - - - - - - - - - - - - -
EspecificaçõesStatusComentário
{{SpecName("HTML WHATWG", "browsers.html#dom-navigator-online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Definição inicial
- -

Compatibilidade com os navegadores

- - - -

{{Compat("api.NavigatorOnLine.onLine")}}

- -

Notas

- -

Veja s eventos Online/Offline para descrições mais detalhadas desta propriedade assim como novas funcionalidades offline introduzidas no Firefox 3.

- -

Veja também

- - diff --git a/files/pt-br/web/api/navigatoronline/online_and_offline_events/index.html b/files/pt-br/web/api/navigatoronline/online_and_offline_events/index.html deleted file mode 100644 index 0ca26a9ad6..0000000000 --- a/files/pt-br/web/api/navigatoronline/online_and_offline_events/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: Eventos on-line e off-line -slug: Web/API/NavigatorOnLine/Online_and_offline_events -translation_of: Web/API/NavigatorOnLine/Online_and_offline_events ---- -

IAlguns navegadores utilizam Online/Offline events relacionados à WHATWG Web Applications 1.0 specification.

- -

Introdução

- -

Para criar um bom aplicativo off-line, primeiramente é necessário que você saiba quando o aplicativo está off-line. Consequentemente, você também precisará saber quando seu aplicativo retorna ao estado on-line novamente, ou seja, os eventos são:

- -
    -
  1. Você precisa saber quando o usuário está on-line novamente, assim você pode sincronizar novamente com o servidor.
  2. -
  3. Você precisa saber quando o usuário está off-line, então você deverá agendar os acessos ao servidor para mais tarde.
  4. -
- -

Este é o processo que os eventos on-line/off-line ajudam a facilitar.

- -

Seu aplicativo também poderá precisar estabelecer que certos documentos deverão ser mantidos em um cache off-line. Você pode saber mais sobre isso no artigo Offline resources in Firefox.

- -

API

- - - -

navigator.onLine é uma propriedade que mantém valores true/false (true para on-line, false para off-line). Esta propriedade é atualizada quando o usuário entra em "Modo Off-line" clicando no item de menu correspondente (Arquivo -> Modo Off-line).

- -

Essa propriedade também deverá ser atualizada toda vez que o navegador perde a conexão com a Internet. De acordo com a especificação:

- -
A propriedade navigator.onLine deve retornar false se o usuário clicar num link ou se um aplicativo tentar contatar uma página remota e não estiver conectado à Internet ou se o navegador souber que a tentativa irá falhar por qualquer motivo...
- -

O Firefox 2 atualiza esta propriedade quando se entra em Modo Off-line ou sai do mesmo e também quando a conexão com a Internet é perdida ou reestabelecida no Windows e no Linux.

- -

Essa propriedade existiu em versões mais antigas do Firefox e do Internet Explorer (a especificação acima foi baseada nestas implementações anteriores), então você pode começar a utilizá-la imediatamente. A auto-detecção de estado de rede foi implementada no Firefox 2.

- -

Eventos "on-line" e "off-line"

- -

O Firefox 3 implementou dois novos eventos: "on-line" e "off-line". Estes dois eventos são chamados na tag <body> de cada página quando o navegador muda entre os modos on e off-line. Também, esses eventos são propagados a partir do document.body, para document, terminando em window. Ambos eventos não podem ser interrompidos (você não pode prevenir que o usuário fique on-line ou off-line).

- -

Você pode resgistrar listeners para esses eventos em caminhos conhecidos:

- - - -

Example

- -

a simple test case que você pode rodar para ver como esses eventos funcionam. XXX Quando os testes para isso forem criados, redirecione para eles e atualize este exemplo -nickolay

- -
 <!doctype html>
- <html>
- <head>
-   <script>
-     function updateOnlineStatus(msg) {
-       var status = document.getElementById("status");
-       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
-       status.setAttribute("class", condition);
-       var state = document.getElementById("state");
-       state.innerHTML = condition;
-       var log = document.getElementById("log");
-       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
-     }
-     function loaded() {
-       updateOnlineStatus("load");
-       document.body.addEventListener("offline", function () {
-         updateOnlineStatus("offline")
-       }, false);
-       document.body.addEventListener("online", function () {
-         updateOnlineStatus("online")
-       }, false);
-     }
-   </script>
-   <style>...</style>
- </head>
- <body onload="loaded()">
-   <div id="status"><p id="state"></p></div>
-   <div id="log"></div>
- </body>
- </html>
-
- -

Notas

- -

Se a API não estiver implementada no navegador, você pode usar outros sinais para detectar quando se está off-line, inclusive receber AppCache error events e responses from XMLHttpRequest.

- -

Referências

- - diff --git a/files/pt-br/web/api/navigatorplugins/index.html b/files/pt-br/web/api/navigatorplugins/index.html deleted file mode 100644 index ddcc629eb8..0000000000 --- a/files/pt-br/web/api/navigatorplugins/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: NavigatorPlugins -slug: Web/API/NavigatorPlugins -tags: - - API - - DOM - - Experimental - - HTML - - Interface - - Navigation - - NavigatorPlugins - - Plugins - - Reference -translation_of: Web/API/NavigatorPlugins ---- -

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

- -

O NavigatorPlugins {{Glossary("mixin")}} adiciona na interface do {{domxref ("Navigator")}} métodos e propriedades para descobrir e interagir com plugins instalados no navegador.

- -

 

- -

Propriedades

- -
-
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
-
Retorna um {{domxref ("MimeTypeArray")}} listando os tipos MIME suportados pelo navegador.
-
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
-
Retorna um {{domxref ("PluginArray")}} listando os plugins instalados no navegador.
-
- -

Métodos

- -

A interface NavigatorPlugins NavigatorPlugins não herda nenhum método.

- -
-
{{domxref("NavigatorPlugins.javaEnabled", "NavigatorPlugins.javaEnabled()")}} {{readonlyInline}}{{experimental_inline}}
-
Retorna uma flag {{domxref ("Boolean")}} indicando se o navegador do host tem o Java ativo ou não.
-
- -

Especificações

- - - - - - - - - - - - - - - - -
EspecificaçãoEstadoComentário
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Definição inicial.
- - - - - -

{{Compat("api.NavigatorPlugins")}}

- -

Veja também

- - diff --git a/files/pt-br/web/api/navigatorplugins/javaenabled/index.html b/files/pt-br/web/api/navigatorplugins/javaenabled/index.html deleted file mode 100644 index 29aba43a52..0000000000 --- a/files/pt-br/web/api/navigatorplugins/javaenabled/index.html +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: NavigatorPlugins.javaEnabled() -slug: Web/API/NavigatorPlugins/javaEnabled -tags: - - API - - Example - - Method - - Reference -translation_of: Web/API/NavigatorPlugins/javaEnabled ---- -

{{ APIRef("HTML DOM") }}

- -

Este método indica se o navegador atual tem o Java ativo ou não.

- -

Sintaxe

- -
result = window.navigator.javaEnabled()
-
- -

Exemplo

- -
if (window.navigator.javaEnabled()) {
-   // browser has java
-}
-
- -

Notas

- -

O valor de retorno para este método indica se a preferência que controla o Java está ativado ou desativado - não se o navegador oferece suporte ao Java, em geral.

- -

Especificações

- - - - - - - - - - - - - - - - -
EsécificaçõesEstadoComentário
{{SpecName('HTML WHATWG', '#dom-navigator-javaenabled', 'NavigatorPlugins.javaEnabled')}}{{Spec2('HTML WHATWG')}}Definição inicial.
- - - - - -

{{Compat("api.NavigatorPlugins.javaEnabled")}}

diff --git a/files/ru/_redirects.txt b/files/ru/_redirects.txt index f4bfae44d5..69900553de 100644 --- a/files/ru/_redirects.txt +++ b/files/ru/_redirects.txt @@ -436,6 +436,23 @@ /ru/docs/Web/API/LocalMediaStream /ru/docs/orphaned/Web/API/LocalMediaStream /ru/docs/Web/API/MediaTrackConstraints/Эхоподавление /ru/docs/Web/API/MediaTrackConstraints/echoCancellation /ru/docs/Web/API/NavigatorGeolocation /ru/docs/conflicting/Web/API/Geolocation +/ru/docs/Web/API/NavigatorID /ru/docs/orphaned/Web/API/NavigatorID +/ru/docs/Web/API/NavigatorID/appCodeName /ru/docs/orphaned/Web/API/NavigatorID/appCodeName +/ru/docs/Web/API/NavigatorID/appName /ru/docs/orphaned/Web/API/NavigatorID/appName +/ru/docs/Web/API/NavigatorID/appVersion /ru/docs/orphaned/Web/API/NavigatorID/appVersion +/ru/docs/Web/API/NavigatorID/platform /ru/docs/orphaned/Web/API/NavigatorID/platform +/ru/docs/Web/API/NavigatorID/product /ru/docs/orphaned/Web/API/NavigatorID/product +/ru/docs/Web/API/NavigatorID/taintEnabled /ru/docs/orphaned/Web/API/NavigatorID/taintEnabled +/ru/docs/Web/API/NavigatorID/userAgent /ru/docs/orphaned/Web/API/NavigatorID/userAgent +/ru/docs/Web/API/NavigatorLanguage /ru/docs/orphaned/Web/API/NavigatorLanguage +/ru/docs/Web/API/NavigatorLanguage/language /ru/docs/orphaned/Web/API/NavigatorLanguage/language +/ru/docs/Web/API/NavigatorLanguage/languages /ru/docs/orphaned/Web/API/NavigatorLanguage/languages +/ru/docs/Web/API/NavigatorOnLine /ru/docs/orphaned/Web/API/NavigatorOnLine +/ru/docs/Web/API/NavigatorOnLine/onLine /ru/docs/orphaned/Web/API/NavigatorOnLine/onLine +/ru/docs/Web/API/NavigatorPlugins /ru/docs/orphaned/Web/API/NavigatorPlugins +/ru/docs/Web/API/NavigatorPlugins/javaEnabled /ru/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/ru/docs/Web/API/NavigatorPlugins/mimeTypes /ru/docs/orphaned/Web/API/NavigatorPlugins/mimeTypes +/ru/docs/Web/API/NavigatorPlugins/plugins /ru/docs/orphaned/Web/API/NavigatorPlugins/plugins /ru/docs/Web/API/NetworkInformation/connection /ru/docs/Web/API/Navigator/connection /ru/docs/Web/API/Node.appendChild /ru/docs/Web/API/Node/appendChild /ru/docs/Web/API/Node.contains /ru/docs/Web/API/Node/contains diff --git a/files/ru/_wikihistory.json b/files/ru/_wikihistory.json index ebd9832fe2..aa15bbaaf1 100644 --- a/files/ru/_wikihistory.json +++ b/files/ru/_wikihistory.json @@ -9716,117 +9716,6 @@ "AlexAlex" ] }, - "Web/API/NavigatorID": { - "modified": "2020-10-15T21:36:43.124Z", - "contributors": [ - "fscholz", - "AlexAlex" - ] - }, - "Web/API/NavigatorID/appCodeName": { - "modified": "2019-03-23T22:54:11.399Z", - "contributors": [ - "AlexAlex" - ] - }, - "Web/API/NavigatorID/appName": { - "modified": "2019-03-23T22:54:41.758Z", - "contributors": [ - "AlexAlex" - ] - }, - "Web/API/NavigatorID/appVersion": { - "modified": "2019-03-23T22:54:32.102Z", - "contributors": [ - "FordSoft", - "AlexAlex" - ] - }, - "Web/API/NavigatorID/platform": { - "modified": "2020-10-15T21:36:42.389Z", - "contributors": [ - "mqqza", - "AlexAlex" - ] - }, - "Web/API/NavigatorID/product": { - "modified": "2019-03-23T22:54:26.372Z", - "contributors": [ - "AlexAlex" - ] - }, - "Web/API/NavigatorID/taintEnabled": { - "modified": "2020-10-15T21:36:42.862Z", - "contributors": [ - "fscholz", - "AlexAlex" - ] - }, - "Web/API/NavigatorID/userAgent": { - "modified": "2019-05-31T01:04:23.816Z", - "contributors": [ - "Grawl", - "patsuckow", - "AlexAlex" - ] - }, - "Web/API/NavigatorLanguage": { - "modified": "2019-03-23T22:54:36.204Z", - "contributors": [ - "AlexAlex" - ] - }, - "Web/API/NavigatorLanguage/language": { - "modified": "2020-05-02T05:07:32.288Z", - "contributors": [ - "leshkin", - "AlexAlex" - ] - }, - "Web/API/NavigatorLanguage/languages": { - "modified": "2019-03-23T22:54:22.153Z", - "contributors": [ - "AlexAlex" - ] - }, - "Web/API/NavigatorOnLine": { - "modified": "2019-03-23T22:54:40.457Z", - "contributors": [ - "AlexAlex" - ] - }, - "Web/API/NavigatorOnLine/onLine": { - "modified": "2019-03-23T22:54:19.762Z", - "contributors": [ - "AlexAlex" - ] - }, - "Web/API/NavigatorPlugins": { - "modified": "2019-03-23T22:54:31.545Z", - "contributors": [ - "AlexAlex" - ] - }, - "Web/API/NavigatorPlugins/javaEnabled": { - "modified": "2019-03-23T22:54:23.717Z", - "contributors": [ - "AlexAlex" - ] - }, - "Web/API/NavigatorPlugins/mimeTypes": { - "modified": "2019-03-23T22:54:19.236Z", - "contributors": [ - "nik3402", - "torbasow", - "AlexAlex" - ] - }, - "Web/API/NavigatorPlugins/plugins": { - "modified": "2019-03-23T22:54:18.720Z", - "contributors": [ - "AlexAlex" - ] - }, "Web/API/NetworkInformation": { "modified": "2019-03-23T22:54:09.237Z", "contributors": [ @@ -25326,6 +25215,117 @@ "sosnovskyas" ] }, + "orphaned/Web/API/NavigatorID": { + "modified": "2020-10-15T21:36:43.124Z", + "contributors": [ + "fscholz", + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorID/appCodeName": { + "modified": "2019-03-23T22:54:11.399Z", + "contributors": [ + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorID/appName": { + "modified": "2019-03-23T22:54:41.758Z", + "contributors": [ + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorID/appVersion": { + "modified": "2019-03-23T22:54:32.102Z", + "contributors": [ + "FordSoft", + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorID/platform": { + "modified": "2020-10-15T21:36:42.389Z", + "contributors": [ + "mqqza", + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorID/product": { + "modified": "2019-03-23T22:54:26.372Z", + "contributors": [ + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorID/taintEnabled": { + "modified": "2020-10-15T21:36:42.862Z", + "contributors": [ + "fscholz", + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorID/userAgent": { + "modified": "2019-05-31T01:04:23.816Z", + "contributors": [ + "Grawl", + "patsuckow", + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorLanguage": { + "modified": "2019-03-23T22:54:36.204Z", + "contributors": [ + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorLanguage/language": { + "modified": "2020-05-02T05:07:32.288Z", + "contributors": [ + "leshkin", + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorLanguage/languages": { + "modified": "2019-03-23T22:54:22.153Z", + "contributors": [ + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2019-03-23T22:54:40.457Z", + "contributors": [ + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorOnLine/onLine": { + "modified": "2019-03-23T22:54:19.762Z", + "contributors": [ + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorPlugins": { + "modified": "2019-03-23T22:54:31.545Z", + "contributors": [ + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorPlugins/javaEnabled": { + "modified": "2019-03-23T22:54:23.717Z", + "contributors": [ + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorPlugins/mimeTypes": { + "modified": "2019-03-23T22:54:19.236Z", + "contributors": [ + "nik3402", + "torbasow", + "AlexAlex" + ] + }, + "orphaned/Web/API/NavigatorPlugins/plugins": { + "modified": "2019-03-23T22:54:18.720Z", + "contributors": [ + "AlexAlex" + ] + }, "orphaned/Web/API/Node/getUserData": { "modified": "2019-03-23T22:53:29.815Z", "contributors": [ diff --git a/files/ru/orphaned/web/api/navigatorid/appcodename/index.html b/files/ru/orphaned/web/api/navigatorid/appcodename/index.html new file mode 100644 index 0000000000..4c43543804 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorid/appcodename/index.html @@ -0,0 +1,56 @@ +--- +title: NavigatorID.appCodeName +slug: orphaned/Web/API/NavigatorID/appCodeName +translation_of: Web/API/NavigatorID/appCodeName +original_slug: Web/API/NavigatorID/appCodeName +--- +

{{APIRef("HTML DOM")}}{{deprecated_header}}

+ +

NavigatorID.appCodeName всегда возвращает'Mozilla' в любом браузере. Это свойство сохраняется только для совместимости.

+ +
Примечание: Не полагаетесь на это свойство, чтобы получить настоящее имя продукта. Все браузеры возвращают "Mozilla" в качестве значения свойства.
+ +

Синтаксис

+ +
codeName = window.navigator.appCodeName
+
+ +

Значение

+ +

codeName это внутреннее имя браузера в виде {{domxref("DOMString")}}.

+ +

Пример

+ +
console.log(window.navigator.appCodeName);
+
+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-appcodename', 'NavigatorID.appCodeName')}}{{Spec2('HTML WHATWG')}}Изначальное определение
+ +

Доступность в браузере

+ +

{{Compat("api.NavigatorID.appCodeName")}}

+ +

Смотрите также

+ + + +

 

diff --git a/files/ru/orphaned/web/api/navigatorid/appname/index.html b/files/ru/orphaned/web/api/navigatorid/appname/index.html new file mode 100644 index 0000000000..057ff3d5f8 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorid/appname/index.html @@ -0,0 +1,55 @@ +--- +title: NavigatorID.appName +slug: orphaned/Web/API/NavigatorID/appName +translation_of: Web/API/NavigatorID/appName +original_slug: Web/API/NavigatorID/appName +--- +

{{APIRef("HTML DOM")}}{{deprecated_header}}

+ +

Свойство NavigatorID.appName возвращает название браузера. HTML5 спецификация также позволяет любому браузеру вернуть Netscape", по причине совместимости.

+ +

Примечание: не полагайтесь на это свойство для получения корректного имени браузера.В большинстве браузеров (Firefox, как, Chrome, Safari, Opera и Internet Explorer) возвращаемой строкой будет "Netscape".

+ +

Синтаксис

+ +
appName = window.navigator.appName
+
+ +

Значение

+ +

appName это имя браузера в виде строки.

+ +

Пример

+ +
alert(window.navigator.appName);
+// показывает имя браузера.
+
+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-appName', 'NavigatorID.appName')}}{{Spec2('HTML WHATWG')}}Изначальное описание
+ +

Доступность в браузере

+ +

{{Compat("api.NavigatorID.appName")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatorid/appversion/index.html b/files/ru/orphaned/web/api/navigatorid/appversion/index.html new file mode 100644 index 0000000000..fcc2331162 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorid/appversion/index.html @@ -0,0 +1,54 @@ +--- +title: NavigatorID.appVersion +slug: orphaned/Web/API/NavigatorID/appVersion +translation_of: Web/API/NavigatorID/appVersion +original_slug: Web/API/NavigatorID/appVersion +--- +

{{APIRef("HTML DOM")}}{{deprecated_header}}

+ +

Возвращает версию браузера в виде строки. Это может быть либо обычный номер версии, например, "5.0" или номер версии с более детальной информацией. Спецификация HTML5 позволяет любому браузеру вернуть "4,0", по причине совместимости.

+ +
Примечание: Не полагайтесь на это свойство для получения правильной версии браузера. В браузерах на основе Geko (таких как Firefox), и основанных на WebKit (таких как Chrome и Safari) возвращаемое значение начинается с "5.0" с последующей информацией о платформе. В Opera 10 и/или более новой версии, возвращаемое значение не соответствует актуальной версии браузера.
+ +

Синтаксис

+ +
window.navigator.appVersion
+
+ +

Значение

+ +

ver номер версии браузера в виде {{domxref("DOMString")}}.

+ +

Пример

+ +
alert("Your browser version is reported as " + navigator.appVersion);
+
+ +

Примечание

+ +

Свойство window.navigator.userAgent может содержать номер версии (например  "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1"), но вы должны быть в курсе того как легко изменить строку пользовательского агента (user agent) и "обмануть" другие браузеры, платформы или пользовательские агенты, а также опрометчивых вендоров браузеров самими этими свойствами.

+ +

Свойства window.navigator.appVersion, window.navigator.appName и window.navigator.userAgent используются для "снифинга браузера" кодом. Т.е. скрипты которые пытаются выяснить, какой браузер вы используете, и настроить страницы соответственно.Это приводит к ситуации, когда браузерам приходится возвращать поддельное значение этого свойства, что бы не быть заблокированными некоторыми веб-сайтами.

+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-appVersion', 'NavigatorID.appVersion')}}{{Spec2('HTML WHATWG')}}Изначальное описание.
+ +

Доступность в браузере

+ +

{{Compat("api.NavigatorID.appVersion")}}

diff --git a/files/ru/orphaned/web/api/navigatorid/index.html b/files/ru/orphaned/web/api/navigatorid/index.html new file mode 100644 index 0000000000..74e91ec15d --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorid/index.html @@ -0,0 +1,79 @@ +--- +title: NavigatorID +slug: orphaned/Web/API/NavigatorID +translation_of: Web/API/NavigatorID +original_slug: Web/API/NavigatorID +--- +

{{APIRef("HTML DOM")}}

+ +

Интерфейс NavigatorID содержит методы и свойства, позволяющие идентифицировать браузер.

+ +

В нем нет объекта типа NavigatorID, но другие интерфейсы, такие как {{domxref("Navigator")}} или {{domxref("WorkerNavigator")}}, реализуют его.

+ +

Свойства

+ +

Интерфейс NavigatorID не наследует никаких других свойств.

+ +
+
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{deprecated_inline}}
+
Всегда возвращает 'Mozilla', в других браузерах. Это свойство сохраняется только для целей совместимости.
+
{{domxref("NavigatorID.appName")}} {{readonlyInline}} {{deprecated_inline}}
+
Возвращает официальное название браузера. Не полагайтесь на это свойство, чтобы получить нужное значение.
+
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}} {{deprecated_inline}}
+
Возвращает версию браузера в виде строки. Не полагайтесь на это свойство, чтобы получить нужное значение.
+
{{domxref("NavigatorID.platform")}} {{readonlyInline}} {{deprecated_inline}}
+
+
+
Возвращает строку, представляющую собой платформу браузера. Не полагайтесь на это свойство, чтобы получить нужное значение.
+
+
+
{{domxref("NavigatorID.product")}} {{readonlyInline}} {{deprecated_inline}}
+
Всегда возвращает 'Gecko' в других браузерах. Это свойство сохраняется только для целей совместимости.
+
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
+
Возвращает строку пользовательского агента (user agent) для текущего браузера.
+
+ +

Методы

+ +

Интерфейс NavigatorID не наследует других методов.

+ +
+
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}}
+
Всегда возвращает false. Функции JavaScript taint/untaint были удалены в JavaScript 1.2. Этот метод сохраняется только для целей совместимости. Not available in workers.
+
+ +

Спецификация

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}Добавлено свойство appCodeName и метод taintEnabled() для совместимости.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}Первоначальная спецификация.
+ +

Совместимость в браузерах

+ + + +

{{Compat("api.NavigatorID")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatorid/platform/index.html b/files/ru/orphaned/web/api/navigatorid/platform/index.html new file mode 100644 index 0000000000..a7d273814d --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorid/platform/index.html @@ -0,0 +1,62 @@ +--- +title: NavigatorID.platform +slug: orphaned/Web/API/NavigatorID/platform +tags: + - API + - Navigator + - NavigatorID + - Property + - Refe + - platform +translation_of: Web/API/NavigatorID/platform +original_slug: Web/API/NavigatorID/platform +--- +

{{ APIRef("HTML DOM") }}

+ +

Возвращает строку, показывающую платформу браузера. Спецификация позволяет браузерам всегда возвращает пустую строку, так что не стоит полагаться на это свойство, чтобы получить надёжный ответ.

+ +

Синтаксис

+ +
platform = navigator.platform
+
+ +

Значение

+ +

{{domxref("DOMString")}}, идентифицирующий платформу, на которой работает браузер, или выводит пустую строку, если браузер отказывается (или не может) идентифицировать платформу. platform - это строка, которая должна быть пустой строкой или строкой, представляющей платформу, на которой выполняется браузер.

+ +

Например: "MacIntel", "Win32", "FreeBSD i386", "WebTV OS"

+ +

Пример

+ +
console.log(navigator.platform);
+ +

Примечание

+ +

Большинство браузеров, включая Chrome, Edge и Firefox 63 и более поздние, возвращают «Win32», даже если работают в 64-разрядной версии Windows. Internet Explorer и версии Firefox до версии 63 по-прежнему сообщают «Win64».

+ +

В Firefox, general.platform.override можно использовать для переопределения значения, которое в противном случае было бы возвращено этим свойством.

+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-platform', 'NavigatorID.platform')}}{{Spec2('HTML WHATWG')}}Текущее описание.
+ +

Доступность в браузере

+ +

{{Compat("api.NavigatorID.platform")}}

+ +
 
diff --git a/files/ru/orphaned/web/api/navigatorid/product/index.html b/files/ru/orphaned/web/api/navigatorid/product/index.html new file mode 100644 index 0000000000..ff4d9d73a7 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorid/product/index.html @@ -0,0 +1,69 @@ +--- +title: NavigatorID.product +slug: orphaned/Web/API/NavigatorID/product +translation_of: Web/API/NavigatorID/product +original_slug: Web/API/NavigatorID/product +--- +

{{APIRef("HTML DOM")}}{{deprecated_header}}

+ +

Свойство NavigatorID.product возвращает имя продукта текущего браузера.

+ +
Примечание: Не полагайтесь на это свойство для получения настоящего имени продукта. Все браузеры возвращает "Gecko" в качестве значения этого свойства.
+ +

Синтаксис

+ +
productName = window.navigator.product
+
+ +

Значение

+ +

{{domxref("DOMString")}}.

+ +

Пример

+ +
<script>
+function prod() {
+  dt = document.getElementById("d");
+  dt.innerHTML = window.navigator.product;
+}
+</script>
+
+<button onclick="prod();">product</button>
+<div id="d"> </div>
+<!-- вернёт "Gecko" -->
+
+ +

Примечание

+ +

В браузерах на основе Gecko  product соответствует части полной строки агента пользователя которая идёт первой после платформы. В пользовательском агенте Netscape 6.1, к примеру, product это "Gecko" а полная строка пользовательского агента будет: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1

+ +

В браузере на основе WebKit product вернёт "Gecko", хотя часть полной строки пользовательского агента непосредственно после после платформы на самом деле следующая: (KHTML, like Gecko).

+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-product', 'NavigatorID.product')}}{{Spec2('HTML WHATWG')}}Действующее описание
+ +

Доступность в браузере

+ +

{{Compat("api.NavigatorID.product")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatorid/taintenabled/index.html b/files/ru/orphaned/web/api/navigatorid/taintenabled/index.html new file mode 100644 index 0000000000..9e351e119a --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorid/taintenabled/index.html @@ -0,0 +1,53 @@ +--- +title: NavigatorID.taintEnabled() +slug: orphaned/Web/API/NavigatorID/taintEnabled +translation_of: Web/API/NavigatorID/taintEnabled +original_slug: Web/API/NavigatorID/taintEnabled +--- +
{{APIRef("HTML DOM")}}{{deprecated_header}}
+ +

Метод NavigatorID.taintEnabled() всегда возвращает false.

+ +
Примечание: Taint был метод защиты используемый в JavaScript 1.2. Он давно был удалён; этот метод остаётся только для поддержания совместимости с очень старыми скриптами.
+ +

Синтаксис

+ +
result = window.navigator.taintEnabled()
+
+ +

Пример

+ +
alert(window.navigator.taintEnabled());
+// returns false
+
+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', 'webappapis.html#dom-navigator-taintEnabled', 'NavigatorID.taintEnabled')}}{{Spec2('HTML WHATWG')}}Изначальное описание
+ +

Доступность в браузере

+ + + +

{{Compat("api.NavigatorID.taintEnabled")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatorid/useragent/index.html b/files/ru/orphaned/web/api/navigatorid/useragent/index.html new file mode 100644 index 0000000000..f3fe004e91 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorid/useragent/index.html @@ -0,0 +1,77 @@ +--- +title: NavigatorID.userAgent +slug: orphaned/Web/API/NavigatorID/userAgent +translation_of: Web/API/NavigatorID/userAgent +original_slug: Web/API/NavigatorID/userAgent +--- +

{{ApiRef("HTML DOM")}}

+ +

Возвращает строку агента пользователя текущего браузера.

+ +

Синтаксис

+ +
var ua = window.navigator.userAgent;
+
+ +

Значение

+ +

ua хранит строковое значение агента пользователя для текущего браузера.

+ +

Свойство window.navigator.userAgent для чтения и записи; оно не имеет значения по умолчанию.

+ +

Строка пользовательского агента основана на формальной структуре, которая может быть разложена на несколько кусков информации. Каждый из этих кусков информации происходит от других свойств navigator, которые также устанавливаются пользователем. Браузеры, основанные на Gecko, подчиняются следующей структуре:

+ +
userAgent = appCodeName/appVersion number (Platform; Security; OS-or-CPU;
+Localization; rv: revision-version-number) product/productSub
+Application-Name Application-Name-version
+
+ +

Пример

+ +
alert(window.navigator.userAgent)
+// alerts "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"
+
+ +

Примечание

+ +

Идентификация браузера на основе обнаружения строки агента пользователя является ненадёжной и не рекомендуется, так как строка пользовательского агента может быть изменена пользователем. Например:

+ + + +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-useragent', 'NavigatorID.userAgent')}}{{Spec2('HTML WHATWG')}}Начальное описание
+ +

Доступность в браузере

+ +

{{Compat("api.NavigatorID.userAgent")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatorlanguage/index.html b/files/ru/orphaned/web/api/navigatorlanguage/index.html new file mode 100644 index 0000000000..d4dc8e6285 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorlanguage/index.html @@ -0,0 +1,60 @@ +--- +title: NavigatorLanguage +slug: orphaned/Web/API/NavigatorLanguage +translation_of: Web/API/NavigatorLanguage +original_slug: Web/API/NavigatorLanguage +--- +

{{APIRef("HTML DOM")}}

+ +

NavigatorLanguage содержит методы и свойства, связанные с языком навигатора.

+ +

В нем нет объекта типа NavigatorLanguage, но другие интерфейсы, такие как {{domxref("Navigator")}} или {{domxref("WorkerNavigator")}}, реализуют его.

+ +

Свойства

+ +

Интерфейс NavigatorLanguage не наследует других свойств.

+ +
+
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
+
Возвращает {{domxref("DOMString")}} представляющий собой предпочитаемый язык пользователя, как правило, язык пользовательского интерфейса браузера.
+
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
+
Возвращает массив {{domxref("DOMString")}} представляющий собой языки известные пользователю в порядке предпочтения.
+
+ +

Методы

+ +

Интерфейс NavigatorLanguage ничего не реализовывает и ничего не наследует.

+ +

Спецификации

+ + + + + + + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Со времени последнего снимка {{SpecName('HTML5 W3C')}}, языковое свойство было добавлено.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Первоначальная спецификация; снимок ранней версии {{SpecName('HTML WHATWG')}}.
+ +

Доступность в браузерах

+ +

{{Compat("api.NavigatorLanguage")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatorlanguage/language/index.html b/files/ru/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..cd20d121fb --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,53 @@ +--- +title: NavigatorLanguage.language +slug: orphaned/Web/API/NavigatorLanguage/language +translation_of: Web/API/NavigatorLanguage/language +original_slug: Web/API/NavigatorLanguage/language +--- +

{{ APIRef("HTML DOM") }}

+ +

Свойство NavigatorLanguage.language только для чтения, оно возвращает строку, представляющую предпочитаемый пользователем язык, как правило это язык пользовательского интерфейса браузера.

+ +

Синтаксис

+ +
lang = globalObj.navigator.language
+
+ +

Значение

+ +

Строка представляющая версию языка которая определена в RFC 4646. Примеры валидных языковых кодов включают "en", "EN-US", "FR", "es-ES" и т.д.

+ +

Пример

+ +
if ( window.navigator.language.slice(0, 2) !== "en" ) {
+ doLangSelect(window.navigator.language);
+}
+
+ +

Спецификации

+ + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{ SpecName('HTML5 Web application', '#dom-navigator-language', 'navigator.language') }}{{ Spec2('HTML5.1') }}Начальное описание.
+ +

Доступность в браузерах

+ +

{{Compat("api.NavigatorLanguage.language")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatorlanguage/languages/index.html b/files/ru/orphaned/web/api/navigatorlanguage/languages/index.html new file mode 100644 index 0000000000..ad1d56c7fd --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorlanguage/languages/index.html @@ -0,0 +1,55 @@ +--- +title: NavigatorLanguage.languages +slug: orphaned/Web/API/NavigatorLanguage/languages +translation_of: Web/API/NavigatorLanguage/languages +original_slug: Web/API/NavigatorLanguage/languages +--- +

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

+ +

Свойство NavigatorLanguage.languages только для чтения, возвращающее массив {{domxref("DOMString")}} показывающее предпочитаемые пользователем языки. language описывает использование языковых тегов BCP 47. В возвращаемом массиве они отсортированы по предпочтению с наиболее предпочитаемые языком в первую очередь.

+ +

Значение {{domxref("NavigatorLanguage.language","navigator.language")}} это первый элемент в полученном массиве.

+ +

Когда значение изменится, так как изменится предпочитаемый язык пользователя {{event("languagechange")}} событие уведомит объект {{domxref("Window")}}.

+ +

HTTP Заголовок Accept-Language в каждом HTTP запросе от браузера пользователя, использует такое же значение как и в свойстве navigator.languages кроме дополнительного qvalues (quality values) поля (например: en-US;q=0.8).

+ +

Синтаксис

+ +
preferredLanguages = globalObj.navigator.languages
+
+ +

Примеры

+ +
navigator.language   //"en-US"
+navigator.languages  //["en-US", "zh-CN", "ja-JP"]
+
+ +

Спецификации

+ + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{ SpecName('HTML5.1', '#dom-navigator-languages', 'NavigatorLanguage.languages') }}{{ Spec2('HTML5.1') }}Начальное описание
+ +

Совместимость с браузерами

+ +

{{Compat("api.NavigatorLanguage.languages")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatoronline/index.html b/files/ru/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..62e0cffa13 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,58 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

Интерфейс NavigatorOnLine содержит методы и свойства, связанные со статусом подключения браузера.

+ +

В NavigatorOnLine нет объектов другого типа, но другие интерфейсы, {{domxref("Navigator")}} или {{domxref("WorkerNavigator")}}, реализуют его.

+ +

Свойства

+ +

Интерфейс NavigatorOnLine не наследует других свойств.

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
Возвращает {{domxref("Boolean")}}, показывающий работает ли браузер в сети.
+
+ +

Методы

+ +

Интерфейс NavigatorOnLine не имеет никакой реализации и не наследует никакой метод.

+ +

Спецификации

+ + + + + + + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}Без изменений с последнего снимка,{{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Снимок {{SpecName('HTML WHATWG')}} с первоначальной спецификацией.
+ +

Совместимость в браузерах

+ +

{{Compat("api.NavigatorOnLine")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatoronline/online/index.html b/files/ru/orphaned/web/api/navigatoronline/online/index.html new file mode 100644 index 0000000000..170a472034 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatoronline/online/index.html @@ -0,0 +1,67 @@ +--- +title: NavigatorOnLine.onLine +slug: orphaned/Web/API/NavigatorOnLine/onLine +translation_of: Web/API/NavigatorOnLine/onLine +original_slug: Web/API/NavigatorOnLine/onLine +--- +

{{ApiRef("HTML DOM")}}

+ +

Возвращает сетевой статус браузера. Свойство возвращает логическое (boolean) значение, true означает online и false означает offline.Свойство обновляется всякий раз, когда способность браузера к подключению к сети изменится. Обновление происходит тогда, когда пользователь следует по ссылке или когда скрипт запрашивает удалённую страницу. Например, свойство должно вернуть false, когда пользователь кликает по ссылке, вскоре после потери подключения к интернету.

+ +

Браузеры реализуют это свойство по-разному.

+ +

В Chrome и Safari, если браузер не может соединиться с локальной сетью (LAN) или роутером, это будет означать offline; во всех остальных случаях вернётся true.Таким образом, мы можем предположить что браузер не в сети, когда возвращаемое значение false, но вы не можете предположить  что значение true обязательно обозначает что браузер может получить доступ к интернету. Вы можете получать ложные срабатывания, например, в случаях, когда компьютер под управлением программного обеспечения для виртуализации, которое имеет виртуальные сетевые адаптеры, которые всегда "Подключено". Поэтому, если вы действительно хотите, чтобы определять состояние браузера, вы должны разработать дополнительные средства проверки. Чтобы узнать больше, смотрите статью HTML5 Working Off the Grid.

+ +

В Firefox и Internet Explorer, переключение браузера в автономный режим посылает false значение. Во всех остальных случаях возвращается значение true.

+ +

Вы можете увидеть изменения в состоянии сети путём обработки событий window.ononline и window.onoffline.

+ +

Синтаксис

+ +
online = window.navigator.onLine;
+
+ +

Описание

+ +

online это логическое true или false.

+ +

Пример

+ +

Посмотрите на действующий пример.

+ +

Для проверки находитесь ли вы в сети, вызовите window.navigator.onLine, как показано в примере:

+ +
if (navigator.onLine) {
+  alert('online');
+} else {
+  alert('offline');
+}
+ +

Если браузер не поддерживает navigator.onLine в примере выше, то всегда будет false/undefined.

+ +

Чтобы увидеть изменения в состоянии сети, используйте addEventListener для обработки событий window.ononline и window.onoffline, как показано в примере:

+ +
window.addEventListener("offline", function(e) {alert("offline");})
+
+window.addEventListener("online", function(e) {alert("online");})
+
+ +

Совместимость в браузерах

+ +

{{Compat("api.NavigatorOnLine.onLine")}}

+ +

Примечание

+ +

См Online/Offline события для более детального описания этого свойства, а также новых возможностей в автономном режимевведённых в Firefox 3.

+ +

Спецификация

+ +

Описана в рабочем проекте HTML 5

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatorplugins/index.html b/files/ru/orphaned/web/api/navigatorplugins/index.html new file mode 100644 index 0000000000..28a037f432 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorplugins/index.html @@ -0,0 +1,58 @@ +--- +title: NavigatorPlugins +slug: orphaned/Web/API/NavigatorPlugins +translation_of: Web/API/NavigatorPlugins +original_slug: Web/API/NavigatorPlugins +--- +

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

+ +

Интерфейс NavigatorPlugins содержит методы и свойства, связанные с установленными плагинами в браузере.

+ +

NavigatorPlugins не содержит в себе объектов другого типа, но другие интерфейсы, такие как {{domxref("Navigator")}} реализуют его.

+ +

Свойства

+ +
+
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
+
Возвращает {{domxref("MimeTypeArray")}} листинг MIME типов поддерживаемые браузером.
+
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
+
Возвращает листинг плагинов {{domxref("PluginArray")}}, установленных в браузере.
+
+ +

Методы

+ +

Интерфейс NavigatorPlugins не наследует никаких методов.

+ +
+
{{domxref("NavigatorPlugins.javaEnabled")}} {{readonlyInline}}{{experimental_inline}}
+
Возвращает флаг {{domxref("Boolean")}} показывающий включён ли java в браузере или нет.
+
+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Начальное определение
+ +

Доступность в браузерах

+ +

{{Compat("api.NavigatorPlugins")}}

+ +

Смотрите также

+ + diff --git a/files/ru/orphaned/web/api/navigatorplugins/javaenabled/index.html b/files/ru/orphaned/web/api/navigatorplugins/javaenabled/index.html new file mode 100644 index 0000000000..90916689f4 --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorplugins/javaenabled/index.html @@ -0,0 +1,29 @@ +--- +title: NavigatorPlugins.javaEnabled() +slug: orphaned/Web/API/NavigatorPlugins/javaEnabled +translation_of: Web/API/NavigatorPlugins/javaEnabled +original_slug: Web/API/NavigatorPlugins/javaEnabled +--- +

{{ APIRef("HTML DOM") }}

+ +

Этот метод показывает включён ли java в текущем браузере или нет.

+ +

Синтаксис

+ +
result = window.navigator.javaEnabled()
+
+ +

Пример

+ +
if (window.navigator.javaEnabled()) {
+   // browser has java
+}
+
+ +

Примечание

+ +

Возвращаемое значение этого метода показывает положение java, включён ли или выключен - не предполагает поддержку java браузером полностью.

+ +

Спецификация

+ +

Не является частью какой-либо спецификации.

diff --git a/files/ru/orphaned/web/api/navigatorplugins/mimetypes/index.html b/files/ru/orphaned/web/api/navigatorplugins/mimetypes/index.html new file mode 100644 index 0000000000..3c2ef1481d --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorplugins/mimetypes/index.html @@ -0,0 +1,40 @@ +--- +title: NavigatorPlugins.mimeTypes +slug: orphaned/Web/API/NavigatorPlugins/mimeTypes +translation_of: Web/API/NavigatorPlugins/mimeTypes +original_slug: Web/API/NavigatorPlugins/mimeTypes +--- +
{{ ApiRef("HTML DOM") }}
+ +
 
+ +

Резюме

+ +

Возвращает объект {{domxref("MimeTypeArray")}}, который содержит список объектов {{domxref("MimeType")}}, представляющий собой MIME-типы, известные браузеру.

+ +

Синтаксис

+ +
mimeTypes = navigator.mimeTypes;
+
+ +

mimeTypes - объект MimeTypeArray, который имеет свойство lengthа также методы item(index) и namedItem(name).

+ +

Примеры

+ +
function isJavaPresent() {
+  return 'application/x-java-applet' in navigator.mimeTypes;
+}
+
+function getJavaPluginDescription() {
+  var mimetype = navigator.mimeTypes['application/x-java-applet'];
+  if (mimetype === undefined) {
+    // no Java plugin present
+    return undefined;
+  }
+  return mimetype.enabledPlugin.description;
+}
+
+ +

Спецификация

+ +

Не является частью какой-либо спецификации.

diff --git a/files/ru/orphaned/web/api/navigatorplugins/plugins/index.html b/files/ru/orphaned/web/api/navigatorplugins/plugins/index.html new file mode 100644 index 0000000000..6ad68921fb --- /dev/null +++ b/files/ru/orphaned/web/api/navigatorplugins/plugins/index.html @@ -0,0 +1,64 @@ +--- +title: NavigatorPlugins.plugins +slug: orphaned/Web/API/NavigatorPlugins/plugins +translation_of: Web/API/NavigatorPlugins/plugins +original_slug: Web/API/NavigatorPlugins/plugins +--- +

{{APIRef("HTML DOM")}}

+ +

Возвращает объект {{domxref("PluginArray")}}, список плагинов установленных в приложении.

+ +
Приложения, которые должны проверять наличие плагинов у браузера должны запросить navigator.plugins или {{domxref("navigator.mimeTypes")}} с точным названием плагина, а не перебирать массив navigator.plugins сравнения имя каждого плагина. Это изменение конфиденциальности не отключает все плагины; оно просто скрывает некоторые имена плагинов от перебора.
+ +

Синтаксис

+ +
var plugins = navigator.plugins;
+
+ +

plugins используется для доступа к объекту {{domxref("Plugin")}} или по имени, или как элемент массива..

+ +

Возвращаемое значение не массив JavaScript, но оно имеет свойство размера и поддерживает доступ к индивидуальным элементам с использованием квадратных скобок (plugins{{mediawiki.external(2)}}), а также через пункт (индекс) и namedItem ("Name") методы.

+ +

Примеры

+ +

Следующий пример функции возвращает версию Flash.

+ +
function getFlashVersion() {
+  var flash = navigator.plugins['Shockwave Flash'];
+  if (flash === undefined) {
+    // flash is not present
+    return undefined;
+  }
+  return flash.version;
+}
+
+ +

Следующий пример выводит информацию об установленном(ых) плагине (ах) для документа высокого уровня.

+ +
var L = navigator.plugins.length;
+
+document.write(
+  L.toString() + " Plugin(s)<br>" +
+  "Name | Filename | description<br>"
+);
+
+for(var i = 0; i < L; i++) {
+  document.write(
+    navigator.plugins[i].name +
+    " | " +
+    navigator.plugins[i].filename +
+    " | " +
+    navigator.plugins[i].description +
+    " | " +
+    navigator.plugins[i].version +
+    "<br>"
+  );
+}
+ +

Примечание

+ +

{{domxref("Plugin")}} объект, предоставляет небольшой интерфейс для получения информации о различных плагинах, установленных в вашем браузере. Список плагинов также доступен если ввести about:plugins в адресную строку браузера.

+ +

Спецификация

+ +

Не определено ни к какой спецификации.

diff --git a/files/ru/web/api/navigatorid/appcodename/index.html b/files/ru/web/api/navigatorid/appcodename/index.html deleted file mode 100644 index 1e5839c68c..0000000000 --- a/files/ru/web/api/navigatorid/appcodename/index.html +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: NavigatorID.appCodeName -slug: Web/API/NavigatorID/appCodeName -translation_of: Web/API/NavigatorID/appCodeName ---- -

{{APIRef("HTML DOM")}}{{deprecated_header}}

- -

NavigatorID.appCodeName всегда возвращает'Mozilla' в любом браузере. Это свойство сохраняется только для совместимости.

- -
Примечание: Не полагаетесь на это свойство, чтобы получить настоящее имя продукта. Все браузеры возвращают "Mozilla" в качестве значения свойства.
- -

Синтаксис

- -
codeName = window.navigator.appCodeName
-
- -

Значение

- -

codeName это внутреннее имя браузера в виде {{domxref("DOMString")}}.

- -

Пример

- -
console.log(window.navigator.appCodeName);
-
- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-appcodename', 'NavigatorID.appCodeName')}}{{Spec2('HTML WHATWG')}}Изначальное определение
- -

Доступность в браузере

- -

{{Compat("api.NavigatorID.appCodeName")}}

- -

Смотрите также

- - - -

 

diff --git a/files/ru/web/api/navigatorid/appname/index.html b/files/ru/web/api/navigatorid/appname/index.html deleted file mode 100644 index 225ddb10a2..0000000000 --- a/files/ru/web/api/navigatorid/appname/index.html +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: NavigatorID.appName -slug: Web/API/NavigatorID/appName -translation_of: Web/API/NavigatorID/appName ---- -

{{APIRef("HTML DOM")}}{{deprecated_header}}

- -

Свойство NavigatorID.appName возвращает название браузера. HTML5 спецификация также позволяет любому браузеру вернуть Netscape", по причине совместимости.

- -

Примечание: не полагайтесь на это свойство для получения корректного имени браузера.В большинстве браузеров (Firefox, как, Chrome, Safari, Opera и Internet Explorer) возвращаемой строкой будет "Netscape".

- -

Синтаксис

- -
appName = window.navigator.appName
-
- -

Значение

- -

appName это имя браузера в виде строки.

- -

Пример

- -
alert(window.navigator.appName);
-// показывает имя браузера.
-
- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-appName', 'NavigatorID.appName')}}{{Spec2('HTML WHATWG')}}Изначальное описание
- -

Доступность в браузере

- -

{{Compat("api.NavigatorID.appName")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatorid/appversion/index.html b/files/ru/web/api/navigatorid/appversion/index.html deleted file mode 100644 index c163934aa2..0000000000 --- a/files/ru/web/api/navigatorid/appversion/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: NavigatorID.appVersion -slug: Web/API/NavigatorID/appVersion -translation_of: Web/API/NavigatorID/appVersion ---- -

{{APIRef("HTML DOM")}}{{deprecated_header}}

- -

Возвращает версию браузера в виде строки. Это может быть либо обычный номер версии, например, "5.0" или номер версии с более детальной информацией. Спецификация HTML5 позволяет любому браузеру вернуть "4,0", по причине совместимости.

- -
Примечание: Не полагайтесь на это свойство для получения правильной версии браузера. В браузерах на основе Geko (таких как Firefox), и основанных на WebKit (таких как Chrome и Safari) возвращаемое значение начинается с "5.0" с последующей информацией о платформе. В Opera 10 и/или более новой версии, возвращаемое значение не соответствует актуальной версии браузера.
- -

Синтаксис

- -
window.navigator.appVersion
-
- -

Значение

- -

ver номер версии браузера в виде {{domxref("DOMString")}}.

- -

Пример

- -
alert("Your browser version is reported as " + navigator.appVersion);
-
- -

Примечание

- -

Свойство window.navigator.userAgent может содержать номер версии (например  "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1"), но вы должны быть в курсе того как легко изменить строку пользовательского агента (user agent) и "обмануть" другие браузеры, платформы или пользовательские агенты, а также опрометчивых вендоров браузеров самими этими свойствами.

- -

Свойства window.navigator.appVersion, window.navigator.appName и window.navigator.userAgent используются для "снифинга браузера" кодом. Т.е. скрипты которые пытаются выяснить, какой браузер вы используете, и настроить страницы соответственно.Это приводит к ситуации, когда браузерам приходится возвращать поддельное значение этого свойства, что бы не быть заблокированными некоторыми веб-сайтами.

- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-appVersion', 'NavigatorID.appVersion')}}{{Spec2('HTML WHATWG')}}Изначальное описание.
- -

Доступность в браузере

- -

{{Compat("api.NavigatorID.appVersion")}}

diff --git a/files/ru/web/api/navigatorid/index.html b/files/ru/web/api/navigatorid/index.html deleted file mode 100644 index b539aa91f4..0000000000 --- a/files/ru/web/api/navigatorid/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: NavigatorID -slug: Web/API/NavigatorID -translation_of: Web/API/NavigatorID ---- -

{{APIRef("HTML DOM")}}

- -

Интерфейс NavigatorID содержит методы и свойства, позволяющие идентифицировать браузер.

- -

В нем нет объекта типа NavigatorID, но другие интерфейсы, такие как {{domxref("Navigator")}} или {{domxref("WorkerNavigator")}}, реализуют его.

- -

Свойства

- -

Интерфейс NavigatorID не наследует никаких других свойств.

- -
-
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{deprecated_inline}}
-
Всегда возвращает 'Mozilla', в других браузерах. Это свойство сохраняется только для целей совместимости.
-
{{domxref("NavigatorID.appName")}} {{readonlyInline}} {{deprecated_inline}}
-
Возвращает официальное название браузера. Не полагайтесь на это свойство, чтобы получить нужное значение.
-
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}} {{deprecated_inline}}
-
Возвращает версию браузера в виде строки. Не полагайтесь на это свойство, чтобы получить нужное значение.
-
{{domxref("NavigatorID.platform")}} {{readonlyInline}} {{deprecated_inline}}
-
-
-
Возвращает строку, представляющую собой платформу браузера. Не полагайтесь на это свойство, чтобы получить нужное значение.
-
-
-
{{domxref("NavigatorID.product")}} {{readonlyInline}} {{deprecated_inline}}
-
Всегда возвращает 'Gecko' в других браузерах. Это свойство сохраняется только для целей совместимости.
-
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
-
Возвращает строку пользовательского агента (user agent) для текущего браузера.
-
- -

Методы

- -

Интерфейс NavigatorID не наследует других методов.

- -
-
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}}
-
Всегда возвращает false. Функции JavaScript taint/untaint были удалены в JavaScript 1.2. Этот метод сохраняется только для целей совместимости. Not available in workers.
-
- -

Спецификация

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}Добавлено свойство appCodeName и метод taintEnabled() для совместимости.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}Первоначальная спецификация.
- -

Совместимость в браузерах

- - - -

{{Compat("api.NavigatorID")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatorid/platform/index.html b/files/ru/web/api/navigatorid/platform/index.html deleted file mode 100644 index 37e7bcda2d..0000000000 --- a/files/ru/web/api/navigatorid/platform/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: NavigatorID.platform -slug: Web/API/NavigatorID/platform -tags: - - API - - Navigator - - NavigatorID - - Property - - Refe - - platform -translation_of: Web/API/NavigatorID/platform ---- -

{{ APIRef("HTML DOM") }}

- -

Возвращает строку, показывающую платформу браузера. Спецификация позволяет браузерам всегда возвращает пустую строку, так что не стоит полагаться на это свойство, чтобы получить надёжный ответ.

- -

Синтаксис

- -
platform = navigator.platform
-
- -

Значение

- -

{{domxref("DOMString")}}, идентифицирующий платформу, на которой работает браузер, или выводит пустую строку, если браузер отказывается (или не может) идентифицировать платформу. platform - это строка, которая должна быть пустой строкой или строкой, представляющей платформу, на которой выполняется браузер.

- -

Например: "MacIntel", "Win32", "FreeBSD i386", "WebTV OS"

- -

Пример

- -
console.log(navigator.platform);
- -

Примечание

- -

Большинство браузеров, включая Chrome, Edge и Firefox 63 и более поздние, возвращают «Win32», даже если работают в 64-разрядной версии Windows. Internet Explorer и версии Firefox до версии 63 по-прежнему сообщают «Win64».

- -

В Firefox, general.platform.override можно использовать для переопределения значения, которое в противном случае было бы возвращено этим свойством.

- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-platform', 'NavigatorID.platform')}}{{Spec2('HTML WHATWG')}}Текущее описание.
- -

Доступность в браузере

- -

{{Compat("api.NavigatorID.platform")}}

- -
 
diff --git a/files/ru/web/api/navigatorid/product/index.html b/files/ru/web/api/navigatorid/product/index.html deleted file mode 100644 index 728c92e985..0000000000 --- a/files/ru/web/api/navigatorid/product/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: NavigatorID.product -slug: Web/API/NavigatorID/product -translation_of: Web/API/NavigatorID/product ---- -

{{APIRef("HTML DOM")}}{{deprecated_header}}

- -

Свойство NavigatorID.product возвращает имя продукта текущего браузера.

- -
Примечание: Не полагайтесь на это свойство для получения настоящего имени продукта. Все браузеры возвращает "Gecko" в качестве значения этого свойства.
- -

Синтаксис

- -
productName = window.navigator.product
-
- -

Значение

- -

{{domxref("DOMString")}}.

- -

Пример

- -
<script>
-function prod() {
-  dt = document.getElementById("d");
-  dt.innerHTML = window.navigator.product;
-}
-</script>
-
-<button onclick="prod();">product</button>
-<div id="d"> </div>
-<!-- вернёт "Gecko" -->
-
- -

Примечание

- -

В браузерах на основе Gecko  product соответствует части полной строки агента пользователя которая идёт первой после платформы. В пользовательском агенте Netscape 6.1, к примеру, product это "Gecko" а полная строка пользовательского агента будет: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1

- -

В браузере на основе WebKit product вернёт "Gecko", хотя часть полной строки пользовательского агента непосредственно после после платформы на самом деле следующая: (KHTML, like Gecko).

- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-product', 'NavigatorID.product')}}{{Spec2('HTML WHATWG')}}Действующее описание
- -

Доступность в браузере

- -

{{Compat("api.NavigatorID.product")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatorid/taintenabled/index.html b/files/ru/web/api/navigatorid/taintenabled/index.html deleted file mode 100644 index 14a0dcf309..0000000000 --- a/files/ru/web/api/navigatorid/taintenabled/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: NavigatorID.taintEnabled() -slug: Web/API/NavigatorID/taintEnabled -translation_of: Web/API/NavigatorID/taintEnabled ---- -
{{APIRef("HTML DOM")}}{{deprecated_header}}
- -

Метод NavigatorID.taintEnabled() всегда возвращает false.

- -
Примечание: Taint был метод защиты используемый в JavaScript 1.2. Он давно был удалён; этот метод остаётся только для поддержания совместимости с очень старыми скриптами.
- -

Синтаксис

- -
result = window.navigator.taintEnabled()
-
- -

Пример

- -
alert(window.navigator.taintEnabled());
-// returns false
-
- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', 'webappapis.html#dom-navigator-taintEnabled', 'NavigatorID.taintEnabled')}}{{Spec2('HTML WHATWG')}}Изначальное описание
- -

Доступность в браузере

- - - -

{{Compat("api.NavigatorID.taintEnabled")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatorid/useragent/index.html b/files/ru/web/api/navigatorid/useragent/index.html deleted file mode 100644 index fc7132708d..0000000000 --- a/files/ru/web/api/navigatorid/useragent/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: NavigatorID.userAgent -slug: Web/API/NavigatorID/userAgent -translation_of: Web/API/NavigatorID/userAgent ---- -

{{ApiRef("HTML DOM")}}

- -

Возвращает строку агента пользователя текущего браузера.

- -

Синтаксис

- -
var ua = window.navigator.userAgent;
-
- -

Значение

- -

ua хранит строковое значение агента пользователя для текущего браузера.

- -

Свойство window.navigator.userAgent для чтения и записи; оно не имеет значения по умолчанию.

- -

Строка пользовательского агента основана на формальной структуре, которая может быть разложена на несколько кусков информации. Каждый из этих кусков информации происходит от других свойств navigator, которые также устанавливаются пользователем. Браузеры, основанные на Gecko, подчиняются следующей структуре:

- -
userAgent = appCodeName/appVersion number (Platform; Security; OS-or-CPU;
-Localization; rv: revision-version-number) product/productSub
-Application-Name Application-Name-version
-
- -

Пример

- -
alert(window.navigator.userAgent)
-// alerts "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"
-
- -

Примечание

- -

Идентификация браузера на основе обнаружения строки агента пользователя является ненадёжной и не рекомендуется, так как строка пользовательского агента может быть изменена пользователем. Например:

- - - -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-navigator-useragent', 'NavigatorID.userAgent')}}{{Spec2('HTML WHATWG')}}Начальное описание
- -

Доступность в браузере

- -

{{Compat("api.NavigatorID.userAgent")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatorlanguage/index.html b/files/ru/web/api/navigatorlanguage/index.html deleted file mode 100644 index bcb132b5a4..0000000000 --- a/files/ru/web/api/navigatorlanguage/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: NavigatorLanguage -slug: Web/API/NavigatorLanguage -translation_of: Web/API/NavigatorLanguage ---- -

{{APIRef("HTML DOM")}}

- -

NavigatorLanguage содержит методы и свойства, связанные с языком навигатора.

- -

В нем нет объекта типа NavigatorLanguage, но другие интерфейсы, такие как {{domxref("Navigator")}} или {{domxref("WorkerNavigator")}}, реализуют его.

- -

Свойства

- -

Интерфейс NavigatorLanguage не наследует других свойств.

- -
-
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
-
Возвращает {{domxref("DOMString")}} представляющий собой предпочитаемый язык пользователя, как правило, язык пользовательского интерфейса браузера.
-
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
-
Возвращает массив {{domxref("DOMString")}} представляющий собой языки известные пользователю в порядке предпочтения.
-
- -

Методы

- -

Интерфейс NavigatorLanguage ничего не реализовывает и ничего не наследует.

- -

Спецификации

- - - - - - - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}Со времени последнего снимка {{SpecName('HTML5 W3C')}}, языковое свойство было добавлено.
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}Первоначальная спецификация; снимок ранней версии {{SpecName('HTML WHATWG')}}.
- -

Доступность в браузерах

- -

{{Compat("api.NavigatorLanguage")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatorlanguage/language/index.html b/files/ru/web/api/navigatorlanguage/language/index.html deleted file mode 100644 index dfcaf794d0..0000000000 --- a/files/ru/web/api/navigatorlanguage/language/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: NavigatorLanguage.language -slug: Web/API/NavigatorLanguage/language -translation_of: Web/API/NavigatorLanguage/language ---- -

{{ APIRef("HTML DOM") }}

- -

Свойство NavigatorLanguage.language только для чтения, оно возвращает строку, представляющую предпочитаемый пользователем язык, как правило это язык пользовательского интерфейса браузера.

- -

Синтаксис

- -
lang = globalObj.navigator.language
-
- -

Значение

- -

Строка представляющая версию языка которая определена в RFC 4646. Примеры валидных языковых кодов включают "en", "EN-US", "FR", "es-ES" и т.д.

- -

Пример

- -
if ( window.navigator.language.slice(0, 2) !== "en" ) {
- doLangSelect(window.navigator.language);
-}
-
- -

Спецификации

- - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{ SpecName('HTML5 Web application', '#dom-navigator-language', 'navigator.language') }}{{ Spec2('HTML5.1') }}Начальное описание.
- -

Доступность в браузерах

- -

{{Compat("api.NavigatorLanguage.language")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatorlanguage/languages/index.html b/files/ru/web/api/navigatorlanguage/languages/index.html deleted file mode 100644 index 1d7830d4f5..0000000000 --- a/files/ru/web/api/navigatorlanguage/languages/index.html +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: NavigatorLanguage.languages -slug: Web/API/NavigatorLanguage/languages -translation_of: Web/API/NavigatorLanguage/languages ---- -

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

- -

Свойство NavigatorLanguage.languages только для чтения, возвращающее массив {{domxref("DOMString")}} показывающее предпочитаемые пользователем языки. language описывает использование языковых тегов BCP 47. В возвращаемом массиве они отсортированы по предпочтению с наиболее предпочитаемые языком в первую очередь.

- -

Значение {{domxref("NavigatorLanguage.language","navigator.language")}} это первый элемент в полученном массиве.

- -

Когда значение изменится, так как изменится предпочитаемый язык пользователя {{event("languagechange")}} событие уведомит объект {{domxref("Window")}}.

- -

HTTP Заголовок Accept-Language в каждом HTTP запросе от браузера пользователя, использует такое же значение как и в свойстве navigator.languages кроме дополнительного qvalues (quality values) поля (например: en-US;q=0.8).

- -

Синтаксис

- -
preferredLanguages = globalObj.navigator.languages
-
- -

Примеры

- -
navigator.language   //"en-US"
-navigator.languages  //["en-US", "zh-CN", "ja-JP"]
-
- -

Спецификации

- - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{ SpecName('HTML5.1', '#dom-navigator-languages', 'NavigatorLanguage.languages') }}{{ Spec2('HTML5.1') }}Начальное описание
- -

Совместимость с браузерами

- -

{{Compat("api.NavigatorLanguage.languages")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatoronline/index.html b/files/ru/web/api/navigatoronline/index.html deleted file mode 100644 index 5c0830519b..0000000000 --- a/files/ru/web/api/navigatoronline/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

Интерфейс NavigatorOnLine содержит методы и свойства, связанные со статусом подключения браузера.

- -

В NavigatorOnLine нет объектов другого типа, но другие интерфейсы, {{domxref("Navigator")}} или {{domxref("WorkerNavigator")}}, реализуют его.

- -

Свойства

- -

Интерфейс NavigatorOnLine не наследует других свойств.

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
Возвращает {{domxref("Boolean")}}, показывающий работает ли браузер в сети.
-
- -

Методы

- -

Интерфейс NavigatorOnLine не имеет никакой реализации и не наследует никакой метод.

- -

Спецификации

- - - - - - - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}Без изменений с последнего снимка,{{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Снимок {{SpecName('HTML WHATWG')}} с первоначальной спецификацией.
- -

Совместимость в браузерах

- -

{{Compat("api.NavigatorOnLine")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatoronline/online/index.html b/files/ru/web/api/navigatoronline/online/index.html deleted file mode 100644 index 9cd6c3bf9d..0000000000 --- a/files/ru/web/api/navigatoronline/online/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: NavigatorOnLine.onLine -slug: Web/API/NavigatorOnLine/onLine -translation_of: Web/API/NavigatorOnLine/onLine ---- -

{{ApiRef("HTML DOM")}}

- -

Возвращает сетевой статус браузера. Свойство возвращает логическое (boolean) значение, true означает online и false означает offline.Свойство обновляется всякий раз, когда способность браузера к подключению к сети изменится. Обновление происходит тогда, когда пользователь следует по ссылке или когда скрипт запрашивает удалённую страницу. Например, свойство должно вернуть false, когда пользователь кликает по ссылке, вскоре после потери подключения к интернету.

- -

Браузеры реализуют это свойство по-разному.

- -

В Chrome и Safari, если браузер не может соединиться с локальной сетью (LAN) или роутером, это будет означать offline; во всех остальных случаях вернётся true.Таким образом, мы можем предположить что браузер не в сети, когда возвращаемое значение false, но вы не можете предположить  что значение true обязательно обозначает что браузер может получить доступ к интернету. Вы можете получать ложные срабатывания, например, в случаях, когда компьютер под управлением программного обеспечения для виртуализации, которое имеет виртуальные сетевые адаптеры, которые всегда "Подключено". Поэтому, если вы действительно хотите, чтобы определять состояние браузера, вы должны разработать дополнительные средства проверки. Чтобы узнать больше, смотрите статью HTML5 Working Off the Grid.

- -

В Firefox и Internet Explorer, переключение браузера в автономный режим посылает false значение. Во всех остальных случаях возвращается значение true.

- -

Вы можете увидеть изменения в состоянии сети путём обработки событий window.ononline и window.onoffline.

- -

Синтаксис

- -
online = window.navigator.onLine;
-
- -

Описание

- -

online это логическое true или false.

- -

Пример

- -

Посмотрите на действующий пример.

- -

Для проверки находитесь ли вы в сети, вызовите window.navigator.onLine, как показано в примере:

- -
if (navigator.onLine) {
-  alert('online');
-} else {
-  alert('offline');
-}
- -

Если браузер не поддерживает navigator.onLine в примере выше, то всегда будет false/undefined.

- -

Чтобы увидеть изменения в состоянии сети, используйте addEventListener для обработки событий window.ononline и window.onoffline, как показано в примере:

- -
window.addEventListener("offline", function(e) {alert("offline");})
-
-window.addEventListener("online", function(e) {alert("online");})
-
- -

Совместимость в браузерах

- -

{{Compat("api.NavigatorOnLine.onLine")}}

- -

Примечание

- -

См Online/Offline события для более детального описания этого свойства, а также новых возможностей в автономном режимевведённых в Firefox 3.

- -

Спецификация

- -

Описана в рабочем проекте HTML 5

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatorplugins/index.html b/files/ru/web/api/navigatorplugins/index.html deleted file mode 100644 index bb14f99ec0..0000000000 --- a/files/ru/web/api/navigatorplugins/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: NavigatorPlugins -slug: Web/API/NavigatorPlugins -translation_of: Web/API/NavigatorPlugins ---- -

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

- -

Интерфейс NavigatorPlugins содержит методы и свойства, связанные с установленными плагинами в браузере.

- -

NavigatorPlugins не содержит в себе объектов другого типа, но другие интерфейсы, такие как {{domxref("Navigator")}} реализуют его.

- -

Свойства

- -
-
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
-
Возвращает {{domxref("MimeTypeArray")}} листинг MIME типов поддерживаемые браузером.
-
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
-
Возвращает листинг плагинов {{domxref("PluginArray")}}, установленных в браузере.
-
- -

Методы

- -

Интерфейс NavigatorPlugins не наследует никаких методов.

- -
-
{{domxref("NavigatorPlugins.javaEnabled")}} {{readonlyInline}}{{experimental_inline}}
-
Возвращает флаг {{domxref("Boolean")}} показывающий включён ли java в браузере или нет.
-
- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Начальное определение
- -

Доступность в браузерах

- -

{{Compat("api.NavigatorPlugins")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/navigatorplugins/javaenabled/index.html b/files/ru/web/api/navigatorplugins/javaenabled/index.html deleted file mode 100644 index be4e6f741b..0000000000 --- a/files/ru/web/api/navigatorplugins/javaenabled/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: NavigatorPlugins.javaEnabled() -slug: Web/API/NavigatorPlugins/javaEnabled -translation_of: Web/API/NavigatorPlugins/javaEnabled ---- -

{{ APIRef("HTML DOM") }}

- -

Этот метод показывает включён ли java в текущем браузере или нет.

- -

Синтаксис

- -
result = window.navigator.javaEnabled()
-
- -

Пример

- -
if (window.navigator.javaEnabled()) {
-   // browser has java
-}
-
- -

Примечание

- -

Возвращаемое значение этого метода показывает положение java, включён ли или выключен - не предполагает поддержку java браузером полностью.

- -

Спецификация

- -

Не является частью какой-либо спецификации.

diff --git a/files/ru/web/api/navigatorplugins/mimetypes/index.html b/files/ru/web/api/navigatorplugins/mimetypes/index.html deleted file mode 100644 index d5ebe43956..0000000000 --- a/files/ru/web/api/navigatorplugins/mimetypes/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: NavigatorPlugins.mimeTypes -slug: Web/API/NavigatorPlugins/mimeTypes -translation_of: Web/API/NavigatorPlugins/mimeTypes ---- -
{{ ApiRef("HTML DOM") }}
- -
 
- -

Резюме

- -

Возвращает объект {{domxref("MimeTypeArray")}}, который содержит список объектов {{domxref("MimeType")}}, представляющий собой MIME-типы, известные браузеру.

- -

Синтаксис

- -
mimeTypes = navigator.mimeTypes;
-
- -

mimeTypes - объект MimeTypeArray, который имеет свойство lengthа также методы item(index) и namedItem(name).

- -

Примеры

- -
function isJavaPresent() {
-  return 'application/x-java-applet' in navigator.mimeTypes;
-}
-
-function getJavaPluginDescription() {
-  var mimetype = navigator.mimeTypes['application/x-java-applet'];
-  if (mimetype === undefined) {
-    // no Java plugin present
-    return undefined;
-  }
-  return mimetype.enabledPlugin.description;
-}
-
- -

Спецификация

- -

Не является частью какой-либо спецификации.

diff --git a/files/ru/web/api/navigatorplugins/plugins/index.html b/files/ru/web/api/navigatorplugins/plugins/index.html deleted file mode 100644 index a30df60e7c..0000000000 --- a/files/ru/web/api/navigatorplugins/plugins/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: NavigatorPlugins.plugins -slug: Web/API/NavigatorPlugins/plugins -translation_of: Web/API/NavigatorPlugins/plugins ---- -

{{APIRef("HTML DOM")}}

- -

Возвращает объект {{domxref("PluginArray")}}, список плагинов установленных в приложении.

- -
Приложения, которые должны проверять наличие плагинов у браузера должны запросить navigator.plugins или {{domxref("navigator.mimeTypes")}} с точным названием плагина, а не перебирать массив navigator.plugins сравнения имя каждого плагина. Это изменение конфиденциальности не отключает все плагины; оно просто скрывает некоторые имена плагинов от перебора.
- -

Синтаксис

- -
var plugins = navigator.plugins;
-
- -

plugins используется для доступа к объекту {{domxref("Plugin")}} или по имени, или как элемент массива..

- -

Возвращаемое значение не массив JavaScript, но оно имеет свойство размера и поддерживает доступ к индивидуальным элементам с использованием квадратных скобок (plugins{{mediawiki.external(2)}}), а также через пункт (индекс) и namedItem ("Name") методы.

- -

Примеры

- -

Следующий пример функции возвращает версию Flash.

- -
function getFlashVersion() {
-  var flash = navigator.plugins['Shockwave Flash'];
-  if (flash === undefined) {
-    // flash is not present
-    return undefined;
-  }
-  return flash.version;
-}
-
- -

Следующий пример выводит информацию об установленном(ых) плагине (ах) для документа высокого уровня.

- -
var L = navigator.plugins.length;
-
-document.write(
-  L.toString() + " Plugin(s)<br>" +
-  "Name | Filename | description<br>"
-);
-
-for(var i = 0; i < L; i++) {
-  document.write(
-    navigator.plugins[i].name +
-    " | " +
-    navigator.plugins[i].filename +
-    " | " +
-    navigator.plugins[i].description +
-    " | " +
-    navigator.plugins[i].version +
-    "<br>"
-  );
-}
- -

Примечание

- -

{{domxref("Plugin")}} объект, предоставляет небольшой интерфейс для получения информации о различных плагинах, установленных в вашем браузере. Список плагинов также доступен если ввести about:plugins в адресную строку браузера.

- -

Спецификация

- -

Не определено ни к какой спецификации.

diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 7089de546a..2f520065d0 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -517,22 +517,22 @@ /zh-CN/docs/DOM/window.moveTo /zh-CN/docs/Web/API/Window/moveTo /zh-CN/docs/DOM/window.mozAnimationStartTime /zh-CN/docs/Web/API/Window/mozAnimationStartTIme /zh-CN/docs/DOM/window.navigator /zh-CN/docs/Web/API/Window/navigator -/zh-CN/docs/DOM/window.navigator.appCodeName /zh-CN/docs/Web/API/NavigatorID/appCodeName -/zh-CN/docs/DOM/window.navigator.appName /zh-CN/docs/Web/API/NavigatorID/appName -/zh-CN/docs/DOM/window.navigator.appVersion /zh-CN/docs/Web/API/NavigatorID/appVersion +/zh-CN/docs/DOM/window.navigator.appCodeName /zh-CN/docs/orphaned/Web/API/NavigatorID/appCodeName +/zh-CN/docs/DOM/window.navigator.appName /zh-CN/docs/orphaned/Web/API/NavigatorID/appName +/zh-CN/docs/DOM/window.navigator.appVersion /zh-CN/docs/orphaned/Web/API/NavigatorID/appVersion /zh-CN/docs/DOM/window.navigator.battery /zh-CN/docs/Web/API/Navigator/battery /zh-CN/docs/DOM/window.navigator.buildID /zh-CN/docs/Web/API/Navigator/buildID /zh-CN/docs/DOM/window.navigator.cookieEnabled /zh-CN/docs/Web/API/Navigator/cookieEnabled /zh-CN/docs/DOM/window.navigator.isLocallyAvailable /zh-CN/docs/Web/API/Navigator/mozIsLocallyAvailable -/zh-CN/docs/DOM/window.navigator.javaEnabled /zh-CN/docs/Web/API/NavigatorPlugins/javaEnabled -/zh-CN/docs/DOM/window.navigator.language /zh-CN/docs/Web/API/NavigatorLanguage/language +/zh-CN/docs/DOM/window.navigator.javaEnabled /zh-CN/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/zh-CN/docs/DOM/window.navigator.language /zh-CN/docs/orphaned/Web/API/NavigatorLanguage/language /zh-CN/docs/DOM/window.navigator.mozSettings /zh-CN/docs/Web/API/Navigator/mozSettings -/zh-CN/docs/DOM/window.navigator.onLine /zh-CN/docs/Web/API/NavigatorOnLine/onLine +/zh-CN/docs/DOM/window.navigator.onLine /zh-CN/docs/orphaned/Web/API/NavigatorOnLine/onLine /zh-CN/docs/DOM/window.navigator.oscpu /zh-CN/docs/Web/API/Navigator/oscpu -/zh-CN/docs/DOM/window.navigator.platform /zh-CN/docs/Web/API/NavigatorID/platform -/zh-CN/docs/DOM/window.navigator.plugins /zh-CN/docs/Web/API/NavigatorPlugins/plugins +/zh-CN/docs/DOM/window.navigator.platform /zh-CN/docs/orphaned/Web/API/NavigatorID/platform +/zh-CN/docs/DOM/window.navigator.plugins /zh-CN/docs/orphaned/Web/API/NavigatorPlugins/plugins /zh-CN/docs/DOM/window.navigator.registerContentHandler /zh-CN/docs/orphaned/Web/API/Navigator/registerContentHandler -/zh-CN/docs/DOM/window.navigator.userAgent /zh-CN/docs/Web/API/NavigatorID/userAgent +/zh-CN/docs/DOM/window.navigator.userAgent /zh-CN/docs/orphaned/Web/API/NavigatorID/userAgent /zh-CN/docs/DOM/window.navigator.vendor /zh-CN/docs/Web/API/Navigator/vendor /zh-CN/docs/DOM/window.navigator.vendorSub /zh-CN/docs/Web/API/Navigator/vendorSub /zh-CN/docs/DOM/window.onbeforeunload /zh-CN/docs/Web/API/WindowEventHandlers/onbeforeunload @@ -1358,7 +1358,7 @@ /zh-CN/docs/Mozilla_event_reference/visibilitychange /zh-CN/docs/Web/API/Document/visibilitychange_event /zh-CN/docs/New_in_JavaScript_1.5 /zh-CN/docs/Web/JavaScript/New_in_JavaScript/1.5 /zh-CN/docs/New_in_JavaScript_1.7 /zh-CN/docs/Web/JavaScript/New_in_JavaScript/1.7 -/zh-CN/docs/Online_and_offline_events /zh-CN/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/zh-CN/docs/Online_and_offline_events /zh-CN/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /zh-CN/docs/Other_JavaScript_tools /zh-CN/docs/Tools /zh-CN/docs/Properly_Using_CSS_and_JavaScript_in_XHTML_Documents:Examples /zh-CN/docs/Properly_Using_CSS_and_JavaScript_in_XHTML_Documents/Examples /zh-CN/docs/Python /zh-CN/docs/conflicting/Learn/Server-side/Django @@ -1682,20 +1682,41 @@ /zh-CN/docs/Web/API/Navigator.vendor /zh-CN/docs/Web/API/Navigator/vendor /zh-CN/docs/Web/API/Navigator.vendorSub /zh-CN/docs/Web/API/Navigator/vendorSub /zh-CN/docs/Web/API/Navigator/registerContentHandler /zh-CN/docs/orphaned/Web/API/Navigator/registerContentHandler +/zh-CN/docs/Web/API/NavigatorConcurrentHardware /zh-CN/docs/orphaned/Web/API/NavigatorConcurrentHardware +/zh-CN/docs/Web/API/NavigatorConcurrentHardware/hardwareConcurrency /zh-CN/docs/orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency /zh-CN/docs/Web/API/NavigatorGeolocation /zh-CN/docs/conflicting/Web/API/Geolocation /zh-CN/docs/Web/API/NavigatorGeolocation.geolocation /zh-CN/docs/Web/API/Navigator/geolocation /zh-CN/docs/Web/API/NavigatorGeolocation/geolocation /zh-CN/docs/Web/API/Navigator/geolocation -/zh-CN/docs/Web/API/NavigatorID.appCodeName /zh-CN/docs/Web/API/NavigatorID/appCodeName -/zh-CN/docs/Web/API/NavigatorID.appName /zh-CN/docs/Web/API/NavigatorID/appName -/zh-CN/docs/Web/API/NavigatorID.appVersion /zh-CN/docs/Web/API/NavigatorID/appVersion -/zh-CN/docs/Web/API/NavigatorID.platform /zh-CN/docs/Web/API/NavigatorID/platform -/zh-CN/docs/Web/API/NavigatorID.product /zh-CN/docs/Web/API/NavigatorID/product -/zh-CN/docs/Web/API/NavigatorID.userAgent /zh-CN/docs/Web/API/NavigatorID/userAgent -/zh-CN/docs/Web/API/NavigatorLanguage.language /zh-CN/docs/Web/API/NavigatorLanguage/language -/zh-CN/docs/Web/API/NavigatorOnLine.onLine /zh-CN/docs/Web/API/NavigatorOnLine/onLine -/zh-CN/docs/Web/API/NavigatorPlugins.javaEnabled /zh-CN/docs/Web/API/NavigatorPlugins/javaEnabled -/zh-CN/docs/Web/API/NavigatorPlugins.plugins /zh-CN/docs/Web/API/NavigatorPlugins/plugins +/zh-CN/docs/Web/API/NavigatorID /zh-CN/docs/orphaned/Web/API/NavigatorID +/zh-CN/docs/Web/API/NavigatorID.appCodeName /zh-CN/docs/orphaned/Web/API/NavigatorID/appCodeName +/zh-CN/docs/Web/API/NavigatorID.appName /zh-CN/docs/orphaned/Web/API/NavigatorID/appName +/zh-CN/docs/Web/API/NavigatorID.appVersion /zh-CN/docs/orphaned/Web/API/NavigatorID/appVersion +/zh-CN/docs/Web/API/NavigatorID.platform /zh-CN/docs/orphaned/Web/API/NavigatorID/platform +/zh-CN/docs/Web/API/NavigatorID.product /zh-CN/docs/orphaned/Web/API/NavigatorID/product +/zh-CN/docs/Web/API/NavigatorID.userAgent /zh-CN/docs/orphaned/Web/API/NavigatorID/userAgent +/zh-CN/docs/Web/API/NavigatorID/appCodeName /zh-CN/docs/orphaned/Web/API/NavigatorID/appCodeName +/zh-CN/docs/Web/API/NavigatorID/appName /zh-CN/docs/orphaned/Web/API/NavigatorID/appName +/zh-CN/docs/Web/API/NavigatorID/appVersion /zh-CN/docs/orphaned/Web/API/NavigatorID/appVersion +/zh-CN/docs/Web/API/NavigatorID/platform /zh-CN/docs/orphaned/Web/API/NavigatorID/platform +/zh-CN/docs/Web/API/NavigatorID/product /zh-CN/docs/orphaned/Web/API/NavigatorID/product +/zh-CN/docs/Web/API/NavigatorID/userAgent /zh-CN/docs/orphaned/Web/API/NavigatorID/userAgent +/zh-CN/docs/Web/API/NavigatorLanguage /zh-CN/docs/orphaned/Web/API/NavigatorLanguage +/zh-CN/docs/Web/API/NavigatorLanguage.language /zh-CN/docs/orphaned/Web/API/NavigatorLanguage/language +/zh-CN/docs/Web/API/NavigatorLanguage/language /zh-CN/docs/orphaned/Web/API/NavigatorLanguage/language +/zh-CN/docs/Web/API/NavigatorLanguage/languages /zh-CN/docs/orphaned/Web/API/NavigatorLanguage/languages +/zh-CN/docs/Web/API/NavigatorOnLine /zh-CN/docs/orphaned/Web/API/NavigatorOnLine +/zh-CN/docs/Web/API/NavigatorOnLine.onLine /zh-CN/docs/orphaned/Web/API/NavigatorOnLine/onLine +/zh-CN/docs/Web/API/NavigatorOnLine/Online_and_offline_events /zh-CN/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +/zh-CN/docs/Web/API/NavigatorOnLine/onLine /zh-CN/docs/orphaned/Web/API/NavigatorOnLine/onLine +/zh-CN/docs/Web/API/NavigatorPlugins /zh-CN/docs/orphaned/Web/API/NavigatorPlugins +/zh-CN/docs/Web/API/NavigatorPlugins.javaEnabled /zh-CN/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/zh-CN/docs/Web/API/NavigatorPlugins.plugins /zh-CN/docs/orphaned/Web/API/NavigatorPlugins/plugins +/zh-CN/docs/Web/API/NavigatorPlugins/javaEnabled /zh-CN/docs/orphaned/Web/API/NavigatorPlugins/javaEnabled +/zh-CN/docs/Web/API/NavigatorPlugins/mimeTypes /zh-CN/docs/orphaned/Web/API/NavigatorPlugins/mimeTypes +/zh-CN/docs/Web/API/NavigatorPlugins/plugins /zh-CN/docs/orphaned/Web/API/NavigatorPlugins/plugins /zh-CN/docs/Web/API/NavigatorPlugins/测试滕盖 /zh-CN/docs/orphaned/Web/API/NavigatorPlugins/测试滕盖 +/zh-CN/docs/Web/API/NavigatorStorage /zh-CN/docs/orphaned/Web/API/NavigatorStorage +/zh-CN/docs/Web/API/NavigatorStorage/storage /zh-CN/docs/orphaned/Web/API/NavigatorStorage/storage /zh-CN/docs/Web/API/Node.appendChild /zh-CN/docs/Web/API/Node/appendChild /zh-CN/docs/Web/API/Node.attributes /zh-CN/docs/Web/API/Element/attributes /zh-CN/docs/Web/API/Node.baseURI /zh-CN/docs/Web/API/Node/baseURI @@ -1923,6 +1944,7 @@ /zh-CN/docs/Web/API/WindowBase64/btoa /zh-CN/docs/Web/API/WindowOrWorkerGlobalScope/btoa /zh-CN/docs/Web/API/WindowTimers /zh-CN/docs/Web/API/WindowOrWorkerGlobalScope /zh-CN/docs/Web/API/WindowTimers/clearTimeout /zh-CN/docs/Web/API/WindowOrWorkerGlobalScope/clearTimeout +/zh-CN/docs/Web/API/XDomainRequest /zh-CN/docs/orphaned/Web/API/XDomainRequest /zh-CN/docs/Web/API/XMLDocument.load /zh-CN/docs/Web/API/XMLDocument/load /zh-CN/docs/Web/API/XMLHttpRequest/FormData /zh-CN/docs/Web/API/FormData /zh-CN/docs/Web/API/XMLHttpRequest/openRequest /zh-CN/docs/orphaned/Web/API/XMLHttpRequest/openRequest @@ -2432,6 +2454,7 @@ /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy__by_cnvoid/require-sri-for /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy/require-sri-for /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy__by_cnvoid/sandbox /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy__by_cnvoid/upgrade-insecure-requests /zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests +/zh-CN/docs/Web/HTTP/Headers/Index /zh-CN/docs/orphaned/Web/HTTP/Headers/Index /zh-CN/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file /zh-CN/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file /zh-CN/docs/Web/HTTP/Response_codes /zh-CN/docs/Web/HTTP/Status /zh-CN/docs/Web/HTTP/Response_codes/100 /zh-CN/docs/Web/HTTP/Status/100 diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 10fc3639cc..a7bda394d5 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -17786,173 +17786,6 @@ "nDos" ] }, - "Web/API/NavigatorConcurrentHardware": { - "modified": "2020-10-15T22:07:23.974Z", - "contributors": [ - "fscholz" - ] - }, - "Web/API/NavigatorConcurrentHardware/hardwareConcurrency": { - "modified": "2020-10-15T22:07:22.764Z", - "contributors": [ - "udo-china" - ] - }, - "Web/API/NavigatorID": { - "modified": "2019-03-23T23:10:30.690Z", - "contributors": [ - "teoli", - "AlexChao" - ] - }, - "Web/API/NavigatorID/appCodeName": { - "modified": "2019-03-24T00:15:50.665Z", - "contributors": [ - "teoli", - "khalid32", - "ziyunfei" - ] - }, - "Web/API/NavigatorID/appName": { - "modified": "2019-03-24T00:15:53.520Z", - "contributors": [ - "teoli", - "jsx", - "AlexChao", - "ziyunfei" - ] - }, - "Web/API/NavigatorID/appVersion": { - "modified": "2019-03-24T00:15:53.430Z", - "contributors": [ - "teoli", - "arunpandianp", - "AlexChao", - "ziyunfei" - ] - }, - "Web/API/NavigatorID/platform": { - "modified": "2019-03-24T00:16:03.059Z", - "contributors": [ - "teoli", - "jsx", - "ziyunfei" - ] - }, - "Web/API/NavigatorID/product": { - "modified": "2019-03-23T23:10:32.598Z", - "contributors": [ - "teoli", - "jsx", - "AlexChao" - ] - }, - "Web/API/NavigatorID/userAgent": { - "modified": "2020-10-27T04:48:53.819Z", - "contributors": [ - "oriengy", - "mokunshao", - "xgqfrms", - "teoli", - "khalid32", - "AlexChao", - "ziyunfei" - ] - }, - "Web/API/NavigatorLanguage": { - "modified": "2020-10-15T21:33:02.926Z", - "contributors": [ - "RainSlide", - "micblo", - "teoli" - ] - }, - "Web/API/NavigatorLanguage/language": { - "modified": "2020-10-15T21:06:56.192Z", - "contributors": [ - "Roy-Tian", - "Freed", - "teoli", - "khalid32", - "ziyunfei", - "gqqnbig" - ] - }, - "Web/API/NavigatorLanguage/languages": { - "modified": "2020-12-07T06:27:34.396Z", - "contributors": [ - "SphinxKnight", - "wick", - "fscholz", - "micblo" - ] - }, - "Web/API/NavigatorOnLine": { - "modified": "2019-03-23T23:01:18.687Z", - "contributors": [ - "VictorDu", - "teoli" - ] - }, - "Web/API/NavigatorOnLine/Online_and_offline_events": { - "modified": "2019-03-23T23:31:41.720Z", - "contributors": [ - "chrisdavidmills", - "sunnylost" - ] - }, - "Web/API/NavigatorOnLine/onLine": { - "modified": "2020-10-15T21:07:17.647Z", - "contributors": [ - "biqing", - "wth", - "teoli", - "khalid32", - "ziyunfei" - ] - }, - "Web/API/NavigatorPlugins": { - "modified": "2019-03-23T23:01:19.383Z", - "contributors": [ - "teoli" - ] - }, - "Web/API/NavigatorPlugins/javaEnabled": { - "modified": "2019-03-24T00:15:58.715Z", - "contributors": [ - "teoli", - "khalid32", - "ziyunfei" - ] - }, - "Web/API/NavigatorPlugins/mimeTypes": { - "modified": "2019-03-23T22:49:46.667Z", - "contributors": [ - "nDos", - "ChenChenJoke" - ] - }, - "Web/API/NavigatorPlugins/plugins": { - "modified": "2020-10-15T21:06:55.557Z", - "contributors": [ - "Carllllo", - "teoli", - "khalid32", - "ziyunfei" - ] - }, - "Web/API/NavigatorStorage": { - "modified": "2020-10-15T22:06:22.408Z", - "contributors": [ - "fscholz" - ] - }, - "Web/API/NavigatorStorage/storage": { - "modified": "2020-10-15T22:06:24.775Z", - "contributors": [ - "Awe" - ] - }, "Web/API/NetworkInformation": { "modified": "2019-06-12T05:37:17.235Z", "contributors": [ @@ -24533,13 +24366,6 @@ "librajt" ] }, - "Web/API/XDomainRequest": { - "modified": "2019-03-23T23:03:13.932Z", - "contributors": [ - "biqing", - "cungen" - ] - }, "Web/API/XMLDocument": { "modified": "2020-10-15T21:15:38.976Z", "contributors": [ @@ -34437,12 +34263,6 @@ "WayneCui" ] }, - "Web/HTTP/Headers/Index": { - "modified": "2019-08-30T03:36:19.849Z", - "contributors": [ - "whuhyw" - ] - }, "Web/HTTP/Headers/Keep-Alive": { "modified": "2020-10-15T21:55:00.550Z", "contributors": [ @@ -49956,12 +49776,179 @@ "ziyunfei" ] }, + "orphaned/Web/API/NavigatorConcurrentHardware": { + "modified": "2020-10-15T22:07:23.974Z", + "contributors": [ + "fscholz" + ] + }, + "orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency": { + "modified": "2020-10-15T22:07:22.764Z", + "contributors": [ + "udo-china" + ] + }, + "orphaned/Web/API/NavigatorID": { + "modified": "2019-03-23T23:10:30.690Z", + "contributors": [ + "teoli", + "AlexChao" + ] + }, + "orphaned/Web/API/NavigatorID/appCodeName": { + "modified": "2019-03-24T00:15:50.665Z", + "contributors": [ + "teoli", + "khalid32", + "ziyunfei" + ] + }, + "orphaned/Web/API/NavigatorID/appName": { + "modified": "2019-03-24T00:15:53.520Z", + "contributors": [ + "teoli", + "jsx", + "AlexChao", + "ziyunfei" + ] + }, + "orphaned/Web/API/NavigatorID/appVersion": { + "modified": "2019-03-24T00:15:53.430Z", + "contributors": [ + "teoli", + "arunpandianp", + "AlexChao", + "ziyunfei" + ] + }, + "orphaned/Web/API/NavigatorID/platform": { + "modified": "2019-03-24T00:16:03.059Z", + "contributors": [ + "teoli", + "jsx", + "ziyunfei" + ] + }, + "orphaned/Web/API/NavigatorID/product": { + "modified": "2019-03-23T23:10:32.598Z", + "contributors": [ + "teoli", + "jsx", + "AlexChao" + ] + }, + "orphaned/Web/API/NavigatorID/userAgent": { + "modified": "2020-10-27T04:48:53.819Z", + "contributors": [ + "oriengy", + "mokunshao", + "xgqfrms", + "teoli", + "khalid32", + "AlexChao", + "ziyunfei" + ] + }, + "orphaned/Web/API/NavigatorLanguage": { + "modified": "2020-10-15T21:33:02.926Z", + "contributors": [ + "RainSlide", + "micblo", + "teoli" + ] + }, + "orphaned/Web/API/NavigatorLanguage/language": { + "modified": "2020-10-15T21:06:56.192Z", + "contributors": [ + "Roy-Tian", + "Freed", + "teoli", + "khalid32", + "ziyunfei", + "gqqnbig" + ] + }, + "orphaned/Web/API/NavigatorLanguage/languages": { + "modified": "2020-12-07T06:27:34.396Z", + "contributors": [ + "SphinxKnight", + "wick", + "fscholz", + "micblo" + ] + }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2019-03-23T23:01:18.687Z", + "contributors": [ + "VictorDu", + "teoli" + ] + }, + "orphaned/Web/API/NavigatorOnLine/Online_and_offline_events": { + "modified": "2019-03-23T23:31:41.720Z", + "contributors": [ + "chrisdavidmills", + "sunnylost" + ] + }, + "orphaned/Web/API/NavigatorOnLine/onLine": { + "modified": "2020-10-15T21:07:17.647Z", + "contributors": [ + "biqing", + "wth", + "teoli", + "khalid32", + "ziyunfei" + ] + }, + "orphaned/Web/API/NavigatorPlugins": { + "modified": "2019-03-23T23:01:19.383Z", + "contributors": [ + "teoli" + ] + }, + "orphaned/Web/API/NavigatorPlugins/javaEnabled": { + "modified": "2019-03-24T00:15:58.715Z", + "contributors": [ + "teoli", + "khalid32", + "ziyunfei" + ] + }, + "orphaned/Web/API/NavigatorPlugins/mimeTypes": { + "modified": "2019-03-23T22:49:46.667Z", + "contributors": [ + "nDos", + "ChenChenJoke" + ] + }, + "orphaned/Web/API/NavigatorPlugins/plugins": { + "modified": "2020-10-15T21:06:55.557Z", + "contributors": [ + "Carllllo", + "teoli", + "khalid32", + "ziyunfei" + ] + }, "orphaned/Web/API/NavigatorPlugins/测试滕盖": { "modified": "2019-03-23T22:49:37.647Z", "contributors": [ "ChenChenJoke" ] }, + "orphaned/Web/API/NavigatorStorage": { + "modified": "2020-10-15T22:06:22.408Z", + "contributors": [ + "fscholz" + ] + }, + "orphaned/Web/API/NavigatorStorage/storage": { + "modified": "2020-10-15T22:06:24.775Z", + "contributors": [ + "Awe" + ] + }, "orphaned/Web/API/Node/getUserData": { "modified": "2019-03-23T23:09:37.543Z", "contributors": [ @@ -50142,6 +50129,13 @@ "xAmast" ] }, + "orphaned/Web/API/XDomainRequest": { + "modified": "2019-03-23T23:03:13.932Z", + "contributors": [ + "biqing", + "cungen" + ] + }, "orphaned/Web/API/XMLHttpRequest/openRequest": { "modified": "2019-03-18T21:28:11.436Z", "contributors": [ @@ -50454,6 +50448,12 @@ "ldwformat" ] }, + "orphaned/Web/HTTP/Headers/Index": { + "modified": "2019-08-30T03:36:19.849Z", + "contributors": [ + "whuhyw" + ] + }, "orphaned/Web/HTTP/跨域资源共享(CORS)_": { "modified": "2020-10-15T22:28:24.198Z", "contributors": [ diff --git a/files/zh-cn/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html b/files/zh-cn/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html new file mode 100644 index 0000000000..84cb1f561a --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html @@ -0,0 +1,70 @@ +--- +title: navigator.hardwareConcurrency +slug: orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency +translation_of: Web/API/NavigatorConcurrentHardware/hardwareConcurrency +original_slug: Web/API/NavigatorConcurrentHardware/hardwareConcurrency +--- +

{{APIRef("HTML DOM")}}

+ +

{{AvailableInWorkers}}

+ +

navigator.hardwareConcurrency 指明当前浏览器环境所拥有的CPU核心数,这来自于操作系统提供的API来获取。

+ +

用法

+ +
CPU核心数= window.navigator.hardwareConcurrency
+
+ +

Value

+ +

A {{jsxref("Number")}} indicating the number of logical processor cores.

+ +

Modern computers have multiple physical processor cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may offer eight logical processor cores, for example. The number of logical processor cores can be used to measure the number of threads which can effectively be run at once without them having to context switch.

+ +

The browser may, however, choose to report a lower number of logical cores in order to represent more accurately the number of {{domxref("Worker")}}s that can run at once, so don't treat this as an absolute measurement of the number of cores in the user's system.

+ +

Examples

+ +

In this example, one {{domxref("Worker")}} is created for each logical processor reported by the browser and a record is created which includes a reference to the new worker as well as a Boolean value indicating whether or not we're using that worker yet; these objects are, in turn, stored into an array for later use. This creates a pool of workers we can use to process requests later.

+ +
let workerList = [];
+
+for (let i = 0; i < window.navigator.hardwareConcurrency; i++) {
+  let newWorker = {
+    worker: new Worker('cpuworker.js'),
+    inUse: false
+  };
+  workerList.push(newWorker);
+}
+ +

Specification

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorconcurrenthardware', 'NavigatorConcurrentHardware')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

Browser compatibility

+ +
+ + +

{{Compat("api.NavigatorConcurrentHardware.hardwareConcurrency")}}

+
+ +

See also

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorconcurrenthardware/index.html b/files/zh-cn/orphaned/web/api/navigatorconcurrenthardware/index.html new file mode 100644 index 0000000000..43e5ae1965 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorconcurrenthardware/index.html @@ -0,0 +1,72 @@ +--- +title: NavigatorConcurrentHardware +slug: orphaned/Web/API/NavigatorConcurrentHardware +tags: + - API + - Concurrency + - HTML DOM + - Interface + - Navigator + - NavigatorCPU + - NavigatorConcurrentHardware + - NeedsBrowserCompatibility + - NeedsTranslation + - Reference + - Threading + - Threads + - TopicStub + - WorkerNavigator + - Workers +translation_of: Web/API/NavigatorConcurrentHardware +original_slug: Web/API/NavigatorConcurrentHardware +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorConcurrentHardware {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} interface features which allow Web content to determine how many logical processors the user has available, in order to let content and Web apps optimize their operations to best take advantage of the user's CPU.

+ +

{{AvailableInWorkers}}

+ +

The number of logical processor cores is a way to measure the number of threads which can effectively be run at once without them having to share CPUs. Modern computers have multiple physical cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may return 8. The browser may, however, choose to reduce the number in order to represent more accurately the number of {{domxref("Worker")}}s that can run at once

+ +

Properties

+ +
+
{{domxref("NavigatorConcurrentHardware.hardwareConcurrency")}} {{readonlyinline}}
+
Returns the number of logical processors which may be available to the user agent. This value is always at least 1, and will be 1 if the actual number of logical processors can't be determined.
+
+ +

Methods

+ +

The NavigatorConcurrentHardware mixin has no methods.

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorconcurrenthardware', 'NavigatorConcurrentHardware')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.NavigatorConcurrentHardware")}}

+ +

See also

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorid/appcodename/index.html b/files/zh-cn/orphaned/web/api/navigatorid/appcodename/index.html new file mode 100644 index 0000000000..5545fedd6a --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorid/appcodename/index.html @@ -0,0 +1,37 @@ +--- +title: NavigatorID.appCodeName +slug: orphaned/Web/API/NavigatorID/appCodeName +translation_of: Web/API/NavigatorID/appCodeName +original_slug: Web/API/NavigatorID/appCodeName +--- +

{{ ApiRef() }}

+ +

概述

+ +

返回所使用浏览器的内部名称.

+ +

语法

+ +
codeName = window.navigator.appCodeName
+
+ +

参数

+ + + +

例子

+ +
dump(window.navigator.appCodeName);
+
+ +

笔记

+ +

Mozilla, Netscape 6, 和 IE5 的内部名称都是 "Mozilla".

+ +

规范

+ +

{{ DOM0() }}

+ +

{{ languages( { "en": "en/DOM/window.navigator.appCodeName","ja": "ja/DOM/window.navigator.appCodeName", "pl": "pl/DOM/window.navigator.appCodeName" } ) }}

diff --git a/files/zh-cn/orphaned/web/api/navigatorid/appname/index.html b/files/zh-cn/orphaned/web/api/navigatorid/appname/index.html new file mode 100644 index 0000000000..14a1d147b3 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorid/appname/index.html @@ -0,0 +1,38 @@ +--- +title: NavigatorID.appName +slug: orphaned/Web/API/NavigatorID/appName +translation_of: Web/API/NavigatorID/appName +original_slug: Web/API/NavigatorID/appName +--- +

{{ ApiRef() }}

+ +

概述

+ +

返回所使用浏览器的名称。由于兼容性问题,HTML5 规范允许该属性返回 "Netscape" 。

+ +
注意:该属性并不一定能返回正确的浏览器名称。在基于 Gecko 的浏览器 (例如 Firefox)和基于 WebKit 的浏览器(例如 Chrome 和 Safari)中,返回的浏览器名称都是 "Netscape".
+ +

语法

+ +
appName = window.navigator.appName
+
+ +

返回值

+ + + +

例子

+ +
alert(window.navigator.appName);
+// 显示浏览器名称
+
+ +

规范

+ + + +

该属性起初属于 DOM Level 0 ,目前已经被添加到HTML5规范中。

diff --git a/files/zh-cn/orphaned/web/api/navigatorid/appversion/index.html b/files/zh-cn/orphaned/web/api/navigatorid/appversion/index.html new file mode 100644 index 0000000000..a56fdd8216 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorid/appversion/index.html @@ -0,0 +1,43 @@ +--- +title: NavigatorID.appVersion +slug: orphaned/Web/API/NavigatorID/appVersion +translation_of: Web/API/NavigatorID/appVersion +original_slug: Web/API/NavigatorID/appVersion +--- +

{{APIRef("HTML DOM")}}{{deprecated_header}}

+ +

概述

+ +

返回一个字符串,表示所使用浏览器的版本号。它可能只包含一个版本数字,如 "5.0",还可能包含一些其他的相关信息。由于兼容性问题,HTML5规范允许该属性返回 "4.0"。

+ +
注意:该属性并不一定能返回正确的浏览器版本号。在基于 Gecko 的浏览器 (例如 Firefox)和基于 WebKit 的浏览器(例如 Chrome 和 Safari)中,返回的浏览器版本号都是 "5.0",后跟一些操作系统与语言信息,比如 "5.0 (Windows; zh-CN)"。在Opera 10及以上版本,该属性的返回值也不是实际的浏览器版本号。
+ +

语法

+ +
ver = window.navigator.appVersion
+
+ +

返回值

+ + + +

例子

+ +
alert("你的浏览器版本为" + navigator.appVersion);
+
+ +

备注

+ +

window.navigator.userAgent 也包含一些浏览器的版本信息(比如:"Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1"),但是你应该知道,修改浏览器的userAgent字符串以及伪造它成为其他的浏览器、其他的操作系统等等是非常容易的。而且,就算不伪造,浏览器提供商也不会保证这些数据就是准确的。

+ +

window.navigator.appVersionwindow.navigator.appNamewindow.navigator.userAgent 等属性都被用来编写一些"浏览器检测"的相关代码:脚本会尝试根据检测出的浏览器类型来相印的调整页面显示。种情况下,用户可以伪造相关的浏览器信息来查看一些本来不允许自己所使用的浏览器或平台查看的页面。

+ +

规范

+ + + +

该属性最初属于 DOM Level 0,目前已经被添加到 HTML5 规范中。

diff --git a/files/zh-cn/orphaned/web/api/navigatorid/index.html b/files/zh-cn/orphaned/web/api/navigatorid/index.html new file mode 100644 index 0000000000..71bf69349a --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorid/index.html @@ -0,0 +1,121 @@ +--- +title: NavigatorID +slug: orphaned/Web/API/NavigatorID +translation_of: Web/API/NavigatorID +original_slug: Web/API/NavigatorID +--- +

{{APIRef("HTML DOM")}}

+ +

NavigatorID 接口包含浏览器识别相关的方法和属性。

+ +

没有一个 NavigatorID 类型的对象,他是其他接口,如 {{domxref("Navigator")}} 或 {{domxref("WorkerNavigator")}} 实现了该接口。

+ +

属性

+ +

NavigatorID 接口没有继承任何属性。

+ +
+
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{experimental_inline}}
+
任何浏览器中,总是返回 'Gecko'。该属性仅仅是为了保持兼容性。
+
{{domxref("NavigatorID.appName")}} {{readonlyInline}}
+
返回浏览器的官方名称。不要指望该属性返回正确的值。
+
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}}
+
返回一个字符串,表示浏览器的版本。不要指望该属性返回正确的值。
+
{{domxref("NavigatorID.platform")}} {{readonlyInline}}
+
返回一个字符串,表示浏览器的所在系统平台。
+
{{domxref("NavigatorID.product")}} {{readonlyInline}}
+
返回当前浏览器的产品名称(如,"Gecko")。
+
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
+
返回当前浏览器的用户代理字符串(user agent string)。
+
+ +

方法

+ +

NavigatorID 接口没有继承任何方法。

+ +
+
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}} {{experimental_inline}}
+
总是返回 false。JavaScript taint/untaint 函数在 JavaScript 1.2 中被移除了。该方法只是为了兼容性。
+
+ +

规范

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}Added the appCodeName property and the taintEnabled() method,  for compatibility purpose.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}Initial specification.
+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

相关链接

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorid/platform/index.html b/files/zh-cn/orphaned/web/api/navigatorid/platform/index.html new file mode 100644 index 0000000000..f1dc21fdea --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorid/platform/index.html @@ -0,0 +1,36 @@ +--- +title: NavigatorID.platform +slug: orphaned/Web/API/NavigatorID/platform +translation_of: Web/API/NavigatorID/platform +original_slug: Web/API/NavigatorID/platform +--- +

{{ ApiRef() }}

+ +

概述

+ +

返回一个字符串,表示浏览器所在的系统平台类型.

+ +

语法

+ +
platform = navigator.platform
+
+ +

platform 可能是: "Win32", "Linux i686", "MacPPC", "MacIntel", 等.

+ +

例子

+ +
alert(navigator.platform);
+ +

备注

+ +

在普通网页中,如果about:config中存在general.platform.override项,则该属性的值会返回about:config中general.platform.override项的值. 在特权代码中 (chrome上下文或者拥有"UniversalBrowserRead"特权的网页中),返回的还是真实的平台类型.(译者注:语句:netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead ")用来激活所在网页的UniversalBrowserRead特权.)

+ +

规范

+ + + +

该属性由DOM Level 0提出, 目前已经被添加到HTML5规范中.

+ +

{{ languages( {"ja": "ja/DOM/window.navigator.platform", "en": "en/DOM/window.navigator.platform", "pl": "pl/DOM/window.navigator.platform" } ) }}

diff --git a/files/zh-cn/orphaned/web/api/navigatorid/product/index.html b/files/zh-cn/orphaned/web/api/navigatorid/product/index.html new file mode 100644 index 0000000000..aae72af9db --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorid/product/index.html @@ -0,0 +1,35 @@ +--- +title: NavigatorID.product +slug: orphaned/Web/API/NavigatorID/product +translation_of: Web/API/NavigatorID/product +original_slug: Web/API/NavigatorID/product +--- +
+ {{ApiRef}}
+

概述

+

该属性返回当前浏览器的产品名称。

+
+ 注意:该属性不一定返回一个真实的产品名称。Gecko 和 WebKit 浏览器返回 "Gecko" 作为该属性的值。
+

语法

+
productName = window.navigator.product
+
+ +

例子

+
<script>
+function prod() {
+  dt = document.getElementById("d");
+  dt.innerHTML = window.navigator.product;
+}
+</script>
+
+<button onclick="prod();">product</button>
+<div id="d"> </div>
+<!-- 返回 "Gecko" -->
+
+

备注

+

在基于 Gecko 的浏览器中,product 为完整的用户代理(user agent)字符串中紧跟着平台(platform)后的部分。例如,在 Netscape 6.1 的用户代理中,product 是 "Gecko",完整的代理字符串是:Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1

+

在基于 WebKit 的浏览器中,product 仍然返回 "Gecko",即使完整用户代理字符串中平台(platform)后紧跟着:(KHTML, like Gecko)

+

规范

+

{{dom0}}

diff --git a/files/zh-cn/orphaned/web/api/navigatorid/useragent/index.html b/files/zh-cn/orphaned/web/api/navigatorid/useragent/index.html new file mode 100644 index 0000000000..9652c650da --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorid/useragent/index.html @@ -0,0 +1,80 @@ +--- +title: NavigatorID.userAgent +slug: orphaned/Web/API/NavigatorID/userAgent +translation_of: Web/API/NavigatorID/userAgent +original_slug: Web/API/NavigatorID/userAgent +--- +
{{ApiRef("HTML DOM")}}
+ +

NavigatorID.userAgent 只读属性返回当前浏览器的 user agent 字符串。

+ +
+

这一规范要求浏览器通过这一属性提供尽可能少的信息。不要假定同一浏览器的这一属性值会在未来的版本中保持不变。尽量不要使用这一属性,或者仅仅在现有和更早的版本中使用。较新的浏览器可能开始使用相同或近似的 UA,对于早期的浏览器而言:你不能确保该浏览器是其 NavigatorID.userAgent 属性所宣称的浏览器。

+ +

另外要记住,用户可以修改浏览器的此属性(UA 欺骗).

+
+ +

基于 user agent 字符串来识别浏览器是不可靠的,不推荐使用,因为 user agent 字符串是用户可配置的。例如:

+ + + +

语法

+ +
var ua = navigator.userAgent;
+
+ +

+ +

{{domxref("DOMString")}} 规定了浏览器提供给 {{Glossary("HTTP")}} headers 和其响应,以及其他与{{domxref("Navigator")}} 相关的方法的完整用户代理属性 。

+ +

用户代理属性由几个信息段组成一个整齐的结构,每个信息段都取值于其他 {{domxref("Navigator")}} 属性,这些属性也可以是用户设置的。基于 Gecko 内核的浏览器的 UA 遵守下列通用结构规范。

+ +
userAgent = appCodeName/appVersion number (Platform; Security; OS-or-CPU;
+Localization; rv: revision-version-number) product/productSub
+Application-Name Application-Name-version
+
+ +

例子

+ +
alert(window.navigator.userAgent)
+// alerts "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"
+
+ + + +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-navigator-useragent', 'NavigatorID.userAgent')}}{{Spec2('HTML WHATWG')}}Initial definition
+ +

浏览器兼容性

+ + + +

{{Compat("api.NavigatorID.userAgent")}}

+ +

更多

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorlanguage/index.html b/files/zh-cn/orphaned/web/api/navigatorlanguage/index.html new file mode 100644 index 0000000000..fdd35b2c8b --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorlanguage/index.html @@ -0,0 +1,69 @@ +--- +title: NavigatorLanguage +slug: orphaned/Web/API/NavigatorLanguage +tags: + - API + - HTML-DOM + - NeedsTranslation + - No Interface + - Reference + - TopicStub +translation_of: Web/API/NavigatorLanguage +original_slug: Web/API/NavigatorLanguage +--- +

{{APIRef("HTML DOM")}}

+ +

NavigatorLanguage 包含涉及导航(Navigator)的语言特性的方法和属性。

+ +

其实 NavigatorLanguage 这个对象并不存在,但是,一些其它的接口,如 {{domxref("Navigator")}} 或 {{domxref("WorkerNavigator")}},实现了它。

+ +

属性

+ +

NavigatorLanguage 接口不继承任何属性。

+ +
+
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
+
返回一个 {{domxref("DOMString")}} 代表用户的首选语言,通常是浏览器 UI 的语言。若返回 null 值,则代表语言未知。
+
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
+
返回一个 {{domxref("DOMString")}} 数组,代表用户已知的语言,不同语言按照谁更佳排序。
+
+ +

方法

+ +

NavigatorLanguage 接口不依赖任何接口和方法。

+ +

标准

+ + + + + + + + + + + + + + + + + + + + + +
标准状态备注
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}从 {{SpecName('HTML5 W3C')}} 出现开始,languages 属性已经被添加。
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}初始标准;出现在 {{SpecName('HTML WHATWG')}} 的早期版本。
+ +

浏览器兼容性

+ + + +

{{Compat("api.NavigatorLanguage")}}

+ +

参见

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorlanguage/language/index.html b/files/zh-cn/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..c9e6e3615e --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,65 @@ +--- +title: NavigatorLanguage.language +slug: orphaned/Web/API/NavigatorLanguage/language +tags: + - API + - NavigatorLanguage + - 参考 + - 只读 + - 多语言 + - 属性 + - 语言 +translation_of: Web/API/NavigatorLanguage/language +original_slug: Web/API/NavigatorLanguage/language +--- +
{{APIRef("HTML DOM")}}
+ +

NavigatorLanguage.language 只读属性返回一个表示用户偏好语言的字符串,通常指浏览器 UI 的语言。

+ +

语法

+ +
let lang = navigator.language;
+
+ +

+ +

一个 {{domxref("DOMString")}}。lang 存储一个表示语言版本(在 BCP 47 中定义)的字符串。合法的语言版本有 "zh-CN"、"en"、"en-US"、"fr"、"es-ES" 等。

+ +

注意 macOS 和 iOS 平台上的 Safari(10.2 之前版本),国家代码为小写:"zh-cn"、"en-us"、"fr-fr" 等。

+ +

示例

+ +
if ( window.navigator.language != 'zh-CN' ) {
+  doLangSelect(window.navigator.language);
+}
+
+ +

标准

+ + + + + + + + + + + + + + + + +
标准状态备注
{{SpecName('HTML WHATWG', '#dom-navigator-language', 'NavigatorLanguage: language')}}{{Spec2('HTML WHATWG')}}初次定义
+ +

浏览器兼容性

+ +

{{Compat("api.NavigatorLanguage.language")}}

+ +

另请参阅

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorlanguage/languages/index.html b/files/zh-cn/orphaned/web/api/navigatorlanguage/languages/index.html new file mode 100644 index 0000000000..127403a1f9 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorlanguage/languages/index.html @@ -0,0 +1,65 @@ +--- +title: NavigatorLanguage.languages +slug: orphaned/Web/API/NavigatorLanguage/languages +tags: + - API + - languages + - 只读 + - 实验性 + - 属性 +translation_of: Web/API/NavigatorLanguage/languages +original_slug: Web/API/NavigatorLanguage/languages +--- +

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

+ +

NavigatorLanguage.languages 只读属性 ,返回一个 {{domxref("DOMString")}} 的数组,数组内容表示网站访客所使用的语言。 使用 BCP 47 语言标签来描述不同的语言。 在返回的数组中,最适合当前用户的语言将会被排到数组的首位。

+ +

{{domxref("NavigatorLanguage.language","navigator.language")}} 的值是该属性返回数组的第一个元素 [3]。(但它基于系统语言设置。)

+ +

当该值发生改变,即最适合用户的语言被改变, 事件{{event("languagechange")}} 将会在 {{domxref("Window")}} 对象下触发。

+ +

在每一个HTTP请求上的来自用户浏览器的HTTP协议头 Accept-Language 使用相同的来自 navigator.languages 属性的语言值,除了特殊的 qvalues (权重值) 字段 (如:en-US;q=0.8)。

+ +

语法

+ +
preferredLanguages = globalObj.navigator.languages
+
+ +

例子

+ +
navigator.language   //"en-US"
+navigator.languages  //["en-US", "zh-CN", "ja-JP"]
+
+ +

标准

+ + + + + + + + + + + + + + +
标准状态备注
{{ SpecName('HTML5.1', '#dom-navigator-languages', 'NavigatorLanguage.languages') }}{{ Spec2('HTML5.1') }} +

初始化定义

+
+ +

浏览器兼容性

+ + + +

{{Compat("api.NavigatorLanguage.languages")}}

+ +

参见

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatoronline/index.html b/files/zh-cn/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..b2a7f14cc9 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,127 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +tags: + - API + - HTML-DOM + - TopicStub +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

NavigatorOnLine接口包含了与浏览器网络连接状态相关的方法和属性。

+ +

不存在NavigatorOnLine类型的对象,但是存在其他的接口,比如 {{domxref("Navigator")}} 或者 {{domxref("WorkerNavigator")}},可以实现它。

+ +

属性

+ +

NavigatorOnLine 接口并不能继承任何属性。

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
返回一个 {{domxref("Boolean")}} 值指示浏览器是否为在线状态。
+
+ +

方法

+ +

NavigatorOnLine 接口既不能实现,也不能继承任何方法。

+ +

规范

+ + + + + + + + + + + + + + + + + + + + + +
规范状态注解
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}对比最近的简况没有变化, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}{{SpecName('HTML WHATWG')}} 原始标准的简况.
+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
特征ChromeFirefox (Gecko)Internet ExplorerOperaSafari
基本支持{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
在{{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
特征AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支持{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
 {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

浏览相关

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatoronline/online/index.html b/files/zh-cn/orphaned/web/api/navigatoronline/online/index.html new file mode 100644 index 0000000000..ffc33f9d7a --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatoronline/online/index.html @@ -0,0 +1,88 @@ +--- +title: NavigatorOnLine.onLine +slug: orphaned/Web/API/NavigatorOnLine/onLine +tags: + - API + - DOM Reference +translation_of: Web/API/NavigatorOnLine/onLine +original_slug: Web/API/NavigatorOnLine/onLine +--- +

{{ApiRef("HTML DOM")}}

+ +

返回浏览器的联网状态。正常联网(在线)返回 true,不正常联网(离线)返回 false。一旦浏览器的联网状态发生改变,该属性值也会随之变化。当用户点击链接或者脚本进行网络请求时,如果发现浏览器连接不上互联网,则该属性会被赋值为false

+ +

各浏览器对该属性的实现有些不同。

+ +

在 Chrome 和 Safari 中,如果浏览器连接不上局域网(LAN)或者路由器,就是离线状态;否则就是在线状态。所以当该属性值为 false 的时候,你可以说浏览器不能正常联网,但如果该属性值为true的时候,并不意味着浏览器一定能连接上互联网。还有其他一些可能引起误判的原因,比如你的电脑安装了虚拟化软件,可能会有一个虚拟网卡,这时它总是会显示正常联网。因此,如果你想得到浏览器确切的联网状态,应该使用其他额外的检查手段。

+ +

在 Firefox 和 Internet Explorer 中,如果浏览器处于"脱机工作"状态,则返回 false。在 Firefox 41之前,所有其他条件都返回 true 值;在 Windows 上的 Nightly 68上测试实际行为表明,它仅查找类似 Chrome 和 Safari 的 LAN 连接,从而产生误报。

+ +

你可以在 window.ononline 和 window.onoffline上监听事件,来获取浏览器联网状态的改变情况。

+ +

语法

+ +
online = window.navigator.onLine;
+
+ +

取值

+ +

online 是个布尔值 truefalse。

+ +

示例

+ +

查看 在线演示.

+ +

想要查看你是否连接上了互联网,查询 window.navigator.onLine 的值,如下方示例:

+ +
if (navigator.onLine) {
+  alert('online')
+} else {
+  alert('offline');
+}
+
+ +

如果浏览器不支持 navigator.onLine,则上面的示例将始终显示为 false / undefined

+ +

要查看网络状态的变化,请使用 addEventListener  侦听 window.onlinewindow.offline 事件,如以下示例所示:

+ +
window.addEventListener("offline", function(e) {alert("offline");})
+
+window.addEventListener("online", function(e) {alert("online");})
+
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("HTML WHATWG", "browsers.html#dom-navigator-online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Initial definition
+ +

浏览器兼容性

+ +

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

+ +

{{Compat("api.NavigatorOnLine.onLine")}}

+ +

备注

+ +

See Online/Offline Events‎ for a more detailed description of this property as well as new offline-related features introduced in Firefox 3.

+ +

查看更多

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatoronline/online_and_offline_events/index.html b/files/zh-cn/orphaned/web/api/navigatoronline/online_and_offline_events/index.html new file mode 100644 index 0000000000..8b873aad6c --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatoronline/online_and_offline_events/index.html @@ -0,0 +1,120 @@ +--- +title: 在线和离线事件 +slug: orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +tags: + - AJAX + - DOM + - HTML5 + - Web 开发 + - 离线 web 应用 +translation_of: Web/API/NavigatorOnLine/Online_and_offline_events +original_slug: Web/API/NavigatorOnLine/Online_and_offline_events +--- +

部分浏览器根据 WHATWG Web Applications 1.0 规范 实现了Online/Offline 事件

+ +

概述

+ +

为了构建一个支持离线的 web 应用,你需要知道你的应用何时真正处于离线状态。同时,你还需要知道应用何时重新回到了「在线」状态。实际上,我们可以把需求分解成如下内容:

+ +
    +
  1. 你需要知道用户何时回到在线状态,这样你就可以与服务器重新同步。
  2. +
  3. 你需要知道用户何时处于离线状态,这样你就可以将对服务器的请求放入队列中以便稍后使用。
  4. +
+ +

这便是在线/离线事件所要处理的过程。

+ +

你的 web 应用可能需要使得某个特定的文档在离线资源缓存中得到维护。 你可以在 Firefox 中的离线资源 这篇文章中了解到更多内容。

+ +

API

+ + + +

navigator.onLine 是一个值为 true/false  (true 表示在线, false 表示离线) 的属性。当用户通过选择对应的菜单项 (Firefox 中为 文件 -> 离线工作) 切换到「离线模式」时,这个值就会被更新。

+ +

此外,当浏览器长时间无法连接到网络时,该值也会被更新。根据如下规范:

+ +
由于用户点击一个链接或是脚本请求一个远程页面(或者类似的操作失败了)从而导致户代理无法访问网络时, navigator.onLine 属性返回 false ...
+ +

在 Firefox 2 中,当在浏览器的离线模式中来回切换时会更新该属性。  Windows, Linux, 和 OS X 上的 Firefox 41 会在操作系统报告网络连接变化时更新该属性。

+ +

该属性存在于旧版本的 Firefox 与 Internet Explorer (规范就是以这些旧有实现为基础),因此你现在就可以使用该属性。Firefox 2实现了网络状态自动检测。

+ +

「online」与「offline」 事件

+ +

Firefox 3 引入了两个新事件:「online」与「offline」。当浏览器从在线与离线状态中切换时,这两个事件会在页面的 <body> 上触发。此外,该事件会从 document.body 冒泡到 document 上,最后到达 window。两个事件都无法被取消(你无法阻止用户进入在线或离线状态)。

+ +

你可以使用几种熟悉的方式来注册事件:

+ + + +

示例

+ +

运行这个简单的例子来验证事件。

+ +

这是 JavaScript 部分的代码:

+ +
window.addEventListener('load', function() {
+  var status = document.getElementById("status");
+  var log = document.getElementById("log");
+
+  function updateOnlineStatus(event) {
+    var condition = navigator.onLine ? "online" : "offline";
+
+    status.className = condition;
+    status.innerHTML = condition.toUpperCase();
+
+    log.insertAdjacentHTML("beforeend", "Event: " + event.type + "; Status: " + condition);
+  }
+
+  window.addEventListener('online',  updateOnlineStatus);
+  window.addEventListener('offline', updateOnlineStatus);
+});
+ +

再加上一点儿 CSS

+ +
#status {
+  position: fixed;
+  width: 100%;
+  font: bold 1em sans-serif;
+  color: #FFF;
+  padding: 0.5em;
+}
+
+#log {
+  padding: 2.5em 0.5em 0.5em;
+  font: 1em sans-serif;
+}
+
+.online {
+  background: green;
+}
+
+.offline {
+  background: red;
+}
+
+ +

对应的 HTMLXXX When mochitests for this are created, point to those instead and update this example -nickolay

+ +
<div id="status"></div>
+<div id="log"></div>
+<p>This is a test</p>
+
+ +

注意

+ +

如果浏览器没有实现该 API,你可以使用其他方式来检测是否离线,包括 AppCache 错误事件 和 XMLHttpRequest 的响应

+ +

参考

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorplugins/index.html b/files/zh-cn/orphaned/web/api/navigatorplugins/index.html new file mode 100644 index 0000000000..3b0afd6396 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorplugins/index.html @@ -0,0 +1,106 @@ +--- +title: NavigatorPlugins +slug: orphaned/Web/API/NavigatorPlugins +translation_of: Web/API/NavigatorPlugins +original_slug: Web/API/NavigatorPlugins +--- +

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

+ +

The NavigatorPlugins interface contains methods and properties related to the plugins installed in the browser.

+ +

There is no object of type NavigatorPlugins, but other interfaces, like {{domxref("Navigator")}}, implement it.

+ +

Properties

+ +
+
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
+
Returns an {{domxref("MimeTypeArray")}} listing the MIME types supported by the browser.
+
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
+
Returns a {{domxref("PluginArray")}} listing the plugins installed in the browser.
+
+ +

Methods

+ +

The NavigatorPlugins interface doesn't inherit any method.

+ +
+
{{domxref("NavigatorPlugins.javaEnabled")}} {{readonlyInline}}{{experimental_inline}}
+
Returns a {{domxref("Boolean")}} flag indicating whether the host browser is Java-enabled or not.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

See also

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorplugins/javaenabled/index.html b/files/zh-cn/orphaned/web/api/navigatorplugins/javaenabled/index.html new file mode 100644 index 0000000000..746b108c8e --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorplugins/javaenabled/index.html @@ -0,0 +1,31 @@ +--- +title: NavigatorPlugins.javaEnabled +slug: orphaned/Web/API/NavigatorPlugins/javaEnabled +translation_of: Web/API/NavigatorPlugins/javaEnabled +original_slug: Web/API/NavigatorPlugins/javaEnabled +--- +

{{ APIRef("HTML DOM") }}

+ +

概述

+ +

该方法用来表明当前浏览器是否激活了Java.

+ +

语法

+ +
result = window.navigator.javaEnabled()
+
+ +

例子

+ +
if (window.navigator.javaEnabled()) {
+   // 浏览器中Java可用
+}
+
+ +

备注

+ +

该方法的返回值是用来表明浏览器的当前配置文件是否允许使用Java的, 而不是表明浏览器是否支持Java(安装有Java插件).

+ +

规范

+ +

{{ DOM0() }}

diff --git a/files/zh-cn/orphaned/web/api/navigatorplugins/mimetypes/index.html b/files/zh-cn/orphaned/web/api/navigatorplugins/mimetypes/index.html new file mode 100644 index 0000000000..5b199ae666 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorplugins/mimetypes/index.html @@ -0,0 +1,40 @@ +--- +title: NavigatorPlugins.mimeTypes +slug: orphaned/Web/API/NavigatorPlugins/mimeTypes +translation_of: Web/API/NavigatorPlugins/mimeTypes +original_slug: Web/API/NavigatorPlugins/mimeTypes +--- +
{{ ApiRef("HTML DOM") }}
+ +
 
+ +

概述

+ +

返回一个{{domxref("MimeTypeArray")}}对象,其中包含可被当前浏览器识别的{{domxref("MimeType")}}对象的列表。

+ +

语法

+ +
mimeTypes = navigator.mimeTypes;
+
+ +

mimeTypes 是一个 MimeTypeArray 对象,其中含有 length 属性、item(index) 和 namedItem(name) 方法。

+ +

示例

+ +
function isJavaPresent() {
+  return 'application/x-java-applet' in navigator.mimeTypes;
+}
+
+function getJavaPluginDescription() {
+  var mimetype = navigator.mimeTypes['application/x-java-applet'];
+  if (mimetype === undefined) {
+    // no Java plugin present
+    return undefined;
+  }
+  return mimetype.enabledPlugin.description;
+}
+
+ +

Specification

+ +

mimeTypes 并未包含在任何规范中。

diff --git a/files/zh-cn/orphaned/web/api/navigatorplugins/plugins/index.html b/files/zh-cn/orphaned/web/api/navigatorplugins/plugins/index.html new file mode 100644 index 0000000000..a93bb6741c --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorplugins/plugins/index.html @@ -0,0 +1,96 @@ +--- +title: NavigatorPlugins.plugins +slug: orphaned/Web/API/NavigatorPlugins/plugins +tags: + - API + - DOM + - Navigator + - NavigatorPlugins + - Reference +translation_of: Web/API/NavigatorPlugins/plugins +original_slug: Web/API/NavigatorPlugins/plugins +--- +

{{APIRef("HTML DOM")}}

+ +

返回一个 {{ domxref("PluginArray") }} 类型的对象, 包含了当前所使用的浏览器安装的所有插件。

+ +
+

在Firefox 29及之后的版本,出于隐私考虑,navigator.plugins 数组的枚举可能会被限制。如果一定要检查是否存在某个浏览器插件,应该用准确的插件名字查询 navigator.plugins  或 {{DOMxRef("navigator.mimeTypes")}} ,而不是枚举 navigator.plugins  数组,再对比每个插件的名字。 这项有关隐私的改变不会禁用任何插件,只是将插件名字从枚举中隐藏了而已。

+
+ +

语法

+ +
plugins = navigator.plugins;
+
+ +

plugins 是一个 {{DOMxRef("PluginArray")}} 对象,通过名字或项目列表获取 {{DOMxRef("Plugin")}} 对象。

+ +

返回值不是一个普通的JavaScript数组,但是它也有 length 属性,也可以使用plugins[index]来获取到每个元素的值, 例如(plugins{{ mediawiki.external("2") }}), 效果和使用 item(index) 以及 namedItem("name") 是一样的.

+ +

示例

+ +

下述示例中的函数返回Shockwave Flash插件的版本。

+ +
function getFlashVersion() {
+  var flash = navigator.plugins.namedItem('Shockwave Flash');
+  if (typeof flash != 'object') {
+    // flash is not present
+    return undefined;
+  }
+  if(flash.version){
+    return flash.version;
+  } else {
+    //No version property (e.g. in Chrome)
+    return flash.description.replace(/Shockwave Flash /,"");
+  }
+}
+
+ +

下述示例可显示已安装插件的信息。

+ +
var pluginsLength = navigator.plugins.length;
+
+document.body.innerHTML = pluginsLength + " Plugin(s)<br>"
+  + '<table id="pluginTable"><thead>'
+  +'<tr><th>Name</th><th>Filename</th><th>description</th><th>version</th></tr>'
+  +'</thead><tbody></tbody></table>';
+
+var table = document.getElementById('pluginTable');
+
+for(var i = 0; i < pluginsLength; i++) {
+  let newRow = table.insertRow();
+  newRow.insertCell().textContent = navigator.plugins[i].name;
+  newRow.insertCell().textContent = navigator.plugins[i].filename;
+  newRow.insertCell().textContent = navigator.plugins[i].description;
+  newRow.insertCell().textContent = navigator.plugins[i].version?navigator.plugins[i].version:"";
+}
+
+ +

备注

+ +

{{DOMxRef("Plugin")}}对象提供一个小型接口,用于获取浏览器中安装的各种插件的信息。你也可以进入 about:plugins 页面,来查看浏览器上安装的插件(Chrome已移除该入口)。

+ +

规范

+ + + + + + + + + + + + + + + + +
规范状态注释
{{SpecName('HTML WHATWG', '#dom-navigator-plugins', 'NavigatorPlugins.plugins')}}{{Spec2('HTML WHATWG')}}Initial definition.
+ +

浏览器兼容性

+ +

{{Compat("api.NavigatorPlugins.plugins")}}

+ +

In addition to listing each plugin as a pseudo-array by zero-indexed numeric properties, Firefox provides properties that are the plugin name directly on the PluginArray object.

diff --git a/files/zh-cn/orphaned/web/api/navigatorstorage/index.html b/files/zh-cn/orphaned/web/api/navigatorstorage/index.html new file mode 100644 index 0000000000..bc0ef8ba92 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorstorage/index.html @@ -0,0 +1,71 @@ +--- +title: NavigatorStorage +slug: orphaned/Web/API/NavigatorStorage +tags: + - API + - Interface + - Mixin + - Navigator + - NavigatorStorage + - NeedsTranslation + - Reference + - Secure context + - Storage + - Storage Standard + - TopicStub + - WorkerNavigator +translation_of: Web/API/NavigatorStorage +original_slug: Web/API/NavigatorStorage +--- +

{{securecontext_header}}{{APIRef("Storage")}}

+ +

The NavigatorStorage {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} and {{domxref("WorkerNavigator")}} interfaces the {{domxref("Navigator.storage")}} property, which provides access to the {{domxref("StorageManager")}} singleton used for controlling the persistence of data stores as well as obtaining information

+ +

{{AvailableInWorkers}}

+ +

There are many APIs which provide ways for Web content to store data on a user's computer, including {{Glossary("cookies")}}, the Web Storage API ({{domxref("Window.localStorage")}} and {{domxref("Window.sessionStorage")}}), and IndexedDB. The Storage Standard is designed to serve as a common basis for the implementation of all of those APIs and storage technologies, so that their constraints and configurations can be understood and controlled using a common set of methods and properties.

+ +

Properties

+ +
+
{{domxref("NavigatorStorage.storage", "storage")}} {{readonlyinline}}{{securecontext_inline}}
+
Returns the {{domxref("StorageManager")}} singleton object which is used to access the Storage Manager. Through the returned object, you can control persistence of data stores as well as get estimates of how much space is left for your site or appliation to store data.
+
+ +

Methods

+ +

The NavigatorStorage mixin has no methods.

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Storage')}}{{Spec2('Storage')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.NavigatorStorage")}}

+ +

See also

+ + diff --git a/files/zh-cn/orphaned/web/api/navigatorstorage/storage/index.html b/files/zh-cn/orphaned/web/api/navigatorstorage/storage/index.html new file mode 100644 index 0000000000..bfd2cc93d6 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/navigatorstorage/storage/index.html @@ -0,0 +1,57 @@ +--- +title: NavigatorStorage.storage +slug: orphaned/Web/API/NavigatorStorage/storage +tags: + - API + - Navigator + - WorkerNavigator + - 存储 + - 安全上下文 + - 属性 +translation_of: Web/API/NavigatorStorage/storage +original_slug: Web/API/NavigatorStorage/storage +--- +

{{securecontext_header}}{{APIRef("Storage")}}

+ +

 NavigatorStorage.storage 是一个只读属性,返回单例 {{domxref("StorageManager")}} 对象,用于访问当前网站或应用程序的浏览器整体存储功能的。 通过返回的对象,您可以检查和配置数据存储的持久性,并了解您的浏览器使用的大约多少空间用于本地存储。

+ +

语法

+ +
var storageManager = navigator.storage;
+
+ +

返回值

+ +

返回 {{domxref("StorageManager")}} 您可以用来维护数据的持久化存储,以及大致确定有多少空间来存储数据。

+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Storage', '#navigatorstorage', 'navigator.storage')}}{{Spec2('Storage')}}Initial definition.
+ +

浏览器兼容性

+ +
+

{{Compat("api.NavigatorStorage.storage")}}

+
+ +

相关链接

+ + diff --git a/files/zh-cn/orphaned/web/api/xdomainrequest/index.html b/files/zh-cn/orphaned/web/api/xdomainrequest/index.html new file mode 100644 index 0000000000..a9d7eaf905 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/xdomainrequest/index.html @@ -0,0 +1,187 @@ +--- +title: XDomainRequest +slug: orphaned/Web/API/XDomainRequest +tags: + - AJAX + - API + - IE + - JavaScript + - Web + - 废弃 + - 微软 + - 非标准 +translation_of: Web/API/XDomainRequest +original_slug: Web/API/XDomainRequest +--- +

{{obsolete_header}}

+ +

{{non-standard_header}}

+ +

摘要

+ +

XDomainRequest是在IE8和IE9上的HTTP access control (CORS) 的实现,在IE10中被 包含CORS的XMLHttpRequest 取代了,如果你的开发目标是IE10或IE的后续版本,或想要支待其他的浏览器,你需要使用标准的HTTP access control

+ +

该接口可以发送GET和POST请求

+ +

语法

+ +
var xdr = new XDomainRequest();
+ +

返回XDomainRequest的实例,该实例可以被用来生成或管理请求。

+ +

属性

+ +
+
{{domxref("XDomainRequest.timeout")}}
+
获取或设置请求的过期时间。
+
{{domxref("XDomainRequest.responseText")}}
+
以字符串形式获取响应体。
+
+ +

方法

+ +
+
{{domxref("XDomainRequest.open()")}}
+
根据指定的方法(GET或POST)和URL,打开请求。
+
{{domxref("XDomainRequest.send()")}}
+
发送请求。POST的数据会在该方法中被指定。
+
{{domxref("XDomainRequest.abort()")}}
+
中止请求。
+
+ +

事件处理程序

+ +
+
{{domxref("XDomainRequest.onprogress")}}
+
当请求中发送方法和onload事件中有进展时的处理程序。
+
{{domxref("XDomainRequest.ontimeout")}}
+
当请求超时时的事件处理程序。
+
{{domxref("XDomainRequest.onerror")}}
+
当请求发生错误时的处理程序。
+
{{domxref("XDomainRequest.onload")}}
+
当服务器端的响应被完整接收时的处理程序。
+
+ +

例子

+ +
if(window.XDomainRequest){
+  var xdr = new XDomainRequest();
+
+  xdr.open("get", "http://example.com/api/method");
+
+  xdr.onprogress = function () {
+    //Progress
+  };
+
+  xdr.ontimeout = function () {
+    //Timeout
+  };
+
+  xdr.onerror = function () {
+    //Error Occured
+  };
+
+  xdr.onload = function() {
+    //success(xdr.responseText);
+  }
+
+  setTimeout(function () {
+    xdr.send();
+  }, 0);
+}
+ +
 
+ +
+

注意: 如果多个XDomainRequests同时被发送,一些请求可能会丢失,为避免这种情况,xdr.send()的调用应被包裹在setTimeout方法中(见{{domxref("window.setTimeout()")}})。

+
+ +

安全

+ +

XDomainRequest为了确保安全构建,采用了多种方法。

+ + + +

标准

+ +

该接口及其方法没有遵循标准。

+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
XDomainRequest{{ CompatNo() }}{{ CompatNo() }}8.0-9.x{{ CompatNo() }}{{ CompatNo() }}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
XDomainRequest{{ CompatNo() }}{{ CompatNo() }}{{ CompatUnknown() }}{{ CompatNo() }}{{ CompatNo() }}
+
+ + diff --git a/files/zh-cn/orphaned/web/http/headers/index/index.html b/files/zh-cn/orphaned/web/http/headers/index/index.html new file mode 100644 index 0000000000..6268193b12 --- /dev/null +++ b/files/zh-cn/orphaned/web/http/headers/index/index.html @@ -0,0 +1,9 @@ +--- +title: Index +slug: orphaned/Web/HTTP/Headers/Index +translation_of: Web/HTTP/Headers/Index +original_slug: Web/HTTP/Headers/Index +--- +
{{HTTPSidebar}}
+ +

{{Index("/en-US/docs/Web/HTTP/Headers")}}

diff --git a/files/zh-cn/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html b/files/zh-cn/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html deleted file mode 100644 index 806e40fbec..0000000000 --- a/files/zh-cn/web/api/navigatorconcurrenthardware/hardwareconcurrency/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: navigator.hardwareConcurrency -slug: Web/API/NavigatorConcurrentHardware/hardwareConcurrency -translation_of: Web/API/NavigatorConcurrentHardware/hardwareConcurrency ---- -

{{APIRef("HTML DOM")}}

- -

{{AvailableInWorkers}}

- -

navigator.hardwareConcurrency 指明当前浏览器环境所拥有的CPU核心数,这来自于操作系统提供的API来获取。

- -

用法

- -
CPU核心数= window.navigator.hardwareConcurrency
-
- -

Value

- -

A {{jsxref("Number")}} indicating the number of logical processor cores.

- -

Modern computers have multiple physical processor cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may offer eight logical processor cores, for example. The number of logical processor cores can be used to measure the number of threads which can effectively be run at once without them having to context switch.

- -

The browser may, however, choose to report a lower number of logical cores in order to represent more accurately the number of {{domxref("Worker")}}s that can run at once, so don't treat this as an absolute measurement of the number of cores in the user's system.

- -

Examples

- -

In this example, one {{domxref("Worker")}} is created for each logical processor reported by the browser and a record is created which includes a reference to the new worker as well as a Boolean value indicating whether or not we're using that worker yet; these objects are, in turn, stored into an array for later use. This creates a pool of workers we can use to process requests later.

- -
let workerList = [];
-
-for (let i = 0; i < window.navigator.hardwareConcurrency; i++) {
-  let newWorker = {
-    worker: new Worker('cpuworker.js'),
-    inUse: false
-  };
-  workerList.push(newWorker);
-}
- -

Specification

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorconcurrenthardware', 'NavigatorConcurrentHardware')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -
- - -

{{Compat("api.NavigatorConcurrentHardware.hardwareConcurrency")}}

-
- -

See also

- - diff --git a/files/zh-cn/web/api/navigatorconcurrenthardware/index.html b/files/zh-cn/web/api/navigatorconcurrenthardware/index.html deleted file mode 100644 index d7cee835c0..0000000000 --- a/files/zh-cn/web/api/navigatorconcurrenthardware/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: NavigatorConcurrentHardware -slug: Web/API/NavigatorConcurrentHardware -tags: - - API - - Concurrency - - HTML DOM - - Interface - - Navigator - - NavigatorCPU - - NavigatorConcurrentHardware - - NeedsBrowserCompatibility - - NeedsTranslation - - Reference - - Threading - - Threads - - TopicStub - - WorkerNavigator - - Workers -translation_of: Web/API/NavigatorConcurrentHardware ---- -

{{APIRef("HTML DOM")}}

- -

The NavigatorConcurrentHardware {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} interface features which allow Web content to determine how many logical processors the user has available, in order to let content and Web apps optimize their operations to best take advantage of the user's CPU.

- -

{{AvailableInWorkers}}

- -

The number of logical processor cores is a way to measure the number of threads which can effectively be run at once without them having to share CPUs. Modern computers have multiple physical cores in their CPU (two or four cores is typical), but each physical core is also usually able to run more than one thread at a time using advanced scheduling techniques. So a four-core CPU may return 8. The browser may, however, choose to reduce the number in order to represent more accurately the number of {{domxref("Worker")}}s that can run at once

- -

Properties

- -
-
{{domxref("NavigatorConcurrentHardware.hardwareConcurrency")}} {{readonlyinline}}
-
Returns the number of logical processors which may be available to the user agent. This value is always at least 1, and will be 1 if the actual number of logical processors can't be determined.
-
- -

Methods

- -

The NavigatorConcurrentHardware mixin has no methods.

- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorconcurrenthardware', 'NavigatorConcurrentHardware')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- - - -

{{Compat("api.NavigatorConcurrentHardware")}}

- -

See also

- - diff --git a/files/zh-cn/web/api/navigatorid/appcodename/index.html b/files/zh-cn/web/api/navigatorid/appcodename/index.html deleted file mode 100644 index 5f5f0e91da..0000000000 --- a/files/zh-cn/web/api/navigatorid/appcodename/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: NavigatorID.appCodeName -slug: Web/API/NavigatorID/appCodeName -translation_of: Web/API/NavigatorID/appCodeName ---- -

{{ ApiRef() }}

- -

概述

- -

返回所使用浏览器的内部名称.

- -

语法

- -
codeName = window.navigator.appCodeName
-
- -

参数

- - - -

例子

- -
dump(window.navigator.appCodeName);
-
- -

笔记

- -

Mozilla, Netscape 6, 和 IE5 的内部名称都是 "Mozilla".

- -

规范

- -

{{ DOM0() }}

- -

{{ languages( { "en": "en/DOM/window.navigator.appCodeName","ja": "ja/DOM/window.navigator.appCodeName", "pl": "pl/DOM/window.navigator.appCodeName" } ) }}

diff --git a/files/zh-cn/web/api/navigatorid/appname/index.html b/files/zh-cn/web/api/navigatorid/appname/index.html deleted file mode 100644 index 389e0b367b..0000000000 --- a/files/zh-cn/web/api/navigatorid/appname/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: NavigatorID.appName -slug: Web/API/NavigatorID/appName -translation_of: Web/API/NavigatorID/appName ---- -

{{ ApiRef() }}

- -

概述

- -

返回所使用浏览器的名称。由于兼容性问题,HTML5 规范允许该属性返回 "Netscape" 。

- -
注意:该属性并不一定能返回正确的浏览器名称。在基于 Gecko 的浏览器 (例如 Firefox)和基于 WebKit 的浏览器(例如 Chrome 和 Safari)中,返回的浏览器名称都是 "Netscape".
- -

语法

- -
appName = window.navigator.appName
-
- -

返回值

- - - -

例子

- -
alert(window.navigator.appName);
-// 显示浏览器名称
-
- -

规范

- - - -

该属性起初属于 DOM Level 0 ,目前已经被添加到HTML5规范中。

diff --git a/files/zh-cn/web/api/navigatorid/appversion/index.html b/files/zh-cn/web/api/navigatorid/appversion/index.html deleted file mode 100644 index 8fe576cecf..0000000000 --- a/files/zh-cn/web/api/navigatorid/appversion/index.html +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: NavigatorID.appVersion -slug: Web/API/NavigatorID/appVersion -translation_of: Web/API/NavigatorID/appVersion ---- -

{{APIRef("HTML DOM")}}{{deprecated_header}}

- -

概述

- -

返回一个字符串,表示所使用浏览器的版本号。它可能只包含一个版本数字,如 "5.0",还可能包含一些其他的相关信息。由于兼容性问题,HTML5规范允许该属性返回 "4.0"。

- -
注意:该属性并不一定能返回正确的浏览器版本号。在基于 Gecko 的浏览器 (例如 Firefox)和基于 WebKit 的浏览器(例如 Chrome 和 Safari)中,返回的浏览器版本号都是 "5.0",后跟一些操作系统与语言信息,比如 "5.0 (Windows; zh-CN)"。在Opera 10及以上版本,该属性的返回值也不是实际的浏览器版本号。
- -

语法

- -
ver = window.navigator.appVersion
-
- -

返回值

- - - -

例子

- -
alert("你的浏览器版本为" + navigator.appVersion);
-
- -

备注

- -

window.navigator.userAgent 也包含一些浏览器的版本信息(比如:"Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1"),但是你应该知道,修改浏览器的userAgent字符串以及伪造它成为其他的浏览器、其他的操作系统等等是非常容易的。而且,就算不伪造,浏览器提供商也不会保证这些数据就是准确的。

- -

window.navigator.appVersionwindow.navigator.appNamewindow.navigator.userAgent 等属性都被用来编写一些"浏览器检测"的相关代码:脚本会尝试根据检测出的浏览器类型来相印的调整页面显示。种情况下,用户可以伪造相关的浏览器信息来查看一些本来不允许自己所使用的浏览器或平台查看的页面。

- -

规范

- - - -

该属性最初属于 DOM Level 0,目前已经被添加到 HTML5 规范中。

diff --git a/files/zh-cn/web/api/navigatorid/index.html b/files/zh-cn/web/api/navigatorid/index.html deleted file mode 100644 index 5fab09ada5..0000000000 --- a/files/zh-cn/web/api/navigatorid/index.html +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: NavigatorID -slug: Web/API/NavigatorID -translation_of: Web/API/NavigatorID ---- -

{{APIRef("HTML DOM")}}

- -

NavigatorID 接口包含浏览器识别相关的方法和属性。

- -

没有一个 NavigatorID 类型的对象,他是其他接口,如 {{domxref("Navigator")}} 或 {{domxref("WorkerNavigator")}} 实现了该接口。

- -

属性

- -

NavigatorID 接口没有继承任何属性。

- -
-
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{experimental_inline}}
-
任何浏览器中,总是返回 'Gecko'。该属性仅仅是为了保持兼容性。
-
{{domxref("NavigatorID.appName")}} {{readonlyInline}}
-
返回浏览器的官方名称。不要指望该属性返回正确的值。
-
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}}
-
返回一个字符串,表示浏览器的版本。不要指望该属性返回正确的值。
-
{{domxref("NavigatorID.platform")}} {{readonlyInline}}
-
返回一个字符串,表示浏览器的所在系统平台。
-
{{domxref("NavigatorID.product")}} {{readonlyInline}}
-
返回当前浏览器的产品名称(如,"Gecko")。
-
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
-
返回当前浏览器的用户代理字符串(user agent string)。
-
- -

方法

- -

NavigatorID 接口没有继承任何方法。

- -
-
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}} {{experimental_inline}}
-
总是返回 false。JavaScript taint/untaint 函数在 JavaScript 1.2 中被移除了。该方法只是为了兼容性。
-
- -

规范

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}Added the appCodeName property and the taintEnabled() method,  for compatibility purpose.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}Initial specification.
- -

浏览器兼容性

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

相关链接

- - diff --git a/files/zh-cn/web/api/navigatorid/platform/index.html b/files/zh-cn/web/api/navigatorid/platform/index.html deleted file mode 100644 index a80d295ccb..0000000000 --- a/files/zh-cn/web/api/navigatorid/platform/index.html +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: NavigatorID.platform -slug: Web/API/NavigatorID/platform -translation_of: Web/API/NavigatorID/platform ---- -

{{ ApiRef() }}

- -

概述

- -

返回一个字符串,表示浏览器所在的系统平台类型.

- -

语法

- -
platform = navigator.platform
-
- -

platform 可能是: "Win32", "Linux i686", "MacPPC", "MacIntel", 等.

- -

例子

- -
alert(navigator.platform);
- -

备注

- -

在普通网页中,如果about:config中存在general.platform.override项,则该属性的值会返回about:config中general.platform.override项的值. 在特权代码中 (chrome上下文或者拥有"UniversalBrowserRead"特权的网页中),返回的还是真实的平台类型.(译者注:语句:netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead ")用来激活所在网页的UniversalBrowserRead特权.)

- -

规范

- - - -

该属性由DOM Level 0提出, 目前已经被添加到HTML5规范中.

- -

{{ languages( {"ja": "ja/DOM/window.navigator.platform", "en": "en/DOM/window.navigator.platform", "pl": "pl/DOM/window.navigator.platform" } ) }}

diff --git a/files/zh-cn/web/api/navigatorid/product/index.html b/files/zh-cn/web/api/navigatorid/product/index.html deleted file mode 100644 index 0c660198d1..0000000000 --- a/files/zh-cn/web/api/navigatorid/product/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: NavigatorID.product -slug: Web/API/NavigatorID/product -translation_of: Web/API/NavigatorID/product ---- -
- {{ApiRef}}
-

概述

-

该属性返回当前浏览器的产品名称。

-
- 注意:该属性不一定返回一个真实的产品名称。Gecko 和 WebKit 浏览器返回 "Gecko" 作为该属性的值。
-

语法

-
productName = window.navigator.product
-
- -

例子

-
<script>
-function prod() {
-  dt = document.getElementById("d");
-  dt.innerHTML = window.navigator.product;
-}
-</script>
-
-<button onclick="prod();">product</button>
-<div id="d"> </div>
-<!-- 返回 "Gecko" -->
-
-

备注

-

在基于 Gecko 的浏览器中,product 为完整的用户代理(user agent)字符串中紧跟着平台(platform)后的部分。例如,在 Netscape 6.1 的用户代理中,product 是 "Gecko",完整的代理字符串是:Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1

-

在基于 WebKit 的浏览器中,product 仍然返回 "Gecko",即使完整用户代理字符串中平台(platform)后紧跟着:(KHTML, like Gecko)

-

规范

-

{{dom0}}

diff --git a/files/zh-cn/web/api/navigatorid/useragent/index.html b/files/zh-cn/web/api/navigatorid/useragent/index.html deleted file mode 100644 index b5f2a23ab0..0000000000 --- a/files/zh-cn/web/api/navigatorid/useragent/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: NavigatorID.userAgent -slug: Web/API/NavigatorID/userAgent -translation_of: Web/API/NavigatorID/userAgent ---- -
{{ApiRef("HTML DOM")}}
- -

NavigatorID.userAgent 只读属性返回当前浏览器的 user agent 字符串。

- -
-

这一规范要求浏览器通过这一属性提供尽可能少的信息。不要假定同一浏览器的这一属性值会在未来的版本中保持不变。尽量不要使用这一属性,或者仅仅在现有和更早的版本中使用。较新的浏览器可能开始使用相同或近似的 UA,对于早期的浏览器而言:你不能确保该浏览器是其 NavigatorID.userAgent 属性所宣称的浏览器。

- -

另外要记住,用户可以修改浏览器的此属性(UA 欺骗).

-
- -

基于 user agent 字符串来识别浏览器是不可靠的,不推荐使用,因为 user agent 字符串是用户可配置的。例如:

- - - -

语法

- -
var ua = navigator.userAgent;
-
- -

- -

{{domxref("DOMString")}} 规定了浏览器提供给 {{Glossary("HTTP")}} headers 和其响应,以及其他与{{domxref("Navigator")}} 相关的方法的完整用户代理属性 。

- -

用户代理属性由几个信息段组成一个整齐的结构,每个信息段都取值于其他 {{domxref("Navigator")}} 属性,这些属性也可以是用户设置的。基于 Gecko 内核的浏览器的 UA 遵守下列通用结构规范。

- -
userAgent = appCodeName/appVersion number (Platform; Security; OS-or-CPU;
-Localization; rv: revision-version-number) product/productSub
-Application-Name Application-Name-version
-
- -

例子

- -
alert(window.navigator.userAgent)
-// alerts "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"
-
- - - -

规范

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-navigator-useragent', 'NavigatorID.userAgent')}}{{Spec2('HTML WHATWG')}}Initial definition
- -

浏览器兼容性

- - - -

{{Compat("api.NavigatorID.userAgent")}}

- -

更多

- - diff --git a/files/zh-cn/web/api/navigatorlanguage/index.html b/files/zh-cn/web/api/navigatorlanguage/index.html deleted file mode 100644 index c2bbe44db0..0000000000 --- a/files/zh-cn/web/api/navigatorlanguage/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: NavigatorLanguage -slug: Web/API/NavigatorLanguage -tags: - - API - - HTML-DOM - - NeedsTranslation - - No Interface - - Reference - - TopicStub -translation_of: Web/API/NavigatorLanguage ---- -

{{APIRef("HTML DOM")}}

- -

NavigatorLanguage 包含涉及导航(Navigator)的语言特性的方法和属性。

- -

其实 NavigatorLanguage 这个对象并不存在,但是,一些其它的接口,如 {{domxref("Navigator")}} 或 {{domxref("WorkerNavigator")}},实现了它。

- -

属性

- -

NavigatorLanguage 接口不继承任何属性。

- -
-
{{domxref("NavigatorLanguage.language")}} {{readonlyInline}}
-
返回一个 {{domxref("DOMString")}} 代表用户的首选语言,通常是浏览器 UI 的语言。若返回 null 值,则代表语言未知。
-
{{domxref("NavigatorLanguage.languages")}} {{readonlyInline}}
-
返回一个 {{domxref("DOMString")}} 数组,代表用户已知的语言,不同语言按照谁更佳排序。
-
- -

方法

- -

NavigatorLanguage 接口不依赖任何接口和方法。

- -

标准

- - - - - - - - - - - - - - - - - - - - - -
标准状态备注
{{SpecName('HTML WHATWG', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML WHATWG')}}从 {{SpecName('HTML5 W3C')}} 出现开始,languages 属性已经被添加。
{{SpecName('HTML5 W3C', '#navigatorlanguage', 'NavigatorLanguage')}}{{Spec2('HTML5 W3C')}}初始标准;出现在 {{SpecName('HTML WHATWG')}} 的早期版本。
- -

浏览器兼容性

- - - -

{{Compat("api.NavigatorLanguage")}}

- -

参见

- - diff --git a/files/zh-cn/web/api/navigatorlanguage/language/index.html b/files/zh-cn/web/api/navigatorlanguage/language/index.html deleted file mode 100644 index 24602dea56..0000000000 --- a/files/zh-cn/web/api/navigatorlanguage/language/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: NavigatorLanguage.language -slug: Web/API/NavigatorLanguage/language -tags: - - API - - NavigatorLanguage - - 参考 - - 只读 - - 多语言 - - 属性 - - 语言 -translation_of: Web/API/NavigatorLanguage/language ---- -
{{APIRef("HTML DOM")}}
- -

NavigatorLanguage.language 只读属性返回一个表示用户偏好语言的字符串,通常指浏览器 UI 的语言。

- -

语法

- -
let lang = navigator.language;
-
- -

- -

一个 {{domxref("DOMString")}}。lang 存储一个表示语言版本(在 BCP 47 中定义)的字符串。合法的语言版本有 "zh-CN"、"en"、"en-US"、"fr"、"es-ES" 等。

- -

注意 macOS 和 iOS 平台上的 Safari(10.2 之前版本),国家代码为小写:"zh-cn"、"en-us"、"fr-fr" 等。

- -

示例

- -
if ( window.navigator.language != 'zh-CN' ) {
-  doLangSelect(window.navigator.language);
-}
-
- -

标准

- - - - - - - - - - - - - - - - -
标准状态备注
{{SpecName('HTML WHATWG', '#dom-navigator-language', 'NavigatorLanguage: language')}}{{Spec2('HTML WHATWG')}}初次定义
- -

浏览器兼容性

- -

{{Compat("api.NavigatorLanguage.language")}}

- -

另请参阅

- - diff --git a/files/zh-cn/web/api/navigatorlanguage/languages/index.html b/files/zh-cn/web/api/navigatorlanguage/languages/index.html deleted file mode 100644 index 7378d105fa..0000000000 --- a/files/zh-cn/web/api/navigatorlanguage/languages/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: NavigatorLanguage.languages -slug: Web/API/NavigatorLanguage/languages -tags: - - API - - languages - - 只读 - - 实验性 - - 属性 -translation_of: Web/API/NavigatorLanguage/languages ---- -

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

- -

NavigatorLanguage.languages 只读属性 ,返回一个 {{domxref("DOMString")}} 的数组,数组内容表示网站访客所使用的语言。 使用 BCP 47 语言标签来描述不同的语言。 在返回的数组中,最适合当前用户的语言将会被排到数组的首位。

- -

{{domxref("NavigatorLanguage.language","navigator.language")}} 的值是该属性返回数组的第一个元素 [3]。(但它基于系统语言设置。)

- -

当该值发生改变,即最适合用户的语言被改变, 事件{{event("languagechange")}} 将会在 {{domxref("Window")}} 对象下触发。

- -

在每一个HTTP请求上的来自用户浏览器的HTTP协议头 Accept-Language 使用相同的来自 navigator.languages 属性的语言值,除了特殊的 qvalues (权重值) 字段 (如:en-US;q=0.8)。

- -

语法

- -
preferredLanguages = globalObj.navigator.languages
-
- -

例子

- -
navigator.language   //"en-US"
-navigator.languages  //["en-US", "zh-CN", "ja-JP"]
-
- -

标准

- - - - - - - - - - - - - - -
标准状态备注
{{ SpecName('HTML5.1', '#dom-navigator-languages', 'NavigatorLanguage.languages') }}{{ Spec2('HTML5.1') }} -

初始化定义

-
- -

浏览器兼容性

- - - -

{{Compat("api.NavigatorLanguage.languages")}}

- -

参见

- - diff --git a/files/zh-cn/web/api/navigatoronline/index.html b/files/zh-cn/web/api/navigatoronline/index.html deleted file mode 100644 index 4e0f4431f8..0000000000 --- a/files/zh-cn/web/api/navigatoronline/index.html +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -tags: - - API - - HTML-DOM - - TopicStub -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

NavigatorOnLine接口包含了与浏览器网络连接状态相关的方法和属性。

- -

不存在NavigatorOnLine类型的对象,但是存在其他的接口,比如 {{domxref("Navigator")}} 或者 {{domxref("WorkerNavigator")}},可以实现它。

- -

属性

- -

NavigatorOnLine 接口并不能继承任何属性。

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
返回一个 {{domxref("Boolean")}} 值指示浏览器是否为在线状态。
-
- -

方法

- -

NavigatorOnLine 接口既不能实现,也不能继承任何方法。

- -

规范

- - - - - - - - - - - - - - - - - - - - - -
规范状态注解
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}对比最近的简况没有变化, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}{{SpecName('HTML WHATWG')}} 原始标准的简况.
- -

浏览器兼容性

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
特征ChromeFirefox (Gecko)Internet ExplorerOperaSafari
基本支持{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
在{{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
特征AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支持{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
 {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

浏览相关

- - diff --git a/files/zh-cn/web/api/navigatoronline/online/index.html b/files/zh-cn/web/api/navigatoronline/online/index.html deleted file mode 100644 index d89f0baa57..0000000000 --- a/files/zh-cn/web/api/navigatoronline/online/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: NavigatorOnLine.onLine -slug: Web/API/NavigatorOnLine/onLine -tags: - - API - - DOM Reference -translation_of: Web/API/NavigatorOnLine/onLine ---- -

{{ApiRef("HTML DOM")}}

- -

返回浏览器的联网状态。正常联网(在线)返回 true,不正常联网(离线)返回 false。一旦浏览器的联网状态发生改变,该属性值也会随之变化。当用户点击链接或者脚本进行网络请求时,如果发现浏览器连接不上互联网,则该属性会被赋值为false

- -

各浏览器对该属性的实现有些不同。

- -

在 Chrome 和 Safari 中,如果浏览器连接不上局域网(LAN)或者路由器,就是离线状态;否则就是在线状态。所以当该属性值为 false 的时候,你可以说浏览器不能正常联网,但如果该属性值为true的时候,并不意味着浏览器一定能连接上互联网。还有其他一些可能引起误判的原因,比如你的电脑安装了虚拟化软件,可能会有一个虚拟网卡,这时它总是会显示正常联网。因此,如果你想得到浏览器确切的联网状态,应该使用其他额外的检查手段。

- -

在 Firefox 和 Internet Explorer 中,如果浏览器处于"脱机工作"状态,则返回 false。在 Firefox 41之前,所有其他条件都返回 true 值;在 Windows 上的 Nightly 68上测试实际行为表明,它仅查找类似 Chrome 和 Safari 的 LAN 连接,从而产生误报。

- -

你可以在 window.ononline 和 window.onoffline上监听事件,来获取浏览器联网状态的改变情况。

- -

语法

- -
online = window.navigator.onLine;
-
- -

取值

- -

online 是个布尔值 truefalse。

- -

示例

- -

查看 在线演示.

- -

想要查看你是否连接上了互联网,查询 window.navigator.onLine 的值,如下方示例:

- -
if (navigator.onLine) {
-  alert('online')
-} else {
-  alert('offline');
-}
-
- -

如果浏览器不支持 navigator.onLine,则上面的示例将始终显示为 false / undefined

- -

要查看网络状态的变化,请使用 addEventListener  侦听 window.onlinewindow.offline 事件,如以下示例所示:

- -
window.addEventListener("offline", function(e) {alert("offline");})
-
-window.addEventListener("online", function(e) {alert("online");})
-
- -

规范

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("HTML WHATWG", "browsers.html#dom-navigator-online", "navigator.onLine")}}{{Spec2("HTML WHATWG")}}Initial definition
- -

浏览器兼容性

- -

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

- -

{{Compat("api.NavigatorOnLine.onLine")}}

- -

备注

- -

See Online/Offline Events‎ for a more detailed description of this property as well as new offline-related features introduced in Firefox 3.

- -

查看更多

- - diff --git a/files/zh-cn/web/api/navigatoronline/online_and_offline_events/index.html b/files/zh-cn/web/api/navigatoronline/online_and_offline_events/index.html deleted file mode 100644 index f4f28ed973..0000000000 --- a/files/zh-cn/web/api/navigatoronline/online_and_offline_events/index.html +++ /dev/null @@ -1,119 +0,0 @@ ---- -title: 在线和离线事件 -slug: Web/API/NavigatorOnLine/Online_and_offline_events -tags: - - AJAX - - DOM - - HTML5 - - Web 开发 - - 离线 web 应用 -translation_of: Web/API/NavigatorOnLine/Online_and_offline_events ---- -

部分浏览器根据 WHATWG Web Applications 1.0 规范 实现了Online/Offline 事件

- -

概述

- -

为了构建一个支持离线的 web 应用,你需要知道你的应用何时真正处于离线状态。同时,你还需要知道应用何时重新回到了「在线」状态。实际上,我们可以把需求分解成如下内容:

- -
    -
  1. 你需要知道用户何时回到在线状态,这样你就可以与服务器重新同步。
  2. -
  3. 你需要知道用户何时处于离线状态,这样你就可以将对服务器的请求放入队列中以便稍后使用。
  4. -
- -

这便是在线/离线事件所要处理的过程。

- -

你的 web 应用可能需要使得某个特定的文档在离线资源缓存中得到维护。 你可以在 Firefox 中的离线资源 这篇文章中了解到更多内容。

- -

API

- - - -

navigator.onLine 是一个值为 true/false  (true 表示在线, false 表示离线) 的属性。当用户通过选择对应的菜单项 (Firefox 中为 文件 -> 离线工作) 切换到「离线模式」时,这个值就会被更新。

- -

此外,当浏览器长时间无法连接到网络时,该值也会被更新。根据如下规范:

- -
由于用户点击一个链接或是脚本请求一个远程页面(或者类似的操作失败了)从而导致户代理无法访问网络时, navigator.onLine 属性返回 false ...
- -

在 Firefox 2 中,当在浏览器的离线模式中来回切换时会更新该属性。  Windows, Linux, 和 OS X 上的 Firefox 41 会在操作系统报告网络连接变化时更新该属性。

- -

该属性存在于旧版本的 Firefox 与 Internet Explorer (规范就是以这些旧有实现为基础),因此你现在就可以使用该属性。Firefox 2实现了网络状态自动检测。

- -

「online」与「offline」 事件

- -

Firefox 3 引入了两个新事件:「online」与「offline」。当浏览器从在线与离线状态中切换时,这两个事件会在页面的 <body> 上触发。此外,该事件会从 document.body 冒泡到 document 上,最后到达 window。两个事件都无法被取消(你无法阻止用户进入在线或离线状态)。

- -

你可以使用几种熟悉的方式来注册事件:

- - - -

示例

- -

运行这个简单的例子来验证事件。

- -

这是 JavaScript 部分的代码:

- -
window.addEventListener('load', function() {
-  var status = document.getElementById("status");
-  var log = document.getElementById("log");
-
-  function updateOnlineStatus(event) {
-    var condition = navigator.onLine ? "online" : "offline";
-
-    status.className = condition;
-    status.innerHTML = condition.toUpperCase();
-
-    log.insertAdjacentHTML("beforeend", "Event: " + event.type + "; Status: " + condition);
-  }
-
-  window.addEventListener('online',  updateOnlineStatus);
-  window.addEventListener('offline', updateOnlineStatus);
-});
- -

再加上一点儿 CSS

- -
#status {
-  position: fixed;
-  width: 100%;
-  font: bold 1em sans-serif;
-  color: #FFF;
-  padding: 0.5em;
-}
-
-#log {
-  padding: 2.5em 0.5em 0.5em;
-  font: 1em sans-serif;
-}
-
-.online {
-  background: green;
-}
-
-.offline {
-  background: red;
-}
-
- -

对应的 HTMLXXX When mochitests for this are created, point to those instead and update this example -nickolay

- -
<div id="status"></div>
-<div id="log"></div>
-<p>This is a test</p>
-
- -

注意

- -

如果浏览器没有实现该 API,你可以使用其他方式来检测是否离线,包括 AppCache 错误事件 和 XMLHttpRequest 的响应

- -

参考

- - diff --git a/files/zh-cn/web/api/navigatorplugins/index.html b/files/zh-cn/web/api/navigatorplugins/index.html deleted file mode 100644 index bb342bcb6d..0000000000 --- a/files/zh-cn/web/api/navigatorplugins/index.html +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: NavigatorPlugins -slug: Web/API/NavigatorPlugins -translation_of: Web/API/NavigatorPlugins ---- -

{{APIRef("HTML DOM")}}{{SeeCompatTable}}

- -

The NavigatorPlugins interface contains methods and properties related to the plugins installed in the browser.

- -

There is no object of type NavigatorPlugins, but other interfaces, like {{domxref("Navigator")}}, implement it.

- -

Properties

- -
-
{{domxref("NavigatorPlugins.mimeTypes")}} {{readonlyInline}}{{experimental_inline}}
-
Returns an {{domxref("MimeTypeArray")}} listing the MIME types supported by the browser.
-
{{domxref("NavigatorPlugins.plugins")}} {{readonlyInline}}{{experimental_inline}}
-
Returns a {{domxref("PluginArray")}} listing the plugins installed in the browser.
-
- -

Methods

- -

The NavigatorPlugins interface doesn't inherit any method.

- -
-
{{domxref("NavigatorPlugins.javaEnabled")}} {{readonlyInline}}{{experimental_inline}}
-
Returns a {{domxref("Boolean")}} flag indicating whether the host browser is Java-enabled or not.
-
- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorplugins', 'NavigatorPlugins')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

See also

- - diff --git a/files/zh-cn/web/api/navigatorplugins/javaenabled/index.html b/files/zh-cn/web/api/navigatorplugins/javaenabled/index.html deleted file mode 100644 index 4cee281575..0000000000 --- a/files/zh-cn/web/api/navigatorplugins/javaenabled/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: NavigatorPlugins.javaEnabled -slug: Web/API/NavigatorPlugins/javaEnabled -translation_of: Web/API/NavigatorPlugins/javaEnabled ---- -

{{ APIRef("HTML DOM") }}

- -

概述

- -

该方法用来表明当前浏览器是否激活了Java.

- -

语法

- -
result = window.navigator.javaEnabled()
-
- -

例子

- -
if (window.navigator.javaEnabled()) {
-   // 浏览器中Java可用
-}
-
- -

备注

- -

该方法的返回值是用来表明浏览器的当前配置文件是否允许使用Java的, 而不是表明浏览器是否支持Java(安装有Java插件).

- -

规范

- -

{{ DOM0() }}

diff --git a/files/zh-cn/web/api/navigatorplugins/mimetypes/index.html b/files/zh-cn/web/api/navigatorplugins/mimetypes/index.html deleted file mode 100644 index dea1462c98..0000000000 --- a/files/zh-cn/web/api/navigatorplugins/mimetypes/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: NavigatorPlugins.mimeTypes -slug: Web/API/NavigatorPlugins/mimeTypes -translation_of: Web/API/NavigatorPlugins/mimeTypes ---- -
{{ ApiRef("HTML DOM") }}
- -
 
- -

概述

- -

返回一个{{domxref("MimeTypeArray")}}对象,其中包含可被当前浏览器识别的{{domxref("MimeType")}}对象的列表。

- -

语法

- -
mimeTypes = navigator.mimeTypes;
-
- -

mimeTypes 是一个 MimeTypeArray 对象,其中含有 length 属性、item(index) 和 namedItem(name) 方法。

- -

示例

- -
function isJavaPresent() {
-  return 'application/x-java-applet' in navigator.mimeTypes;
-}
-
-function getJavaPluginDescription() {
-  var mimetype = navigator.mimeTypes['application/x-java-applet'];
-  if (mimetype === undefined) {
-    // no Java plugin present
-    return undefined;
-  }
-  return mimetype.enabledPlugin.description;
-}
-
- -

Specification

- -

mimeTypes 并未包含在任何规范中。

diff --git a/files/zh-cn/web/api/navigatorplugins/plugins/index.html b/files/zh-cn/web/api/navigatorplugins/plugins/index.html deleted file mode 100644 index 9953dd916e..0000000000 --- a/files/zh-cn/web/api/navigatorplugins/plugins/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: NavigatorPlugins.plugins -slug: Web/API/NavigatorPlugins/plugins -tags: - - API - - DOM - - Navigator - - NavigatorPlugins - - Reference -translation_of: Web/API/NavigatorPlugins/plugins ---- -

{{APIRef("HTML DOM")}}

- -

返回一个 {{ domxref("PluginArray") }} 类型的对象, 包含了当前所使用的浏览器安装的所有插件。

- -
-

在Firefox 29及之后的版本,出于隐私考虑,navigator.plugins 数组的枚举可能会被限制。如果一定要检查是否存在某个浏览器插件,应该用准确的插件名字查询 navigator.plugins  或 {{DOMxRef("navigator.mimeTypes")}} ,而不是枚举 navigator.plugins  数组,再对比每个插件的名字。 这项有关隐私的改变不会禁用任何插件,只是将插件名字从枚举中隐藏了而已。

-
- -

语法

- -
plugins = navigator.plugins;
-
- -

plugins 是一个 {{DOMxRef("PluginArray")}} 对象,通过名字或项目列表获取 {{DOMxRef("Plugin")}} 对象。

- -

返回值不是一个普通的JavaScript数组,但是它也有 length 属性,也可以使用plugins[index]来获取到每个元素的值, 例如(plugins{{ mediawiki.external("2") }}), 效果和使用 item(index) 以及 namedItem("name") 是一样的.

- -

示例

- -

下述示例中的函数返回Shockwave Flash插件的版本。

- -
function getFlashVersion() {
-  var flash = navigator.plugins.namedItem('Shockwave Flash');
-  if (typeof flash != 'object') {
-    // flash is not present
-    return undefined;
-  }
-  if(flash.version){
-    return flash.version;
-  } else {
-    //No version property (e.g. in Chrome)
-    return flash.description.replace(/Shockwave Flash /,"");
-  }
-}
-
- -

下述示例可显示已安装插件的信息。

- -
var pluginsLength = navigator.plugins.length;
-
-document.body.innerHTML = pluginsLength + " Plugin(s)<br>"
-  + '<table id="pluginTable"><thead>'
-  +'<tr><th>Name</th><th>Filename</th><th>description</th><th>version</th></tr>'
-  +'</thead><tbody></tbody></table>';
-
-var table = document.getElementById('pluginTable');
-
-for(var i = 0; i < pluginsLength; i++) {
-  let newRow = table.insertRow();
-  newRow.insertCell().textContent = navigator.plugins[i].name;
-  newRow.insertCell().textContent = navigator.plugins[i].filename;
-  newRow.insertCell().textContent = navigator.plugins[i].description;
-  newRow.insertCell().textContent = navigator.plugins[i].version?navigator.plugins[i].version:"";
-}
-
- -

备注

- -

{{DOMxRef("Plugin")}}对象提供一个小型接口,用于获取浏览器中安装的各种插件的信息。你也可以进入 about:plugins 页面,来查看浏览器上安装的插件(Chrome已移除该入口)。

- -

规范

- - - - - - - - - - - - - - - - -
规范状态注释
{{SpecName('HTML WHATWG', '#dom-navigator-plugins', 'NavigatorPlugins.plugins')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

浏览器兼容性

- -

{{Compat("api.NavigatorPlugins.plugins")}}

- -

In addition to listing each plugin as a pseudo-array by zero-indexed numeric properties, Firefox provides properties that are the plugin name directly on the PluginArray object.

diff --git a/files/zh-cn/web/api/navigatorstorage/index.html b/files/zh-cn/web/api/navigatorstorage/index.html deleted file mode 100644 index 0f1524c350..0000000000 --- a/files/zh-cn/web/api/navigatorstorage/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: NavigatorStorage -slug: Web/API/NavigatorStorage -tags: - - API - - Interface - - Mixin - - Navigator - - NavigatorStorage - - NeedsTranslation - - Reference - - Secure context - - Storage - - Storage Standard - - TopicStub - - WorkerNavigator -translation_of: Web/API/NavigatorStorage ---- -

{{securecontext_header}}{{APIRef("Storage")}}

- -

The NavigatorStorage {{Glossary("mixin")}} adds to the {{domxref("Navigator")}} and {{domxref("WorkerNavigator")}} interfaces the {{domxref("Navigator.storage")}} property, which provides access to the {{domxref("StorageManager")}} singleton used for controlling the persistence of data stores as well as obtaining information

- -

{{AvailableInWorkers}}

- -

There are many APIs which provide ways for Web content to store data on a user's computer, including {{Glossary("cookies")}}, the Web Storage API ({{domxref("Window.localStorage")}} and {{domxref("Window.sessionStorage")}}), and IndexedDB. The Storage Standard is designed to serve as a common basis for the implementation of all of those APIs and storage technologies, so that their constraints and configurations can be understood and controlled using a common set of methods and properties.

- -

Properties

- -
-
{{domxref("NavigatorStorage.storage", "storage")}} {{readonlyinline}}{{securecontext_inline}}
-
Returns the {{domxref("StorageManager")}} singleton object which is used to access the Storage Manager. Through the returned object, you can control persistence of data stores as well as get estimates of how much space is left for your site or appliation to store data.
-
- -

Methods

- -

The NavigatorStorage mixin has no methods.

- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Storage')}}{{Spec2('Storage')}}Initial definition.
- -

Browser compatibility

- - - -

{{Compat("api.NavigatorStorage")}}

- -

See also

- - diff --git a/files/zh-cn/web/api/navigatorstorage/storage/index.html b/files/zh-cn/web/api/navigatorstorage/storage/index.html deleted file mode 100644 index 52530ddf80..0000000000 --- a/files/zh-cn/web/api/navigatorstorage/storage/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: NavigatorStorage.storage -slug: Web/API/NavigatorStorage/storage -tags: - - API - - Navigator - - WorkerNavigator - - 存储 - - 安全上下文 - - 属性 -translation_of: Web/API/NavigatorStorage/storage ---- -

{{securecontext_header}}{{APIRef("Storage")}}

- -

 NavigatorStorage.storage 是一个只读属性,返回单例 {{domxref("StorageManager")}} 对象,用于访问当前网站或应用程序的浏览器整体存储功能的。 通过返回的对象,您可以检查和配置数据存储的持久性,并了解您的浏览器使用的大约多少空间用于本地存储。

- -

语法

- -
var storageManager = navigator.storage;
-
- -

返回值

- -

返回 {{domxref("StorageManager")}} 您可以用来维护数据的持久化存储,以及大致确定有多少空间来存储数据。

- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Storage', '#navigatorstorage', 'navigator.storage')}}{{Spec2('Storage')}}Initial definition.
- -

浏览器兼容性

- -
-

{{Compat("api.NavigatorStorage.storage")}}

-
- -

相关链接

- - diff --git a/files/zh-cn/web/api/xdomainrequest/index.html b/files/zh-cn/web/api/xdomainrequest/index.html deleted file mode 100644 index dd7dce2899..0000000000 --- a/files/zh-cn/web/api/xdomainrequest/index.html +++ /dev/null @@ -1,186 +0,0 @@ ---- -title: XDomainRequest -slug: Web/API/XDomainRequest -tags: - - AJAX - - API - - IE - - JavaScript - - Web - - 废弃 - - 微软 - - 非标准 -translation_of: Web/API/XDomainRequest ---- -

{{obsolete_header}}

- -

{{non-standard_header}}

- -

摘要

- -

XDomainRequest是在IE8和IE9上的HTTP access control (CORS) 的实现,在IE10中被 包含CORS的XMLHttpRequest 取代了,如果你的开发目标是IE10或IE的后续版本,或想要支待其他的浏览器,你需要使用标准的HTTP access control

- -

该接口可以发送GET和POST请求

- -

语法

- -
var xdr = new XDomainRequest();
- -

返回XDomainRequest的实例,该实例可以被用来生成或管理请求。

- -

属性

- -
-
{{domxref("XDomainRequest.timeout")}}
-
获取或设置请求的过期时间。
-
{{domxref("XDomainRequest.responseText")}}
-
以字符串形式获取响应体。
-
- -

方法

- -
-
{{domxref("XDomainRequest.open()")}}
-
根据指定的方法(GET或POST)和URL,打开请求。
-
{{domxref("XDomainRequest.send()")}}
-
发送请求。POST的数据会在该方法中被指定。
-
{{domxref("XDomainRequest.abort()")}}
-
中止请求。
-
- -

事件处理程序

- -
-
{{domxref("XDomainRequest.onprogress")}}
-
当请求中发送方法和onload事件中有进展时的处理程序。
-
{{domxref("XDomainRequest.ontimeout")}}
-
当请求超时时的事件处理程序。
-
{{domxref("XDomainRequest.onerror")}}
-
当请求发生错误时的处理程序。
-
{{domxref("XDomainRequest.onload")}}
-
当服务器端的响应被完整接收时的处理程序。
-
- -

例子

- -
if(window.XDomainRequest){
-  var xdr = new XDomainRequest();
-
-  xdr.open("get", "http://example.com/api/method");
-
-  xdr.onprogress = function () {
-    //Progress
-  };
-
-  xdr.ontimeout = function () {
-    //Timeout
-  };
-
-  xdr.onerror = function () {
-    //Error Occured
-  };
-
-  xdr.onload = function() {
-    //success(xdr.responseText);
-  }
-
-  setTimeout(function () {
-    xdr.send();
-  }, 0);
-}
- -
 
- -
-

注意: 如果多个XDomainRequests同时被发送,一些请求可能会丢失,为避免这种情况,xdr.send()的调用应被包裹在setTimeout方法中(见{{domxref("window.setTimeout()")}})。

-
- -

安全

- -

XDomainRequest为了确保安全构建,采用了多种方法。

- - - -

标准

- -

该接口及其方法没有遵循标准。

- -

浏览器兼容性

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
XDomainRequest{{ CompatNo() }}{{ CompatNo() }}8.0-9.x{{ CompatNo() }}{{ CompatNo() }}
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
XDomainRequest{{ CompatNo() }}{{ CompatNo() }}{{ CompatUnknown() }}{{ CompatNo() }}{{ CompatNo() }}
-
- - diff --git a/files/zh-cn/web/http/headers/index/index.html b/files/zh-cn/web/http/headers/index/index.html deleted file mode 100644 index e9b8ba9ad0..0000000000 --- a/files/zh-cn/web/http/headers/index/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Index -slug: Web/HTTP/Headers/Index -translation_of: Web/HTTP/Headers/Index ---- -
{{HTTPSidebar}}
- -

{{Index("/en-US/docs/Web/HTTP/Headers")}}

diff --git a/files/zh-tw/_redirects.txt b/files/zh-tw/_redirects.txt index 98de0ef1ac..7d83ca25fc 100644 --- a/files/zh-tw/_redirects.txt +++ b/files/zh-tw/_redirects.txt @@ -143,7 +143,7 @@ /zh-TW/docs/Firefox_3.5_技術文件 /zh-TW/docs/orphaned/Firefox_3.5_技術文件 /zh-TW/docs/Firefox_3_CSS_Improvement /zh-TW/docs/Mozilla/Firefox/Releases/3/Firefox_3_CSS_Improvement /zh-TW/docs/Firefox_3_Dom_Improvements /zh-TW/docs/Mozilla/Firefox/Releases/3/DOM_improvements -/zh-TW/docs/Firefox_3_Online_and_Offline_Events /zh-TW/docs/Web/API/NavigatorOnLine/Online_and_offline_events +/zh-TW/docs/Firefox_3_Online_and_Offline_Events /zh-TW/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /zh-TW/docs/Firefox_3_Web-based_protocol_handler /zh-TW/docs/Web/API/Navigator/registerProtocolHandler/Web-based_protocol_handlers /zh-TW/docs/Firefox_3_for_developers /zh-TW/docs/Mozilla/Firefox/Releases/3 /zh-TW/docs/Firefox_3_supports_Cross-site_XMLHttpRequest /zh-TW/docs/orphaned/Cross-site_XMLHttpRequest @@ -579,6 +579,9 @@ /zh-TW/docs/Web/API/HTMLElement/style /zh-TW/docs/orphaned/Web/API/ElementCSSInlineStyle/style /zh-TW/docs/Web/API/HTMLOrForeignElement/dataset /zh-TW/docs/orphaned/Web/API/HTMLOrForeignElement/dataset /zh-TW/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB /zh-TW/docs/orphaned/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB +/zh-TW/docs/Web/API/NavigatorLanguage/language /zh-TW/docs/orphaned/Web/API/NavigatorLanguage/language +/zh-TW/docs/Web/API/NavigatorOnLine /zh-TW/docs/orphaned/Web/API/NavigatorOnLine +/zh-TW/docs/Web/API/NavigatorOnLine/Online_and_offline_events /zh-TW/docs/orphaned/Web/API/NavigatorOnLine/Online_and_offline_events /zh-TW/docs/Web/API/Node/innerText /zh-TW/docs/Web/API/HTMLElement/innerText /zh-TW/docs/Web/API/NonDocumentTypeChildNode /zh-TW/docs/conflicting/Web/API/Element /zh-TW/docs/Web/API/ParentNode /zh-TW/docs/orphaned/Web/API/ParentNode diff --git a/files/zh-tw/_wikihistory.json b/files/zh-tw/_wikihistory.json index ff6f80aa98..ab113edf9b 100644 --- a/files/zh-tw/_wikihistory.json +++ b/files/zh-tw/_wikihistory.json @@ -4207,20 +4207,6 @@ "Coolcd" ] }, - "Web/API/NavigatorOnLine": { - "modified": "2019-03-23T22:02:07.853Z", - "contributors": [ - "chrisdavidmills" - ] - }, - "Web/API/NavigatorOnLine/Online_and_offline_events": { - "modified": "2019-03-23T23:51:04.713Z", - "contributors": [ - "chrisdavidmills", - "teoli", - "Coolcd" - ] - }, "Web/API/Network_Information_API": { "modified": "2019-03-23T23:26:00.923Z", "contributors": [ @@ -8673,6 +8659,20 @@ "thomaschen" ] }, + "orphaned/Web/API/NavigatorOnLine": { + "modified": "2019-03-23T22:02:07.853Z", + "contributors": [ + "chrisdavidmills" + ] + }, + "orphaned/Web/API/NavigatorOnLine/Online_and_offline_events": { + "modified": "2019-03-23T23:51:04.713Z", + "contributors": [ + "chrisdavidmills", + "teoli", + "Coolcd" + ] + }, "orphaned/Web/API/ParentNode": { "modified": "2019-12-24T08:07:24.128Z", "contributors": [ diff --git a/files/zh-tw/orphaned/web/api/navigatorlanguage/language/index.html b/files/zh-tw/orphaned/web/api/navigatorlanguage/language/index.html new file mode 100644 index 0000000000..964d5596e7 --- /dev/null +++ b/files/zh-tw/orphaned/web/api/navigatorlanguage/language/index.html @@ -0,0 +1,65 @@ +--- +title: NavigatorLanguage.language +slug: orphaned/Web/API/NavigatorLanguage/language +tags: + - API + - Language + - NavigatorLanguage + - Property + - Read-only + - Reference +original_slug: Web/API/NavigatorLanguage/language +--- +
{{APIRef("HTML DOM")}}
+ +

NavigatorLanguage.language 是一個唯讀的屬性,回傳使用者偏好的語言字串,通常是瀏覽器UI的文字

+ +

語法

+ +
const lang = navigator.language
+
+ +

+ +

一個 {{domxref("DOMString")}}. lang 儲存一個代表此語言的字串。定義在BCP 47。 範例: 合法的語言代碼 "en", "en-US", "fr", "fr-FR", "es-ES", etc.

+ +

在 iOS 小於 10.2 的 Safari 國碼是回傳小寫的喲! + "en-us", "fr-fr" etc.

+ +

範例

+ +
if (/^en\b/.test(navigator.language)) {
+  doLangSelect(window.navigator.language);
+}
+
+ +

規範

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-navigator-language', 'NavigatorLanguage: language')}}{{Spec2('HTML WHATWG')}}Initial definition
+ +

瀏覽器相容性

+ +

{{Compat("api.NavigatorLanguage.language")}}

+ +

參見

+ + diff --git a/files/zh-tw/orphaned/web/api/navigatoronline/index.html b/files/zh-tw/orphaned/web/api/navigatoronline/index.html new file mode 100644 index 0000000000..91e0c4ece8 --- /dev/null +++ b/files/zh-tw/orphaned/web/api/navigatoronline/index.html @@ -0,0 +1,130 @@ +--- +title: NavigatorOnLine +slug: orphaned/Web/API/NavigatorOnLine +translation_of: Web/API/NavigatorOnLine +original_slug: Web/API/NavigatorOnLine +--- +

{{APIRef("HTML DOM")}}

+ +

In progress The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

+ +

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorOnLine interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
+
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
+
+ +

Methods

+ +

The NavigatorOnLine interface neither implements, nor inherit any method.

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

See also

+ + diff --git a/files/zh-tw/orphaned/web/api/navigatoronline/online_and_offline_events/index.html b/files/zh-tw/orphaned/web/api/navigatoronline/online_and_offline_events/index.html new file mode 100644 index 0000000000..c729d56183 --- /dev/null +++ b/files/zh-tw/orphaned/web/api/navigatoronline/online_and_offline_events/index.html @@ -0,0 +1,102 @@ +--- +title: Firefox 3 Online and Offline Events +slug: orphaned/Web/API/NavigatorOnLine/Online_and_offline_events +translation_of: Web/API/NavigatorOnLine/Online_and_offline_events +original_slug: Web/API/NavigatorOnLine/Online_and_offline_events +--- +

Firefox 3 Online and Offline Events From MoztwWiki

+

Firefox 3 依據 WHATWG Web Applications 1.0 Specification 實做了 Offline/Online Events

+

概觀

+

打造可以離線跑的網路應用程式時,我們往往需要讓程式知道目前的網路狀況。實際上,網路應用程式一般的需求可細分如下:

+ +

有了 Online/offline events,要滿足這些需求變得很簡單。

+

此外,你的網路應用程式有時可能必須將某些 HTML 文件列入快取中,以便使用者離線時可以存取,如有這個需求,你可以在 HTML 文件的 <HEAD> 加入 <link> 元素:

+
<link rel="offline-resource" href="myresource">
+

Firefox 3 看到這些語法時,就會將這些資源列入一個特殊的離線資源快取(offline resource cache)中,讓使用者在離線時,依舊可以被存取這些資源。

+

API

+ +
+
+ avigator.onLine 是一個 property,其值可為 true/false (true 代表 online, false 代表 offline)。當使用者將瀏覽器切換成 Offline Mode 時(透過 主選單 -> 檔案 -> 離線模式),這個 property 就會被更新。
+
+
+
+ 除此之外,根據規格書的建議,在瀏覽器無法連接到網路時,也應該更新這個 property。規格書上是這樣寫的:
+
+
+ The navigator.onLine attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)...
+
+
+
+
+ Firefox 2 在我們將瀏覽器切換成為離線模式、或離開離線模式時,會更新這個 property,在失去網路連線、或重新連線到網路時,也會更新這個 property。
+
+
+
+ 在比較老的 Firefox 與 Internet Explorer 版本,也有支援這個 property (事實上,規格書是依據這些之前版本的實做結果來制定的),所以現在就可以馬上開始使用它。
+
+
+
+ 但「自動偵測網路狀況」是在 Firefox 2 中才實做出來。
+
+

online and offline events

+
+
+ Firefox 3 新增了兩個 events 的支援: "online" 及 "offline"。當我們切換瀏覽器的 online/offline 狀態時,就會對每個頁面的 <body> 觸發這兩個事件。除此之外,這兩個事件會從 document.body bubble up 到 document,到 window 才結束。這兩個事件都是 non-cancellable 的(因為你無法防止使用者連線到網路、或離線)。
+
+
+
+ 有好幾種你熟悉的方式可以用來註冊這兩個事件的 listeners:
+
+
+
+
    +
  • 對 window, document 或 document.body 使用 addEventListener。
  • +
  • 對 document 或 document.body 設定 .ononline 或 .onoffline properties 作為一個 JavaScript Function object. (注意: 使用 window.ononline 或 window.onoffline 無法作用,這是為了相容性。)
  • +
  • 在 html 文件的 <body> 指定 ononline="..." 或 onoffline="..." attributes。
  • +
+
+
+

例子

+

這裡有個簡單的例子

+
<!doctype html>
+ <html>
+ <head>
+   <script>
+     function updateOnlineStatus(msg) {
+       var status = document.getElementById("status");
+       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
+       status.setAttribute("class", condition);
+       var state = document.getElementById("state");
+       state.innerHTML = condition;
+       var log = document.getElementById("log");
+       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
+     }
+     function loaded() {
+       updateOnlineStatus("load");
+       document.body.addEventListener("offline", function () {
+         updateOnlineStatus("offline")
+       }, false);
+       document.body.addEventListener("online", function () {
+         updateOnlineStatus("online")
+       }, false);
+     }
+   </script>
+   <style>...</style>
+ </head>
+ <body onload="loaded()">
+   <div id="status"><p id="state"></p></div>
+   <div id="log"></div>
+ </body>
+ </html>
+

參考資料

+ diff --git a/files/zh-tw/web/api/navigatorlanguage/language/index.html b/files/zh-tw/web/api/navigatorlanguage/language/index.html deleted file mode 100644 index cf045cf5b4..0000000000 --- a/files/zh-tw/web/api/navigatorlanguage/language/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: NavigatorLanguage.language -slug: Web/API/NavigatorLanguage/language -tags: -- API -- Language -- NavigatorLanguage -- Property -- Read-only -- Reference ---- -
{{APIRef("HTML DOM")}}
- -

NavigatorLanguage.language 是一個唯讀的屬性,回傳使用者偏好的語言字串,通常是瀏覽器UI的文字

- -

語法

- -
const lang = navigator.language
-
- -

- -

一個 {{domxref("DOMString")}}. lang 儲存一個代表此語言的字串。定義在BCP 47。 範例: 合法的語言代碼 "en", "en-US", "fr", "fr-FR", "es-ES", etc.

- -

在 iOS 小於 10.2 的 Safari 國碼是回傳小寫的喲! - "en-us", "fr-fr" etc.

- -

範例

- -
if (/^en\b/.test(navigator.language)) {
-  doLangSelect(window.navigator.language);
-}
-
- -

規範

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-navigator-language', 'NavigatorLanguage: language')}}{{Spec2('HTML WHATWG')}}Initial definition
- -

瀏覽器相容性

- -

{{Compat("api.NavigatorLanguage.language")}}

- -

參見

- - diff --git a/files/zh-tw/web/api/navigatoronline/index.html b/files/zh-tw/web/api/navigatoronline/index.html deleted file mode 100644 index 6e6eafaa48..0000000000 --- a/files/zh-tw/web/api/navigatoronline/index.html +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: NavigatorOnLine -slug: Web/API/NavigatorOnLine -translation_of: Web/API/NavigatorOnLine ---- -

{{APIRef("HTML DOM")}}

- -

In progress The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

- -

There is no object of type NavigatorOnLine, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

- -

Properties

- -

The NavigatorOnLine interface doesn't inherit any property.

- -
-
{{domxref("NavigatorOnLine.onLine")}} {{readonlyInline}}
-
Returns a {{domxref("Boolean")}} indicating whether the browser is working online.
-
- -

Methods

- -

The NavigatorOnLine interface neither implements, nor inherit any method.

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML WHATWG')}}No change from the latest snapshot, {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', '#navigatoronline', 'NavigatorOnLine')}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}} with its initial specification.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoDesktop(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
on {{domxref("WorkerNavigator")}}{{CompatUnknown}}{{CompatGeckoMobile(29)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

See also

- - diff --git a/files/zh-tw/web/api/navigatoronline/online_and_offline_events/index.html b/files/zh-tw/web/api/navigatoronline/online_and_offline_events/index.html deleted file mode 100644 index c8bf629d8c..0000000000 --- a/files/zh-tw/web/api/navigatoronline/online_and_offline_events/index.html +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: Firefox 3 Online and Offline Events -slug: Web/API/NavigatorOnLine/Online_and_offline_events -translation_of: Web/API/NavigatorOnLine/Online_and_offline_events ---- -

Firefox 3 Online and Offline Events From MoztwWiki

-

Firefox 3 依據 WHATWG Web Applications 1.0 Specification 實做了 Offline/Online Events

-

概觀

-

打造可以離線跑的網路應用程式時,我們往往需要讓程式知道目前的網路狀況。實際上,網路應用程式一般的需求可細分如下:

- -

有了 Online/offline events,要滿足這些需求變得很簡單。

-

此外,你的網路應用程式有時可能必須將某些 HTML 文件列入快取中,以便使用者離線時可以存取,如有這個需求,你可以在 HTML 文件的 <HEAD> 加入 <link> 元素:

-
<link rel="offline-resource" href="myresource">
-

Firefox 3 看到這些語法時,就會將這些資源列入一個特殊的離線資源快取(offline resource cache)中,讓使用者在離線時,依舊可以被存取這些資源。

-

API

- -
-
- avigator.onLine 是一個 property,其值可為 true/false (true 代表 online, false 代表 offline)。當使用者將瀏覽器切換成 Offline Mode 時(透過 主選單 -> 檔案 -> 離線模式),這個 property 就會被更新。
-
-
-
- 除此之外,根據規格書的建議,在瀏覽器無法連接到網路時,也應該更新這個 property。規格書上是這樣寫的:
-
-
- The navigator.onLine attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)...
-
-
-
-
- Firefox 2 在我們將瀏覽器切換成為離線模式、或離開離線模式時,會更新這個 property,在失去網路連線、或重新連線到網路時,也會更新這個 property。
-
-
-
- 在比較老的 Firefox 與 Internet Explorer 版本,也有支援這個 property (事實上,規格書是依據這些之前版本的實做結果來制定的),所以現在就可以馬上開始使用它。
-
-
-
- 但「自動偵測網路狀況」是在 Firefox 2 中才實做出來。
-
-

online and offline events

-
-
- Firefox 3 新增了兩個 events 的支援: "online" 及 "offline"。當我們切換瀏覽器的 online/offline 狀態時,就會對每個頁面的 <body> 觸發這兩個事件。除此之外,這兩個事件會從 document.body bubble up 到 document,到 window 才結束。這兩個事件都是 non-cancellable 的(因為你無法防止使用者連線到網路、或離線)。
-
-
-
- 有好幾種你熟悉的方式可以用來註冊這兩個事件的 listeners:
-
-
-
-
    -
  • 對 window, document 或 document.body 使用 addEventListener。
  • -
  • 對 document 或 document.body 設定 .ononline 或 .onoffline properties 作為一個 JavaScript Function object. (注意: 使用 window.ononline 或 window.onoffline 無法作用,這是為了相容性。)
  • -
  • 在 html 文件的 <body> 指定 ononline="..." 或 onoffline="..." attributes。
  • -
-
-
-

例子

-

這裡有個簡單的例子

-
<!doctype html>
- <html>
- <head>
-   <script>
-     function updateOnlineStatus(msg) {
-       var status = document.getElementById("status");
-       var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
-       status.setAttribute("class", condition);
-       var state = document.getElementById("state");
-       state.innerHTML = condition;
-       var log = document.getElementById("log");
-       log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
-     }
-     function loaded() {
-       updateOnlineStatus("load");
-       document.body.addEventListener("offline", function () {
-         updateOnlineStatus("offline")
-       }, false);
-       document.body.addEventListener("online", function () {
-         updateOnlineStatus("online")
-       }, false);
-     }
-   </script>
-   <style>...</style>
- </head>
- <body onload="loaded()">
-   <div id="status"><p id="state"></p></div>
-   <div id="log"></div>
- </body>
- </html>
-

參考資料

- -- cgit v1.2.3-54-g00ecf