From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- files/zh-tw/_wikihistory.json | 9180 -------------------- .../archive/add-ons/developing_add-ons/index.html | 50 - files/zh-tw/archive/add-ons/index.html | 8 - .../index.html | 51 - .../working_with_multiprocess_firefox/index.html | 235 - .../zh-tw/archive/apps/advanced_topics/index.html | 76 - files/zh-tw/archive/apps/index.html | 8 - .../contacts/index.html | 71 - .../device_storage/index.html | 111 - .../geolocation/index.html | 20 - .../3rd_party_app_developer_guide/index.html | 90 - .../web_activity/index.html | 116 - .../index.html" | 70 - .../index.html" | 78 - files/zh-tw/archive/b2g_os/add-ons/index.html | 282 - files/zh-tw/archive/b2g_os/api/fmradio/index.html | 110 - files/zh-tw/archive/b2g_os/api/index.html | 156 - files/zh-tw/archive/b2g_os/apps/index.html | 45 - .../apps/writing_a_web_app_for_b2g/index.html | 25 - files/zh-tw/archive/b2g_os/architecture/index.html | 717 -- .../gaia_ui_tests_run_tests/index.html | 111 - .../automated_testing/gaia-ui-tests/index.html | 69 - .../archive/b2g_os/automated_testing/index.html | 77 - files/zh-tw/archive/b2g_os/building/index.html | 124 - .../firefox_os_build_process_summary/index.html | 108 - .../building_and_installing_firefox_os/index.html | 65 - .../choosing_how_to_run_gaia_or_b2g/index.html | 59 - files/zh-tw/archive/b2g_os/debugging/index.html | 21 - .../firefox_os_build_prerequisites/index.html | 606 -- files/zh-tw/archive/b2g_os/index.html | 222 - .../index.html | 53 - files/zh-tw/archive/b2g_os/introduction/index.html | 86 - .../archive/b2g_os/phone_guide/flame/index.html | 50 - files/zh-tw/archive/b2g_os/phone_guide/index.html | 6 - .../archive/b2g_os/phone_guide/zte_open/index.html | 287 - .../b2g_os/platform/apps_architecture/index.html | 24 - .../b2g_os/platform/gaia/gaia_apps/index.html | 78 - .../zh-tw/archive/b2g_os/platform/gaia/index.html | 68 - .../platform/gaia/introduction_to_gaia/index.html | 13 - .../zh-tw/archive/b2g_os/platform/gonk/index.html | 22 - files/zh-tw/archive/b2g_os/platform/index.html | 75 - .../index.html | 53 - .../preparing_for_your_first_b2g_build/index.html | 138 - .../archive/b2g_os/quickstart/app_tools/index.html | 28 - files/zh-tw/archive/b2g_os/quickstart/index.html | 51 - .../b2g_os/quickstart/your_first_app/index.html | 265 - files/zh-tw/archive/b2g_os/releases/1.2/index.html | 465 - files/zh-tw/archive/b2g_os/releases/index.html | 24 - .../index.html | 43 - .../index.html | 208 - .../security/application_security/index.html | 124 - files/zh-tw/archive/b2g_os/security/index.html | 70 - .../b2g_os/security/security_model/index.html | 299 - .../b2g_os/security/system_security/index.html | 376 - files/zh-tw/archive/b2g_os/simulator/index.html | 90 - .../simulator/simulator_walkthrough/index.html | 268 - .../b2g_os/using_the_app_manager/index.html | 259 - .../b2g_os/using_the_b2g_desktop_client/index.html | 180 - .../b2g_os/using_the_b2g_emulators/index.html | 69 - .../archive/b2g_os/web_telephony_api/index.html | 25 - .../writing_apps_for_boot_to_gecko/index.html | 12 - files/zh-tw/archive/css3/index.html | 584 -- files/zh-tw/archive/index.html | 21 - files/zh-tw/archive/mdn/index.html | 18 - .../zh-tw/archive/mdn/persona_sign-ins/index.html | 28 - .../archive/meta_docs/custom_classes/index.html | 189 - files/zh-tw/archive/meta_docs/index.html | 12 - .../creating_a_web_based_tone_generator/index.html | 91 - files/zh-tw/archive/misc_top_level/index.html | 8 - .../index.html | 18 - .../mozilla/creating_a_microsummary/index.html | 214 - .../zh-tw/archive/mozilla/drag_and_drop/index.html | 142 - files/zh-tw/archive/mozilla/firefox/index.html | 8 - .../mozilla/firefox/using_microformats/index.html | 78 - files/zh-tw/archive/mozilla/index.html | 10 - .../archive/mozilla/marketplace/apis/index.html | 36 - .../archive/mozilla/marketplace/faq/index.html | 154 - files/zh-tw/archive/mozilla/marketplace/index.html | 159 - .../marketplace/marketplace_apis/index.html | 69 - .../monetization/app_payments_guide/index.html | 48 - .../monetization/app_pricing/index.html | 3698 -------- .../monetization/in-app_payments/index.html | 332 - .../mozilla/marketplace/monetization/index.html | 80 - .../introduction_monetization/index.html | 77 - .../monetization/payments_status/index.html | 30 - .../profiting_from_your_app/index.html | 95 - .../monetization/validating_a_receipt/index.html | 132 - .../marketplace/options/hosted_apps/index.html | 69 - .../publishing/adding_a_subdomain/index.html | 40 - .../publishing/creating_a_store/index.html | 22 - .../mozilla/marketplace/publishing/index.html | 9 - .../marketplace/publishing/introduction/index.html | 87 - .../managing_your_apps/app_statistics/index.html | 66 - .../marketplace_screenshot_criteria/index.html | 80 - .../publishing/packaged_apps/index.html | 75 - .../publishing/policies_and_guidelines/index.html | 10 - .../introduction/index.html | 39 - .../publishing/pricing/introduction/index.html | 57 - .../publishing/pricing/payment_accounts/index.html | 61 - .../promote_as_upgrade_to_free_version/index.html | 26 - .../publishing/privacy_policies/index.html | 28 - .../publishing/publish_options/index.html | 145 - .../publishing/submission_checklist/index.html | 72 - .../submit/enter_your_apps_details/index.html | 129 - .../marketplace/publishing/submit/index.html | 10 - .../publishing/submit/load_your_app/index.html | 134 - .../publishing/submit/next_steps/index.html | 16 - .../publishing/submit/overview/index.html | 128 - .../sign-in_to_your_developer_account/index.html | 52 - .../publishing/updating_apps/index.html | 27 - .../mozilla/marketplace/submission/index.html | 9 - .../marketplace_review_criteria/index.html | 80 - .../submission/pre-submission_checklist/index.html | 36 - .../submission/rating_your_content/index.html | 117 - .../index.html | 1070 --- .../archive/mozilla/persona/branding/index.html | 42 - files/zh-tw/archive/mozilla/persona/index.html | 125 - .../persona/internationalization/index.html | 51 - .../archive/mozilla/persona/quick_setup/index.html | 137 - .../persona/remote_verification_api/index.html | 171 - .../archive/mozilla/persona/why_persona/index.html | 30 - files/zh-tw/archive/mozilla/xpinstall/index.html | 65 - .../xpinstall/scripting_by_example/index.html | 244 - files/zh-tw/archive/mozilla/xul/index.html | 99 - .../archive/mozilla/xul/template_guide/index.html | 5 - .../archive/mozilla/xul/the_joy_of_xul/index.html | 49 - .../archive/mozilla/xul/xul_reference/index.html | 344 - files/zh-tw/archive/mozilla/xulrunner/index.html | 88 - .../mozilla/xulrunner/xulrunner_tips/index.html | 213 - files/zh-tw/archive/themes/index.html | 11 - files/zh-tw/archive/web/e4x/index.html | 6 - .../web/e4x/processing_xml_with_e4x/index.html | 229 - files/zh-tw/archive/web/index.html | 12 - files/zh-tw/archive/web_standards/index.html | 76 - .../rdf_in_fifty_words_or_less/index.html | 85 - files/zh-tw/code_snippets/index.html | 190 - .../zh-tw/code_snippets/tabbed_browser/index.html | 398 - files/zh-tw/extensions/index.html | 9 - .../index.html | 49 - .../index.html" | 884 -- .../firefox_3_animated_png_support/index.html | 39 - .../firefox_3_drag_and_drop_events/index.html | 33 - .../tcpsocket/index.html" | 140 - .../introducing_the_audio_api_extension/index.html | 181 - .../localization_quick_start_guide/index.html | 32 - .../initial_setup/index.html | 95 - files/zh-tw/mercurial/index.html | 22 - .../mozilla/add-ons/add-on_debugger/index.html | 78 - .../mozilla/add-ons/add-on_guidelines/index.html | 117 - files/zh-tw/mozilla/add-ons/amo/index.html | 9 - files/zh-tw/mozilla/add-ons/amo/policy/index.html | 21 - .../index.html" | 24 - .../add-ons/firefox_for_android/api/index.html | 30 - .../mozilla/add-ons/firefox_for_android/index.html | 70 - files/zh-tw/mozilla/add-ons/sdk/builder/index.html | 13 - files/zh-tw/mozilla/add-ons/sdk/guides/index.html | 115 - .../sdk/high-level_apis/context-menu/index.html | 588 -- .../mozilla/add-ons/sdk/high-level_apis/index.html | 10 - files/zh-tw/mozilla/add-ons/sdk/index.html | 82 - .../mozilla/add-ons/sdk/low-level_apis/index.html | 20 - .../mozilla/add-ons/themes/obsolete/index.html | 10 - .../index.html | 66 - files/zh-tw/mozilla/chrome_registration/index.html | 348 - files/zh-tw/mozilla/connect/index.html | 126 - .../mozilla/creating_mozsearch_plugins/index.html | 56 - .../mozilla/firefox/developer_edition/index.html | 56 - .../firefox/developer_edition/reverting/index.html | 25 - .../firefox/multiprocess_firefox/index.html | 80 - files/zh-tw/mozilla/firefox/privacy/index.html | 9 - .../firefox/privacy/tracking_protection/index.html | 74 - .../3/firefox_3_css_improvement/index.html | 30 - .../gecko/chrome/api/browser_api/index.html | 158 - files/zh-tw/mozilla/gecko/chrome/api/index.html | 14 - files/zh-tw/mozilla/gecko/chrome/index.html | 15 - files/zh-tw/mozilla/gecko/index.html | 65 - .../infallible_memory_allocation/index.html | 84 - .../introduction_to_layout_in_mozilla/index.html | 358 - .../mozilla/javascript_code_modules/index.html | 102 - .../javascript_code_modules/promise.jsm/index.html | 144 - .../promise.jsm/promise/index.html | 215 - files/zh-tw/mozilla/js-ctypes/index.html | 97 - files/zh-tw/mozilla/localization/index.html | 25 - .../localizing_with_pontoon/index.html | 135 - files/zh-tw/mozilla/mathml_project/index.html | 60 - .../mozilla/mathml_project/screenshots/index.html | 14 - .../\351\226\213\351\240\255/index.html" | 91 - .../performance/about_colon_memory/index.html | 188 - files/zh-tw/mozilla/performance/index.html | 130 - files/zh-tw/mozilla/preferences/index.html | 48 - .../preferences/preferences_system/index.html | 40 - .../preferences_system/new_attributes/index.html | 55 - files/zh-tw/mozilla/projects/index.html | 14 - .../nss/getting_started_with_nss/index.html | 58 - files/zh-tw/mozilla/projects/nss/index.html | 180 - files/zh-tw/mozilla/projects/rhino/index.html | 27 - .../mozilla/projects/rhino/license/index.html | 47 - .../mozilla/qa/bug_writing_guidelines/index.html | 246 - files/zh-tw/mozilla/qa/index.html | 251 - files/zh-tw/mozilla/rust/index.html | 40 - files/zh-tw/mozilla/tech/index.html | 14 - .../zh-tw/mozilla/tech/xpcom/reference/index.html | 27 - .../tech/xpcom/reference/interface/index.html | 19 - .../interface/nsicontentpolicy/index.html | 491 -- .../autoconfiguration/fileformat/howto/index.html | 199 - .../autoconfiguration/fileformat/index.html | 10 - .../thunderbird/autoconfiguration/index.html | 113 - .../index.html | 26 - .../index.html | 260 - files/zh-tw/mozilla/thunderbird/index.html | 79 - .../thunderbird/thunderbird_extensions/index.html | 135 - .../theme_packaging/index.html | 105 - files/zh-tw/prism/index.html | 89 - .../index.html" | 21 - .../index.html" | 11 - files/zh-tw/profile_manager/index.html | 110 - files/zh-tw/sandbox/index.html | 180 - files/zh-tw/tools/scratchpad/index.html | 109 - files/zh-tw/tools/webide/index.html | 290 - .../zh-tw/tools/webide/troubleshooting/index.html | 46 - .../javascript/new_in_javascript/1.1/index.html | 71 - .../javascript/new_in_javascript/1.2/index.html | 89 - .../javascript/new_in_javascript/1.3/index.html | 138 - .../javascript/new_in_javascript/1.4/index.html | 25 - .../javascript/new_in_javascript/1.5/index.html | 37 - .../javascript/new_in_javascript/1.6/index.html | 87 - .../javascript/new_in_javascript/1.7/index.html | 600 -- .../javascript/new_in_javascript/1.8.1/index.html | 41 - .../javascript/new_in_javascript/1.8.5/index.html | 132 - .../javascript/new_in_javascript/1.8/index.html | 125 - .../web/javascript/new_in_javascript/index.html | 71 - .../index.html" | 25 - .../index.html" | 105 - .../index.html" | 87 - .../index.html" | 13 - .../index.html" | 15 - .../index.html" | 18 - .../index.html" | 50 - .../global_objects/object/watch/index.html | 191 - files/zh-tw/webapi/alarm/index.html | 196 - files/zh-tw/webapi/camera/index.html | 20 - files/zh-tw/webapi/contacts/index.html | 197 - files/zh-tw/webapi/device_storage/index.html | 228 - files/zh-tw/webapi/idle/index.html | 61 - files/zh-tw/webapi/network_stats/index.html | 86 - files/zh-tw/webapi/power_management/index.html | 102 - files/zh-tw/webapi/settings/index.html | 69 - files/zh-tw/webapi/simple_push/index.html | 115 - files/zh-tw/webapi/tcp_socket/index.html | 69 - files/zh-tw/webapi/time_and_clock/index.html | 30 - files/zh-tw/webapi/web_activities/index.html | 415 - files/zh-tw/webapi/webfm_api/index.html | 130 - files/zh-tw/webapi/websms/index.html | 130 - files/zh-tw/xpcom/index.html | 47 - .../zh-tw/xul_\346\225\231\345\255\270/index.html" | 136 - files/zh-tw/zones/index.html | 53 - .../index.html" | 32 - .../background/index.html" | 102 - .../index.html" | 97 - .../index.html" | 23 - .../contents.rdf/index.html" | 48 - .../index.html" | 38 - .../install.rdf/index.html" | 47 - .../uuid/index.html" | 16 - .../index.html" | 117 - 264 files changed, 41765 deletions(-) delete mode 100644 files/zh-tw/_wikihistory.json delete mode 100644 files/zh-tw/archive/add-ons/developing_add-ons/index.html delete mode 100644 files/zh-tw/archive/add-ons/index.html delete mode 100644 files/zh-tw/archive/add-ons/supporting_search_suggestions_in_search_plugins/index.html delete mode 100644 files/zh-tw/archive/add-ons/working_with_multiprocess_firefox/index.html delete mode 100644 files/zh-tw/archive/apps/advanced_topics/index.html delete mode 100644 files/zh-tw/archive/apps/index.html delete mode 100644 files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/contacts/index.html delete mode 100644 files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/device_storage/index.html delete mode 100644 files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/geolocation/index.html delete mode 100644 files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/index.html delete mode 100644 files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/web_activity/index.html delete mode 100644 "files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/\345\260\201\345\214\205\345\274\217_(packaged)_app/index.html" delete mode 100644 "files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/\346\211\230\347\256\241\346\233\264\346\226\260\344\275\234\346\245\255_(hosting_updates)_/index.html" delete mode 100644 files/zh-tw/archive/b2g_os/add-ons/index.html delete mode 100644 files/zh-tw/archive/b2g_os/api/fmradio/index.html delete mode 100644 files/zh-tw/archive/b2g_os/api/index.html delete mode 100644 files/zh-tw/archive/b2g_os/apps/index.html delete mode 100644 files/zh-tw/archive/b2g_os/apps/writing_a_web_app_for_b2g/index.html delete mode 100644 files/zh-tw/archive/b2g_os/architecture/index.html delete mode 100644 files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/gaia_ui_tests_run_tests/index.html delete mode 100644 files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/index.html delete mode 100644 files/zh-tw/archive/b2g_os/automated_testing/index.html delete mode 100644 files/zh-tw/archive/b2g_os/building/index.html delete mode 100644 files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/firefox_os_build_process_summary/index.html delete mode 100644 files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/index.html delete mode 100644 files/zh-tw/archive/b2g_os/choosing_how_to_run_gaia_or_b2g/index.html delete mode 100644 files/zh-tw/archive/b2g_os/debugging/index.html delete mode 100644 files/zh-tw/archive/b2g_os/firefox_os_build_prerequisites/index.html delete mode 100644 files/zh-tw/archive/b2g_os/index.html delete mode 100644 files/zh-tw/archive/b2g_os/installing_boot_to_gecko_on_a_mobile_device/index.html delete mode 100644 files/zh-tw/archive/b2g_os/introduction/index.html delete mode 100644 files/zh-tw/archive/b2g_os/phone_guide/flame/index.html delete mode 100644 files/zh-tw/archive/b2g_os/phone_guide/index.html delete mode 100644 files/zh-tw/archive/b2g_os/phone_guide/zte_open/index.html delete mode 100644 files/zh-tw/archive/b2g_os/platform/apps_architecture/index.html delete mode 100644 files/zh-tw/archive/b2g_os/platform/gaia/gaia_apps/index.html delete mode 100644 files/zh-tw/archive/b2g_os/platform/gaia/index.html delete mode 100644 files/zh-tw/archive/b2g_os/platform/gaia/introduction_to_gaia/index.html delete mode 100644 files/zh-tw/archive/b2g_os/platform/gonk/index.html delete mode 100644 files/zh-tw/archive/b2g_os/platform/index.html delete mode 100644 files/zh-tw/archive/b2g_os/platform/out_of_memory_management_on_firefox_os/index.html delete mode 100644 files/zh-tw/archive/b2g_os/preparing_for_your_first_b2g_build/index.html delete mode 100644 files/zh-tw/archive/b2g_os/quickstart/app_tools/index.html delete mode 100644 files/zh-tw/archive/b2g_os/quickstart/index.html delete mode 100644 files/zh-tw/archive/b2g_os/quickstart/your_first_app/index.html delete mode 100644 files/zh-tw/archive/b2g_os/releases/1.2/index.html delete mode 100644 files/zh-tw/archive/b2g_os/releases/index.html delete mode 100644 files/zh-tw/archive/b2g_os/running_custom_builds_in_the_app_manager/index.html delete mode 100644 files/zh-tw/archive/b2g_os/screencast_series_colon__app_basics_for_firefox_os/index.html delete mode 100644 files/zh-tw/archive/b2g_os/security/application_security/index.html delete mode 100644 files/zh-tw/archive/b2g_os/security/index.html delete mode 100644 files/zh-tw/archive/b2g_os/security/security_model/index.html delete mode 100644 files/zh-tw/archive/b2g_os/security/system_security/index.html delete mode 100644 files/zh-tw/archive/b2g_os/simulator/index.html delete mode 100644 files/zh-tw/archive/b2g_os/simulator/simulator_walkthrough/index.html delete mode 100644 files/zh-tw/archive/b2g_os/using_the_app_manager/index.html delete mode 100644 files/zh-tw/archive/b2g_os/using_the_b2g_desktop_client/index.html delete mode 100644 files/zh-tw/archive/b2g_os/using_the_b2g_emulators/index.html delete mode 100644 files/zh-tw/archive/b2g_os/web_telephony_api/index.html delete mode 100644 files/zh-tw/archive/b2g_os/writing_apps_for_boot_to_gecko/index.html delete mode 100644 files/zh-tw/archive/css3/index.html delete mode 100644 files/zh-tw/archive/index.html delete mode 100644 files/zh-tw/archive/mdn/index.html delete mode 100644 files/zh-tw/archive/mdn/persona_sign-ins/index.html delete mode 100644 files/zh-tw/archive/meta_docs/custom_classes/index.html delete mode 100644 files/zh-tw/archive/meta_docs/index.html delete mode 100644 files/zh-tw/archive/misc_top_level/creating_a_web_based_tone_generator/index.html delete mode 100644 files/zh-tw/archive/misc_top_level/index.html delete mode 100644 files/zh-tw/archive/misc_top_level/same-origin_policy_for_file_colon__uris/index.html delete mode 100644 files/zh-tw/archive/mozilla/creating_a_microsummary/index.html delete mode 100644 files/zh-tw/archive/mozilla/drag_and_drop/index.html delete mode 100644 files/zh-tw/archive/mozilla/firefox/index.html delete mode 100644 files/zh-tw/archive/mozilla/firefox/using_microformats/index.html delete mode 100644 files/zh-tw/archive/mozilla/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/apis/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/faq/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/marketplace_apis/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/monetization/app_payments_guide/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/monetization/app_pricing/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/monetization/in-app_payments/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/monetization/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/monetization/introduction_monetization/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/monetization/payments_status/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/monetization/profiting_from_your_app/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/monetization/validating_a_receipt/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/options/hosted_apps/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/adding_a_subdomain/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/creating_a_store/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/introduction/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/managing_your_apps/app_statistics/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/marketplace_screenshot_criteria/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/packaged_apps/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/introduction/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/pricing/introduction/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/pricing/payment_accounts/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/pricing/promote_as_upgrade_to_free_version/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/privacy_policies/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/publish_options/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/submission_checklist/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/submit/enter_your_apps_details/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/submit/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/submit/load_your_app/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/submit/next_steps/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/submit/overview/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/submit/sign-in_to_your_developer_account/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/publishing/updating_apps/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/submission/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/submission/marketplace_review_criteria/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/submission/pre-submission_checklist/index.html delete mode 100644 files/zh-tw/archive/mozilla/marketplace/submission/rating_your_content/index.html delete mode 100644 files/zh-tw/archive/mozilla/migrate_apps_from_internet_explorer_to_mozilla/index.html delete mode 100644 files/zh-tw/archive/mozilla/persona/branding/index.html delete mode 100644 files/zh-tw/archive/mozilla/persona/index.html delete mode 100644 files/zh-tw/archive/mozilla/persona/internationalization/index.html delete mode 100644 files/zh-tw/archive/mozilla/persona/quick_setup/index.html delete mode 100644 files/zh-tw/archive/mozilla/persona/remote_verification_api/index.html delete mode 100644 files/zh-tw/archive/mozilla/persona/why_persona/index.html delete mode 100644 files/zh-tw/archive/mozilla/xpinstall/index.html delete mode 100644 files/zh-tw/archive/mozilla/xpinstall/scripting_by_example/index.html delete mode 100644 files/zh-tw/archive/mozilla/xul/index.html delete mode 100644 files/zh-tw/archive/mozilla/xul/template_guide/index.html delete mode 100644 files/zh-tw/archive/mozilla/xul/the_joy_of_xul/index.html delete mode 100644 files/zh-tw/archive/mozilla/xul/xul_reference/index.html delete mode 100644 files/zh-tw/archive/mozilla/xulrunner/index.html delete mode 100644 files/zh-tw/archive/mozilla/xulrunner/xulrunner_tips/index.html delete mode 100644 files/zh-tw/archive/themes/index.html delete mode 100644 files/zh-tw/archive/web/e4x/index.html delete mode 100644 files/zh-tw/archive/web/e4x/processing_xml_with_e4x/index.html delete mode 100644 files/zh-tw/archive/web/index.html delete mode 100644 files/zh-tw/archive/web_standards/index.html delete mode 100644 files/zh-tw/archive/web_standards/rdf_in_fifty_words_or_less/index.html delete mode 100644 files/zh-tw/code_snippets/index.html delete mode 100644 files/zh-tw/code_snippets/tabbed_browser/index.html delete mode 100644 files/zh-tw/extensions/index.html delete mode 100644 files/zh-tw/extensions/using_the_dom_file_api_in_chrome_code/index.html delete mode 100644 "files/zh-tw/firefox_2_\344\275\210\346\231\257\344\270\273\351\241\214\344\271\213\346\233\264\345\213\225/index.html" delete mode 100644 files/zh-tw/firefox_3_animated_png_support/index.html delete mode 100644 files/zh-tw/firefox_3_drag_and_drop_events/index.html delete mode 100644 "files/zh-tw/gecko_dom_\345\217\203\350\200\203/tcpsocket/index.html" delete mode 100644 files/zh-tw/introducing_the_audio_api_extension/index.html delete mode 100644 files/zh-tw/localization_quick_start_guide/index.html delete mode 100644 files/zh-tw/localization_quick_start_guide/initial_setup/index.html delete mode 100644 files/zh-tw/mercurial/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/add-on_debugger/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/add-on_guidelines/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/amo/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/amo/policy/index.html delete mode 100644 "files/zh-tw/mozilla/add-ons/amo/policy/\350\201\257\347\265\241\350\263\207\350\250\212/index.html" delete mode 100644 files/zh-tw/mozilla/add-ons/firefox_for_android/api/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/firefox_for_android/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/builder/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/guides/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/high-level_apis/context-menu/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/high-level_apis/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/low-level_apis/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/themes/obsolete/index.html delete mode 100644 files/zh-tw/mozilla/adding_phishing_protection_data_providers/index.html delete mode 100644 files/zh-tw/mozilla/chrome_registration/index.html delete mode 100644 files/zh-tw/mozilla/connect/index.html delete mode 100644 files/zh-tw/mozilla/creating_mozsearch_plugins/index.html delete mode 100644 files/zh-tw/mozilla/firefox/developer_edition/index.html delete mode 100644 files/zh-tw/mozilla/firefox/developer_edition/reverting/index.html delete mode 100644 files/zh-tw/mozilla/firefox/multiprocess_firefox/index.html delete mode 100644 files/zh-tw/mozilla/firefox/privacy/index.html delete mode 100644 files/zh-tw/mozilla/firefox/privacy/tracking_protection/index.html delete mode 100644 files/zh-tw/mozilla/firefox/releases/3/firefox_3_css_improvement/index.html delete mode 100644 files/zh-tw/mozilla/gecko/chrome/api/browser_api/index.html delete mode 100644 files/zh-tw/mozilla/gecko/chrome/api/index.html delete mode 100644 files/zh-tw/mozilla/gecko/chrome/index.html delete mode 100644 files/zh-tw/mozilla/gecko/index.html delete mode 100644 files/zh-tw/mozilla/infallible_memory_allocation/index.html delete mode 100644 files/zh-tw/mozilla/introduction_to_layout_in_mozilla/index.html delete mode 100644 files/zh-tw/mozilla/javascript_code_modules/index.html delete mode 100644 files/zh-tw/mozilla/javascript_code_modules/promise.jsm/index.html delete mode 100644 files/zh-tw/mozilla/javascript_code_modules/promise.jsm/promise/index.html delete mode 100644 files/zh-tw/mozilla/js-ctypes/index.html delete mode 100644 files/zh-tw/mozilla/localization/index.html delete mode 100644 files/zh-tw/mozilla/localization/localizing_with_pontoon/index.html delete mode 100644 files/zh-tw/mozilla/mathml_project/index.html delete mode 100644 files/zh-tw/mozilla/mathml_project/screenshots/index.html delete mode 100644 "files/zh-tw/mozilla/mathml_project/\351\226\213\351\240\255/index.html" delete mode 100644 files/zh-tw/mozilla/performance/about_colon_memory/index.html delete mode 100644 files/zh-tw/mozilla/performance/index.html delete mode 100644 files/zh-tw/mozilla/preferences/index.html delete mode 100644 files/zh-tw/mozilla/preferences/preferences_system/index.html delete mode 100644 files/zh-tw/mozilla/preferences/preferences_system/new_attributes/index.html delete mode 100644 files/zh-tw/mozilla/projects/index.html delete mode 100644 files/zh-tw/mozilla/projects/nss/getting_started_with_nss/index.html delete mode 100644 files/zh-tw/mozilla/projects/nss/index.html delete mode 100644 files/zh-tw/mozilla/projects/rhino/index.html delete mode 100644 files/zh-tw/mozilla/projects/rhino/license/index.html delete mode 100644 files/zh-tw/mozilla/qa/bug_writing_guidelines/index.html delete mode 100644 files/zh-tw/mozilla/qa/index.html delete mode 100644 files/zh-tw/mozilla/rust/index.html delete mode 100644 files/zh-tw/mozilla/tech/index.html delete mode 100644 files/zh-tw/mozilla/tech/xpcom/reference/index.html delete mode 100644 files/zh-tw/mozilla/tech/xpcom/reference/interface/index.html delete mode 100644 files/zh-tw/mozilla/tech/xpcom/reference/interface/nsicontentpolicy/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/howto/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/autoconfiguration/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/upgrading_thunderbird_in_the_enterprise/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/thunderbird_extensions/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/thunderbird_extensions/theme_packaging/index.html delete mode 100644 files/zh-tw/prism/index.html delete mode 100644 "files/zh-tw/prism/\344\270\273\350\246\226\347\252\227/index.html" delete mode 100644 "files/zh-tw/prism/\345\256\211\350\243\235\347\250\213\345\274\217/index.html" delete mode 100644 files/zh-tw/profile_manager/index.html delete mode 100644 files/zh-tw/sandbox/index.html delete mode 100644 files/zh-tw/tools/scratchpad/index.html delete mode 100644 files/zh-tw/tools/webide/index.html delete mode 100644 files/zh-tw/tools/webide/troubleshooting/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.1/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.2/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.3/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.4/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.5/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.6/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.7/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.8.1/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.8.5/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/1.8/index.html delete mode 100644 files/zh-tw/web/javascript/new_in_javascript/index.html delete mode 100644 "files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/java_\345\220\221_javascript_\347\232\204\351\200\232\350\250\212/index.html" delete mode 100644 "files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/java_\345\220\221_javascript_\347\232\204\351\200\232\350\250\212/liveconnect_\351\241\236\345\210\245\347\232\204\344\275\277\347\224\250/index.html" delete mode 100644 "files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/javascript_\345\220\221_java_\347\232\204\351\200\232\350\250\212/index.html" delete mode 100644 "files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\345\214\205\350\243\235\345\231\250\347\232\204\351\201\213\347\224\250/index.html" delete mode 100644 "files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/index.html" delete mode 100644 "files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/\345\276\236_java_\345\210\260_javascript_\347\232\204\350\275\211\346\217\233/index.html" delete mode 100644 "files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/\345\276\236_javascript_\345\210\260_java_\347\232\204\350\275\211\346\217\233/index.html" delete mode 100644 files/zh-tw/web/javascript/reference/global_objects/object/watch/index.html delete mode 100644 files/zh-tw/webapi/alarm/index.html delete mode 100644 files/zh-tw/webapi/camera/index.html delete mode 100644 files/zh-tw/webapi/contacts/index.html delete mode 100644 files/zh-tw/webapi/device_storage/index.html delete mode 100644 files/zh-tw/webapi/idle/index.html delete mode 100644 files/zh-tw/webapi/network_stats/index.html delete mode 100644 files/zh-tw/webapi/power_management/index.html delete mode 100644 files/zh-tw/webapi/settings/index.html delete mode 100644 files/zh-tw/webapi/simple_push/index.html delete mode 100644 files/zh-tw/webapi/tcp_socket/index.html delete mode 100644 files/zh-tw/webapi/time_and_clock/index.html delete mode 100644 files/zh-tw/webapi/web_activities/index.html delete mode 100644 files/zh-tw/webapi/webfm_api/index.html delete mode 100644 files/zh-tw/webapi/websms/index.html delete mode 100644 files/zh-tw/xpcom/index.html delete mode 100644 "files/zh-tw/xul_\346\225\231\345\255\270/index.html" delete mode 100644 files/zh-tw/zones/index.html delete mode 100644 "files/zh-tw/\344\273\245_windows_\347\231\273\351\214\204\347\242\274\345\256\211\350\243\235\346\223\264\345\205\205\345\245\227\344\273\266/index.html" delete mode 100644 "files/zh-tw/\344\275\210\346\231\257\344\270\273\351\241\214/background/index.html" delete mode 100644 "files/zh-tw/\344\275\210\346\231\257\344\270\273\351\241\214/index.html" delete mode 100644 "files/zh-tw/\346\223\264\345\205\205\345\245\227\344\273\266/index.html" delete mode 100644 "files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/contents.rdf/index.html" delete mode 100644 "files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/index.html" delete mode 100644 "files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/install.rdf/index.html" delete mode 100644 "files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/uuid/index.html" delete mode 100644 "files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/\344\270\212\346\211\213\347\257\207/index.html" (limited to 'files/zh-tw') diff --git a/files/zh-tw/_wikihistory.json b/files/zh-tw/_wikihistory.json deleted file mode 100644 index 4febc0f7d2..0000000000 --- a/files/zh-tw/_wikihistory.json +++ /dev/null @@ -1,9180 +0,0 @@ -{ - "Core_JavaScript_1.5_正規表達式的建立": { - "modified": "2019-03-24T00:00:58.216Z", - "contributors": [ - "wbamberg", - "happysadman" - ] - }, - "Cross-site_XMLHttpRequest": { - "modified": "2019-01-16T15:28:10.716Z", - "contributors": [ - "Mgjbot", - "BobChao", - "Coolcd" - ] - }, - "DOM_觀察器": { - "modified": "2019-01-16T13:41:41.852Z", - "contributors": [ - "273K" - ] - }, - "DragDrop": { - "modified": "2019-01-16T13:26:51.358Z", - "contributors": [ - "sailplaneTW" - ] - }, - "Firefox_3.5_技術文件": { - "modified": "2019-03-23T23:59:44.778Z", - "contributors": [ - "irvinfly", - "RJ_Hsiao", - "teoli", - "Littlebtc", - "BobChao" - ] - }, - "Firefox_中的離線資源": { - "modified": "2019-03-24T00:13:31.494Z", - "contributors": [ - "sailplaneTW" - ] - }, - "Games": { - "modified": "2019-09-09T15:35:53.246Z", - "contributors": [ - "SphinxKnight", - "wbamberg", - "iigmir", - "fscholz", - "MashKao" - ] - }, - "Games/Introduction": { - "modified": "2019-01-16T19:41:58.412Z", - "contributors": [ - "wbamberg", - "jackblackevo", - "RishYang", - "MashKao" - ] - }, - "Games/Techniques": { - "modified": "2019-01-17T01:09:15.300Z", - "contributors": [ - "wbamberg", - "chrisdavidmills" - ] - }, - "Games/Tutorials": { - "modified": "2019-03-23T22:47:44.453Z", - "contributors": [ - "wbamberg", - "jackblackevo", - "chrisdavidmills" - ] - }, - "Games/Tutorials/2D_Breakout_game_pure_JavaScript": { - "modified": "2019-03-23T22:47:44.181Z", - "contributors": [ - "wbamberg", - "jackblackevo", - "MashKao", - "weihanglo", - "benjaminchen", - "RishYang" - ] - }, - "Games/Tutorials/2D_Breakout_game_pure_JavaScript/Bounce_off_the_walls": { - "modified": "2019-03-23T22:42:23.279Z", - "contributors": [ - "wbamberg", - "RishYang", - "jackblackevo", - "tomchang1", - "feiye1", - "Jamin", - "EasonWang01" - ] - }, - "Games/Tutorials/2D_Breakout_game_pure_JavaScript/Create_the_Canvas_and_draw_on_it": { - "modified": "2019-07-06T06:25:00.544Z", - "contributors": [ - "SLMT", - "wbamberg", - "jackblackevo", - "RishYang" - ] - }, - "Games/Tutorials/2D_Breakout_game_pure_JavaScript/Move_the_ball": { - "modified": "2019-03-23T22:45:54.347Z", - "contributors": [ - "wbamberg", - "jackblackevo", - "Randy_Chen", - "weihanglo", - "Jamin", - "RishYang" - ] - }, - "Glossary": { - "modified": "2020-10-07T11:15:41.747Z", - "contributors": [ - "peterbe", - "SphinxKnight", - "wbamberg", - "Chou-Chun-Yu", - "iigmir", - "marktwtn", - "jackblackevo", - "Jeremie" - ] - }, - "Glossary/404": { - "modified": "2019-03-23T22:23:29.116Z", - "contributors": [ - "iigmir", - "marktwtn" - ] - }, - "Glossary/502": { - "modified": "2019-03-18T21:44:50.733Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/AJAX": { - "modified": "2019-03-23T22:28:09.468Z", - "contributors": [ - "Rocker", - "iigmir" - ] - }, - "Glossary/API": { - "modified": "2019-03-18T21:45:17.379Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/ARIA": { - "modified": "2019-03-18T21:44:55.861Z", - "contributors": [ - "iigmir", - "Rocker" - ] - }, - "Glossary/ARPA": { - "modified": "2019-03-18T21:42:24.969Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/ASCII": { - "modified": "2019-03-18T21:42:57.788Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/ATAG": { - "modified": "2019-03-18T21:44:30.079Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Abstraction": { - "modified": "2019-03-23T22:04:33.213Z", - "contributors": [ - "serinahsu", - "jackblackevo" - ] - }, - "Glossary/Accessibility": { - "modified": "2019-08-12T14:53:15.273Z", - "contributors": [ - "ayugioh2003", - "LNDDYL", - "willynpi", - "Rocker" - ] - }, - "Glossary/Adobe_Flash": { - "modified": "2020-05-23T16:50:31.350Z", - "contributors": [ - "iigmir", - "Rocker" - ] - }, - "Glossary/Algorithm": { - "modified": "2019-01-17T00:19:24.512Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Apple_Safari": { - "modified": "2019-03-18T21:44:37.542Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Argument": { - "modified": "2019-04-23T04:30:03.619Z", - "contributors": [ - "jackblackevo", - "iigmir", - "Rocker" - ] - }, - "Glossary/Arpanet": { - "modified": "2019-03-18T21:41:50.711Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Asynchronous": { - "modified": "2019-08-12T14:24:28.607Z", - "contributors": [ - "ayugioh2003", - "petercpg", - "iigmir" - ] - }, - "Glossary/Attribute": { - "modified": "2019-03-23T22:31:19.472Z", - "contributors": [ - "Rocker", - "iigmir", - "jackblackevo" - ] - }, - "Glossary/Bandwidth": { - "modified": "2019-03-18T21:44:58.394Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Blink": { - "modified": "2019-03-23T22:26:07.848Z", - "contributors": [ - "petercpg" - ] - }, - "Glossary/Block": { - "modified": "2019-03-18T21:44:30.568Z", - "contributors": [ - "Sheppy" - ] - }, - "Glossary/Block/CSS": { - "modified": "2019-03-18T21:44:30.419Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Boolean": { - "modified": "2019-03-23T22:11:57.041Z", - "contributors": [ - "jackblackevo", - "vintif" - ] - }, - "Glossary/Bootstrap": { - "modified": "2020-05-23T17:07:57.268Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Browser": { - "modified": "2019-03-23T22:54:30.687Z", - "contributors": [ - "iigmir", - "irvinfly" - ] - }, - "Glossary/Browsing_context": { - "modified": "2019-03-18T21:45:10.444Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/CMS": { - "modified": "2020-01-08T23:11:50.383Z", - "contributors": [ - "jjyaung", - "iigmir" - ] - }, - "Glossary/CORS": { - "modified": "2019-03-23T22:20:31.350Z", - "contributors": [ - "Rocker", - "jackblackevo", - "iigmir", - "afutseng" - ] - }, - "Glossary/CRUD": { - "modified": "2019-12-13T00:20:11.698Z", - "contributors": [ - "AlanSyue" - ] - }, - "Glossary/CSP": { - "modified": "2019-03-18T21:42:06.219Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/CSRF": { - "modified": "2020-06-01T13:34:09.077Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/CSS": { - "modified": "2020-01-29T11:39:11.856Z", - "contributors": [ - "jjyaung", - "Chou-Chun-Yu", - "iigmir" - ] - }, - "Glossary/CSSOM": { - "modified": "2019-12-09T06:15:08.221Z", - "contributors": [ - "afutseng" - ] - }, - "Glossary/CSS_Selector": { - "modified": "2020-01-08T23:14:25.094Z", - "contributors": [ - "jjyaung", - "iigmir" - ] - }, - "Glossary/CSS_pixel": { - "modified": "2019-12-10T23:33:41.801Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/CSS_preprocessor": { - "modified": "2020-05-23T15:15:52.045Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Cache": { - "modified": "2020-01-07T20:19:13.685Z", - "contributors": [ - "jjyaung", - "iigmir" - ] - }, - "Glossary/Callback_function": { - "modified": "2019-03-18T21:45:30.183Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Canvas": { - "modified": "2019-03-23T22:12:33.666Z", - "contributors": [ - "vintif" - ] - }, - "Glossary/Character": { - "modified": "2019-03-23T22:15:30.036Z", - "contributors": [ - "jackblackevo", - "AfricanxAdmiral" - ] - }, - "Glossary/Chrome": { - "modified": "2019-03-23T22:49:53.479Z", - "contributors": [ - "leVirve" - ] - }, - "Glossary/Cipher_suite": { - "modified": "2019-03-18T21:44:16.996Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Ciphertext": { - "modified": "2019-03-18T21:44:24.122Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Class": { - "modified": "2019-08-12T15:30:11.761Z", - "contributors": [ - "ayugioh2003", - "Rocker" - ] - }, - "Glossary/Closure": { - "modified": "2019-03-18T21:44:42.611Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Compile": { - "modified": "2019-03-18T21:44:17.421Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Compile_time": { - "modified": "2019-03-18T21:43:32.243Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Computer_Programming": { - "modified": "2020-06-01T13:22:38.424Z", - "contributors": [ - "iigmir", - "Rocker" - ] - }, - "Glossary/Constructor": { - "modified": "2019-03-23T22:16:57.732Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Continuous_Media": { - "modified": "2020-02-25T03:18:35.922Z", - "contributors": [ - "JamesGoler" - ] - }, - "Glossary/Cookie": { - "modified": "2019-03-18T21:44:06.722Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Crawler": { - "modified": "2019-03-23T22:07:26.742Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Cryptography": { - "modified": "2019-03-18T21:44:26.909Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/DHTML": { - "modified": "2019-03-23T23:05:14.683Z", - "contributors": [ - "wildsky" - ] - }, - "Glossary/DNS": { - "modified": "2019-03-18T21:42:20.975Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/DOM": { - "modified": "2019-03-18T21:44:43.965Z", - "contributors": [ - "abler0122" - ] - }, - "Glossary/DOS_attack": { - "modified": "2019-03-18T21:43:00.216Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Data_structure": { - "modified": "2019-03-23T22:12:01.136Z", - "contributors": [ - "jackblackevo", - "vintif" - ] - }, - "Glossary/Developer_Tools": { - "modified": "2019-03-18T21:42:38.696Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Doctype": { - "modified": "2019-03-23T22:37:58.936Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Document_directive": { - "modified": "2019-03-18T21:41:10.612Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Domain": { - "modified": "2019-03-18T21:44:05.100Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Domain_name": { - "modified": "2019-04-11T07:41:10.867Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/ECMA": { - "modified": "2019-03-23T22:26:14.045Z", - "contributors": [ - "petercpg" - ] - }, - "Glossary/ECMAScript": { - "modified": "2019-08-12T15:22:21.776Z", - "contributors": [ - "ayugioh2003" - ] - }, - "Glossary/Element": { - "modified": "2019-08-12T15:14:24.188Z", - "contributors": [ - "ayugioh2003" - ] - }, - "Glossary/Empty_element": { - "modified": "2019-03-18T21:41:26.001Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Engine": { - "modified": "2019-03-18T21:41:31.602Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/FTP": { - "modified": "2019-03-18T21:42:31.337Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Firefox_OS": { - "modified": "2019-03-18T21:44:10.196Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/First-class_Function": { - "modified": "2020-04-26T05:17:55.398Z", - "contributors": [ - "nighet", - "Arisu" - ] - }, - "Glossary/First_CPU_idle": { - "modified": "2019-12-09T05:44:22.503Z", - "contributors": [ - "afutseng" - ] - }, - "Glossary/First_contentful_paint": { - "modified": "2019-12-09T05:35:40.356Z", - "contributors": [ - "afutseng" - ] - }, - "Glossary/First_input_delay": { - "modified": "2019-12-09T05:57:35.745Z", - "contributors": [ - "afutseng" - ] - }, - "Glossary/Git": { - "modified": "2019-03-23T22:20:30.755Z", - "contributors": [ - "iigmir", - "afutseng" - ] - }, - "Glossary/Grid": { - "modified": "2019-03-18T21:15:33.503Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/HTML": { - "modified": "2019-12-23T12:34:17.059Z", - "contributors": [ - "Uemmra3", - "iigmir" - ] - }, - "Glossary/HTML5": { - "modified": "2019-03-18T21:43:07.468Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/HTTP": { - "modified": "2019-03-23T22:22:08.807Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Head": { - "modified": "2019-03-18T21:42:17.897Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Hoisting": { - "modified": "2019-03-23T22:15:30.480Z", - "contributors": [ - "iigmir", - "Julia-H", - "jsgao0", - "Daisord" - ] - }, - "Glossary/Host": { - "modified": "2020-04-07T10:31:06.895Z", - "contributors": [ - "iigmir", - "slivenred", - "Rocker" - ] - }, - "Glossary/IIFE": { - "modified": "2019-03-18T21:40:45.117Z", - "contributors": [ - "PeterTing", - "othree" - ] - }, - "Glossary/IP_Address": { - "modified": "2019-03-23T22:26:11.146Z", - "contributors": [ - "LNDDYL", - "petercpg" - ] - }, - "Glossary/Identifier": { - "modified": "2019-03-18T21:42:10.774Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Immutable": { - "modified": "2019-03-23T22:14:17.839Z", - "contributors": [ - "jsgao0" - ] - }, - "Glossary/IndexedDB": { - "modified": "2019-03-23T22:27:22.105Z", - "contributors": [ - "petercpg", - "ddtet" - ] - }, - "Glossary/JSON": { - "modified": "2019-03-23T22:07:09.680Z", - "contributors": [ - "jmlntw" - ] - }, - "Glossary/Jank": { - "modified": "2019-01-17T02:24:07.422Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Java": { - "modified": "2020-05-23T17:24:41.278Z", - "contributors": [ - "iigmir", - "Rocker" - ] - }, - "Glossary/JavaScript": { - "modified": "2019-03-23T22:21:44.170Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Key": { - "modified": "2019-03-18T21:41:03.451Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Keyword": { - "modified": "2019-03-18T21:43:25.817Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Ligature": { - "modified": "2019-03-18T21:42:40.057Z", - "contributors": [ - "MashKao" - ] - }, - "Glossary/Localization": { - "modified": "2019-03-23T23:41:05.296Z", - "contributors": [ - "LNDDYL", - "jackblackevo", - "teoli", - "Mgjbot", - "Josesun" - ] - }, - "Glossary/MIME_type": { - "modified": "2020-02-27T00:22:42.482Z", - "contributors": [ - "iigmir", - "Rocker" - ] - }, - "Glossary/MVC": { - "modified": "2019-03-23T22:06:52.468Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/MathML": { - "modified": "2019-03-18T21:43:04.439Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Node.js": { - "modified": "2019-03-23T22:31:42.758Z", - "contributors": [ - "MashKao", - "iigmir" - ] - }, - "Glossary/Null": { - "modified": "2019-03-18T21:41:44.373Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Number": { - "modified": "2019-03-18T21:43:06.067Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/OOP": { - "modified": "2019-03-23T22:25:27.137Z", - "contributors": [ - "jackblackevo", - "iigmir", - "mhlin" - ] - }, - "Glossary/Object": { - "modified": "2019-03-23T22:20:26.457Z", - "contributors": [ - "iigmir", - "stdio2017" - ] - }, - "Glossary/Opera_Browser": { - "modified": "2019-03-23T22:26:09.236Z", - "contributors": [ - "petercpg" - ] - }, - "Glossary/PHP": { - "modified": "2019-12-10T23:51:32.813Z", - "contributors": [ - "iigmir", - "wildsky" - ] - }, - "Glossary/PNG": { - "modified": "2019-03-18T21:43:45.458Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/POP": { - "modified": "2019-04-11T07:11:52.215Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Parameter": { - "modified": "2020-11-15T10:35:16.374Z", - "contributors": [ - "realspirit2017" - ] - }, - "Glossary/Port": { - "modified": "2019-03-23T22:26:13.956Z", - "contributors": [ - "petercpg" - ] - }, - "Glossary/Presto": { - "modified": "2019-03-23T22:26:12.268Z", - "contributors": [ - "petercpg" - ] - }, - "Glossary/Progressive_Enhancement": { - "modified": "2019-03-23T22:22:17.291Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Protocol": { - "modified": "2019-03-23T22:26:12.061Z", - "contributors": [ - "petercpg" - ] - }, - "Glossary/Prototype": { - "modified": "2019-03-18T21:44:16.275Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Pseudo-element": { - "modified": "2019-03-23T22:04:36.224Z", - "contributors": [ - "serinahsu", - "jackblackevo" - ] - }, - "Glossary/Python": { - "modified": "2020-02-27T00:05:00.804Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/REST": { - "modified": "2019-03-18T21:43:34.013Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Recursion": { - "modified": "2019-03-23T22:24:39.190Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Reflow": { - "modified": "2019-03-23T22:14:40.596Z", - "contributors": [ - "jackblackevo" - ] - }, - "Glossary/Regular_expression": { - "modified": "2019-03-23T22:31:40.731Z", - "contributors": [ - "petercpg", - "iigmir" - ] - }, - "Glossary/Responsive_web_design": { - "modified": "2020-02-27T00:27:23.047Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Ruby": { - "modified": "2020-02-27T00:09:53.452Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/SEO": { - "modified": "2019-10-17T06:29:26.247Z", - "contributors": [ - "iigmir", - "slivenred" - ] - }, - "Glossary/SGML": { - "modified": "2019-03-23T22:26:12.834Z", - "contributors": [ - "petercpg" - ] - }, - "Glossary/SPA": { - "modified": "2020-06-01T13:03:21.776Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/SQL": { - "modified": "2019-03-23T22:28:09.553Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/SQL_Injection": { - "modified": "2019-03-23T22:31:49.084Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/SVG": { - "modified": "2019-03-23T22:08:49.246Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/SVN": { - "modified": "2019-03-18T21:40:39.931Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/Server": { - "modified": "2019-03-23T22:11:10.326Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Synchronous": { - "modified": "2019-03-18T21:45:24.621Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/Type": { - "modified": "2019-03-23T22:18:38.339Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/URI": { - "modified": "2020-11-15T10:56:07.712Z", - "contributors": [ - "realspirit2017" - ] - }, - "Glossary/URL": { - "modified": "2019-12-23T12:39:40.086Z", - "contributors": [ - "Uemmra3", - "Rocker" - ] - }, - "Glossary/Viewport": { - "modified": "2019-10-05T05:58:15.650Z", - "contributors": [ - "ayugioh2003" - ] - }, - "Glossary/W3C": { - "modified": "2019-03-23T22:28:08.358Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/WebExtensions": { - "modified": "2019-03-23T22:07:09.589Z", - "contributors": [ - "jmlntw" - ] - }, - "Glossary/WebSockets": { - "modified": "2019-03-18T21:31:09.770Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/array": { - "modified": "2019-03-23T22:15:27.805Z", - "contributors": [ - "iigmir", - "jackblackevo", - "vintif" - ] - }, - "Glossary/buffer": { - "modified": "2019-03-18T21:44:30.702Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/cacheable": { - "modified": "2019-03-18T21:43:19.964Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/character_encoding": { - "modified": "2019-03-23T22:15:28.906Z", - "contributors": [ - "jackblackevo", - "AfricanxAdmiral" - ] - }, - "Glossary/character_set": { - "modified": "2019-04-04T12:54:28.232Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/event": { - "modified": "2019-03-18T21:43:22.669Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/firewall": { - "modified": "2019-03-18T21:43:50.549Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/hash": { - "modified": "2019-03-18T21:42:32.887Z", - "contributors": [ - "Rocker" - ] - }, - "Glossary/jQuery": { - "modified": "2020-05-23T15:08:04.982Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/jpeg": { - "modified": "2019-03-18T21:44:36.385Z", - "contributors": [ - "iigmir" - ] - }, - "Glossary/property": { - "modified": "2019-03-23T22:31:19.880Z", - "contributors": [ - "iigmir", - "MashKao", - "Jeremie" - ] - }, - "Glossary/property/JavaScript": { - "modified": "2019-03-23T22:31:19.578Z", - "contributors": [ - "iigmir", - "marktwtn", - "jackblackevo" - ] - }, - "Glossary/routers": { - "modified": "2020-02-27T00:38:00.019Z", - "contributors": [ - "iigmir" - ] - }, - "HTML5_Cross_Browser_Polyfills": { - "modified": "2019-01-16T13:58:45.342Z", - "contributors": [ - "Kennyluck" - ] - }, - "Learn": { - "modified": "2020-08-04T10:38:00.665Z", - "contributors": [ - "did1335", - "SphinxKnight", - "ayugioh2003", - "svarlamov", - "xerviam", - "iigmir", - "SecondSpirit", - "afutseng", - "MashKao", - "jackblackevo", - "kscarfone" - ] - }, - "Learn/Accessibility": { - "modified": "2020-07-16T22:40:01.949Z", - "contributors": [ - "iigmir", - "hadleyel" - ] - }, - "Learn/Accessibility/Mobile": { - "modified": "2020-07-16T22:40:33.645Z", - "contributors": [ - "sophie.wulala" - ] - }, - "Learn/Accessibility/WAI-ARIA_basics": { - "modified": "2020-07-16T22:40:24.926Z", - "contributors": [ - "iigmir", - "li-liam" - ] - }, - "Learn/Accessibility/What_is_accessibility": { - "modified": "2020-07-16T22:40:07.534Z", - "contributors": [ - "ballfish", - "iigmir" - ] - }, - "Learn/CSS": { - "modified": "2020-09-05T00:19:05.982Z", - "contributors": [ - "ddtet", - "anniesnoopymd", - "PtCt", - "jackblackevo" - ] - }, - "Learn/CSS/CSS_layout": { - "modified": "2020-07-16T22:26:35.040Z", - "contributors": [ - "xuan0123", - "xerviam", - "Rocker", - "jackblackevo", - "georgelin422" - ] - }, - "Learn/CSS/First_steps": { - "modified": "2020-10-04T12:16:14.514Z", - "contributors": [ - "ddtet", - "yungfen8911", - "chrisdavidmills" - ] - }, - "Learn/CSS/First_steps/Getting_started": { - "modified": "2020-11-15T11:55:24.776Z", - "contributors": [ - "ssuhung", - "ddtet" - ] - }, - "Learn/CSS/First_steps/How_CSS_works": { - "modified": "2020-07-16T22:28:02.731Z", - "contributors": [ - "JamesGoler" - ] - }, - "Learn/CSS/First_steps/What_is_CSS": { - "modified": "2020-10-15T22:34:12.625Z", - "contributors": [ - "ddtet" - ] - }, - "Learn/CSS/Styling_text": { - "modified": "2020-07-16T22:26:01.676Z", - "contributors": [ - "jackblackevo", - "xuan0123" - ] - }, - "Learn/Common_questions": { - "modified": "2020-07-16T22:35:28.440Z", - "contributors": [ - "stephaniehobson" - ] - }, - "Learn/Common_questions/What_is_a_web_server": { - "modified": "2020-07-16T22:35:32.438Z", - "contributors": [ - "LanKuDot", - "iigmir" - ] - }, - "Learn/Getting_started_with_the_web": { - "modified": "2020-07-16T22:33:57.918Z", - "contributors": [ - "egg734631", - "jackblackevo", - "chrisdavidmills", - "2238", - "SecondSpirit", - "MashKao", - "afutseng", - "lynn456", - "arbatskiy" - ] - }, - "Learn/Getting_started_with_the_web/CSS_basics": { - "modified": "2020-08-01T04:32:20.530Z", - "contributors": [ - "wslisam", - "jpliu24", - "seanhung-isu", - "nighet", - "Paul0302", - "jjyaung", - "thegaze77", - "eric211924", - "e7822501", - "yuwei2s", - "Ruiyuan34", - "iigmir", - "Chintears", - "montagne3653", - "freddy50806", - "YuCheng", - "ffturtle" - ] - }, - "Learn/Getting_started_with_the_web/Dealing_with_files": { - "modified": "2020-07-16T22:34:39.964Z", - "contributors": [ - "jackblackevo", - "SecondSpirit" - ] - }, - "Learn/Getting_started_with_the_web/HTML_basics": { - "modified": "2020-07-16T22:34:54.083Z", - "contributors": [ - "nighet", - "jackblackevo", - "YuCheng", - "iigmir", - "weichi", - "shinglyu" - ] - }, - "Learn/Getting_started_with_the_web/How_the_Web_works": { - "modified": "2020-10-14T07:48:44.116Z", - "contributors": [ - "RocketSH", - "no249a002", - "iigmir" - ] - }, - "Learn/Getting_started_with_the_web/Installing_basic_software": { - "modified": "2020-07-16T22:34:12.856Z", - "contributors": [ - "iigmir", - "jackblackevo", - "SecondSpirit", - "MashKao" - ] - }, - "Learn/Getting_started_with_the_web/JavaScript_basics": { - "modified": "2020-07-16T22:35:18.923Z", - "contributors": [ - "rayainman", - "jyzeng17", - "Ice1187", - "Jyo238", - "Fangfeidenimen", - "jackblackevo", - "Chiahong", - "YuCheng", - "victor0801x", - "VioletVivirand" - ] - }, - "Learn/Getting_started_with_the_web/Publishing_your_website": { - "modified": "2020-07-16T22:34:30.592Z", - "contributors": [ - "jyzeng17", - "iigmir", - "MLJ" - ] - }, - "Learn/Getting_started_with_the_web/What_will_your_website_look_like": { - "modified": "2020-07-16T22:34:21.648Z", - "contributors": [ - "jackblackevo", - "iosos", - "SecondSpirit", - "MashKao" - ] - }, - "Learn/HTML": { - "modified": "2020-11-08T04:39:50.729Z", - "contributors": [ - "ssuhung", - "NekoChan-2851", - "nighet", - "jjyaung", - "ShengHaoLo", - "sbeing", - "BbsonLin", - "jian5753", - "chrisdavidmills" - ] - }, - "Learn/HTML/Forms": { - "modified": "2020-07-16T22:21:03.096Z", - "contributors": [ - "nighet", - "chrisdavidmills", - "iigmir", - "Shiyou", - "saka6333", - "jcchang", - "sjmiles" - ] - }, - "Learn/HTML/Forms/How_to_structure_an_HTML_form": { - "modified": "2020-07-16T22:21:16.863Z", - "contributors": [ - "iigmir", - "anniesnoopymd", - "chrisdavidmills", - "Sheppy", - "kitty-5420" - ] - }, - "Learn/HTML/Howto": { - "modified": "2020-07-16T22:22:31.553Z", - "contributors": [ - "fish0819", - "iigmir", - "abler0122" - ] - }, - "Learn/HTML/Introduction_to_HTML": { - "modified": "2020-10-24T16:53:35.988Z", - "contributors": [ - "NekoChan-2851", - "JamesGoler", - "pccisme", - "jian5753", - "JunliXiao", - "yvonne6344", - "jackblackevo", - "akccakcctw", - "SecondSpirit" - ] - }, - "Learn/HTML/Introduction_to_HTML/Advanced_text_formatting": { - "modified": "2020-07-16T22:24:00.731Z", - "contributors": [ - "RichKe" - ] - }, - "Learn/HTML/Introduction_to_HTML/Creating_hyperlinks": { - "modified": "2020-07-16T22:23:49.670Z", - "contributors": [ - "JamesGoler" - ] - }, - "Learn/HTML/Introduction_to_HTML/Document_and_website_structure": { - "modified": "2020-09-26T12:33:20.817Z", - "contributors": [ - "CoderAmutu", - "did1335" - ] - }, - "Learn/HTML/Introduction_to_HTML/Getting_started": { - "modified": "2020-07-16T22:23:10.341Z", - "contributors": [ - "JamesGoler", - "Jkywang", - "egg734631", - "freddy50806", - "MLJ", - "jwhitlock" - ] - }, - "Learn/HTML/Introduction_to_HTML/HTML_text_fundamentals": { - "modified": "2020-07-16T22:23:41.134Z", - "contributors": [ - "ReneeZhou", - "iigmir", - "alkalineW" - ] - }, - "Learn/HTML/Introduction_to_HTML/The_head_metadata_in_HTML": { - "modified": "2020-07-16T22:23:27.064Z", - "contributors": [ - "kutshaitsi", - "JamesGoler", - "andreswang26", - "eric211924", - "MLJ" - ] - }, - "Learn/HTML/Multimedia_and_embedding": { - "modified": "2020-07-16T22:24:31.157Z", - "contributors": [ - "zackjtl", - "clamser0402", - "CATITANK" - ] - }, - "Learn/HTML/Multimedia_and_embedding/HTML中的圖片": { - "modified": "2020-07-20T05:13:25.235Z", - "contributors": [ - "zackjtl", - "LeonchanTW" - ] - }, - "Learn/HTML/Multimedia_and_embedding/Video_and_audio_content": { - "modified": "2020-09-27T07:40:33.292Z", - "contributors": [ - "mohammad92asghari" - ] - }, - "Learn/HTML/Multimedia_and_embedding/Video_and_audio_content/Test_your_skills:_Multimedia_and_embedding": { - "modified": "2020-09-27T08:06:04.019Z", - "contributors": [ - "CoderAmutu" - ] - }, - "Learn/HTML/Multimedia_and_embedding/其他_嵌入_技術": { - "modified": "2020-09-27T08:20:57.717Z", - "contributors": [ - "CoderAmutu" - ] - }, - "Learn/HTML/Tables": { - "modified": "2020-07-16T22:25:16.897Z", - "contributors": [ - "iigmir" - ] - }, - "Learn/HTML/Tables/基礎": { - "modified": "2020-11-25T04:21:37.312Z", - "contributors": [ - "123milkcat", - "allchangechallenge" - ] - }, - "Learn/How_to_contribute": { - "modified": "2020-07-16T22:33:48.192Z", - "contributors": [ - "SphinxKnight", - "willynpi", - "iigmir" - ] - }, - "Learn/JavaScript": { - "modified": "2020-07-30T05:29:53.810Z", - "contributors": [ - "klareh", - "nighet", - "ddtet", - "xerviam", - "MashKao", - "flyinglimao", - "fredliu16", - "chrisdavidmills" - ] - }, - "Learn/JavaScript/Building_blocks": { - "modified": "2020-07-16T22:31:11.353Z", - "contributors": [ - "AlbertTien", - "mdasinc", - "mubiesam", - "metismini", - "ArchieAtOrigins" - ] - }, - "Learn/JavaScript/Building_blocks/Build_your_own_function": { - "modified": "2020-07-16T22:31:32.052Z", - "contributors": [ - "jackblackevo", - "mubiesam" - ] - }, - "Learn/JavaScript/Building_blocks/Functions": { - "modified": "2020-07-16T22:31:27.864Z", - "contributors": [ - "jackblackevo", - "mubiesam" - ] - }, - "Learn/JavaScript/Building_blocks/Image_gallery": { - "modified": "2020-07-16T22:31:45.353Z", - "contributors": [ - "richblack" - ] - }, - "Learn/JavaScript/Building_blocks/Looping_code": { - "modified": "2020-11-25T23:18:26.484Z", - "contributors": [ - "aeolusg38", - "jackblackevo", - "mubiesam" - ] - }, - "Learn/JavaScript/Building_blocks/Return_values": { - "modified": "2020-07-16T22:31:35.396Z", - "contributors": [ - "jackblackevo", - "mubiesam" - ] - }, - "Learn/JavaScript/Building_blocks/conditionals": { - "modified": "2020-07-16T22:31:17.163Z", - "contributors": [ - "alexmav04", - "Sumendik", - "jackblackevo", - "mubiesam" - ] - }, - "Learn/JavaScript/Client-side_web_APIs": { - "modified": "2020-07-16T22:32:43.326Z", - "contributors": [ - "tangerine1202", - "nykevinwong", - "mubiesam" - ] - }, - "Learn/JavaScript/Client-side_web_APIs/Manipulating_documents": { - "modified": "2020-07-16T22:32:50.717Z", - "contributors": [ - "BbsonLin" - ] - }, - "Learn/JavaScript/First_steps": { - "modified": "2020-10-14T02:07:07.650Z", - "contributors": [ - "RocketSH", - "nighet", - "ddtet", - "BbsonLin", - "Rocker", - "lightyen", - "michaellee8", - "lele99123", - "jackblackevo", - "SoniaBeesee" - ] - }, - "Learn/JavaScript/First_steps/A_first_splash": { - "modified": "2020-10-13T14:09:02.521Z", - "contributors": [ - "RocketSH", - "hmysjiang", - "Hungyun", - "SphinxKnight", - "dorakao0408", - "mhuang211", - "lebniz", - "RishYang", - "egg734631", - "mubiesam", - "iron0336", - "jackblackevo", - "yuwei2s" - ] - }, - "Learn/JavaScript/First_steps/Arrays": { - "modified": "2020-10-29T03:57:18.783Z", - "contributors": [ - "Winston_Sung", - "lebniz", - "jackblackevo", - "iigmir", - "mubiesam" - ] - }, - "Learn/JavaScript/First_steps/Math": { - "modified": "2020-11-25T05:35:33.086Z", - "contributors": [ - "123milkcat", - "RocketSH", - "hanson931101", - "jackblackevo", - "mubiesam" - ] - }, - "Learn/JavaScript/First_steps/Silly_story_generator": { - "modified": "2020-10-12T07:22:32.955Z", - "contributors": [ - "RocketSH", - "jackblackevo", - "tonyyoung3", - "mubiesam" - ] - }, - "Learn/JavaScript/First_steps/Strings": { - "modified": "2020-11-23T07:01:24.301Z", - "contributors": [ - "123milkcat", - "Winston_Sung", - "RocketSH", - "alexmav04", - "lebniz", - "jackblackevo", - "mubiesam" - ] - }, - "Learn/JavaScript/First_steps/Useful_string_methods": { - "modified": "2020-10-14T02:47:53.938Z", - "contributors": [ - "RocketSH", - "alexmav04", - "tangerine1202", - "jackblackevo", - "JohnKeng", - "mubiesam" - ] - }, - "Learn/JavaScript/First_steps/Variables": { - "modified": "2020-10-14T02:32:59.320Z", - "contributors": [ - "RocketSH", - "docrob0t", - "SiderealArt", - "Playpaper", - "jackblackevo", - "cyanchu", - "mubiesam" - ] - }, - "Learn/JavaScript/First_steps/What_is_JavaScript": { - "modified": "2020-11-24T13:14:38.112Z", - "contributors": [ - "docrob0t", - "RocketSH", - "ddtet", - "hmysjiang", - "nighet", - "bl1zz4rd", - "jrvstw", - "RishYang", - "mhlemonh", - "laichenghuan", - "Rocker", - "MLJ" - ] - }, - "Learn/JavaScript/First_steps/What_went_wrong": { - "modified": "2020-10-16T09:05:43.185Z", - "contributors": [ - "RocketSH", - "hmysjiang", - "lebniz", - "tonyyoung3", - "benjaminchen" - ] - }, - "Learn/JavaScript/Howto": { - "modified": "2020-07-16T22:33:12.146Z", - "contributors": [ - "jackblackevo", - "DoJQuadArts" - ] - }, - "Learn/JavaScript/Objects": { - "modified": "2020-07-16T22:31:54.909Z", - "contributors": [ - "iigmir", - "MashKao" - ] - }, - "Learn/JavaScript/Objects/Adding_bouncing_balls_features": { - "modified": "2020-07-16T22:32:36.968Z", - "contributors": [ - "BobChao", - "MashKao" - ] - }, - "Learn/JavaScript/Objects/Basics": { - "modified": "2020-07-16T22:32:03.311Z", - "contributors": [ - "hunterflag", - "tangerine1202", - "sss63232", - "richblack", - "iigmir", - "MashKao" - ] - }, - "Learn/JavaScript/Objects/Inheritance": { - "modified": "2020-07-16T22:32:17.083Z", - "contributors": [ - "tangerine1202", - "Yang09701194", - "roycrxtw", - "MashKao" - ] - }, - "Learn/JavaScript/Objects/JSON": { - "modified": "2020-07-16T22:32:30.018Z", - "contributors": [ - "roycrxtw", - "MashKao" - ] - }, - "Learn/JavaScript/Objects/Object-oriented_JS": { - "modified": "2020-07-16T22:32:09.821Z", - "contributors": [ - "DahisC", - "tangerine1202", - "iigmir", - "cjchng", - "roycrxtw", - "MashKao" - ] - }, - "Learn/JavaScript/Objects/Object_building_practice": { - "modified": "2020-07-16T22:32:33.523Z", - "contributors": [ - "comicat", - "roycrxtw", - "MashKao" - ] - }, - "Learn/JavaScript/Objects/Object_prototypes": { - "modified": "2020-07-16T22:32:23.310Z", - "contributors": [ - "tangerine1202", - "roycrxtw", - "MashKao" - ] - }, - "Learn/Performance": { - "modified": "2020-07-16T22:40:40.169Z", - "contributors": [ - "estelle" - ] - }, - "Learn/Performance/多媒體": { - "modified": "2020-07-16T22:40:44.626Z", - "contributors": [ - "b84330808" - ] - }, - "Learn/Server-side": { - "modified": "2020-07-16T22:36:04.016Z", - "contributors": [ - "iigmir", - "rsidorov" - ] - }, - "Learn/Server-side/Django": { - "modified": "2020-07-16T22:36:37.414Z", - "contributors": [ - "iigmir", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Admin_site": { - "modified": "2020-07-16T22:37:06.543Z", - "contributors": [ - "condal36", - "Bong99", - "Yuehua-Liu", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Authentication": { - "modified": "2020-07-22T04:08:45.043Z", - "contributors": [ - "zcecil", - "condal36", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Deployment": { - "modified": "2020-07-16T22:37:43.781Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Forms": { - "modified": "2020-11-13T23:21:29.124Z", - "contributors": [ - "joshra", - "condal36", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Generic_views": { - "modified": "2020-11-13T03:46:00.269Z", - "contributors": [ - "joshra", - "hsiaocy", - "a27936343", - "AlonChen", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Home_page": { - "modified": "2020-07-16T22:37:12.554Z", - "contributors": [ - "condal36", - "zenuie", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Introduction": { - "modified": "2020-07-16T22:36:42.822Z", - "contributors": [ - "SphinxKnight", - "tan800630", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Models": { - "modified": "2020-10-03T02:04:47.327Z", - "contributors": [ - "hsiaocy", - "Yuehua-Liu", - "Ajameomeo", - "willynpi", - "LeonH", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Sessions": { - "modified": "2020-10-19T12:00:28.346Z", - "contributors": [ - "hsiaocy", - "condal36", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Testing": { - "modified": "2020-07-16T22:37:39.988Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Django/Tutorial_local_library_website": { - "modified": "2020-07-16T22:36:50.916Z", - "contributors": [ - "willynpi", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/development_environment": { - "modified": "2020-07-16T22:36:47.959Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Django/django_assessment_blog": { - "modified": "2020-07-16T22:37:50.139Z", - "contributors": [ - "willynpi", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/skeleton_website": { - "modified": "2020-07-16T22:36:55.864Z", - "contributors": [ - "Yuehua-Liu", - "Ericchen159", - "LeonH", - "edgar-chen" - ] - }, - "Learn/Server-side/Django/web_application_security": { - "modified": "2020-07-16T22:37:47.653Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs": { - "modified": "2020-07-16T22:37:56.965Z", - "contributors": [ - "iigmir", - "tonyyoung3", - "xxi511", - "lol-russo" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data": { - "modified": "2020-07-16T22:38:32.471Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/Author_detail_page": { - "modified": "2020-07-16T22:38:39.533Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/Author_list_page": { - "modified": "2020-07-16T22:38:38.387Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/BookInstance_detail_page_and_challenge": { - "modified": "2020-07-16T22:38:39.883Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/BookInstance_list_page": { - "modified": "2020-07-16T22:38:37.189Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/Book_detail_page": { - "modified": "2020-07-16T22:38:39.240Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/Book_list_page": { - "modified": "2020-07-16T22:38:36.489Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/Date_formatting_using_moment": { - "modified": "2020-07-16T22:38:37.729Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/Genre_detail_page": { - "modified": "2020-07-16T22:38:38.850Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/Home_page": { - "modified": "2020-07-16T22:38:35.865Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/LocalLibrary_base_template": { - "modified": "2020-07-16T22:38:35.227Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/Template_primer": { - "modified": "2020-07-16T22:38:34.841Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Displaying_data/flow_control_using_async": { - "modified": "2020-07-16T22:38:33.995Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/Introduction": { - "modified": "2020-09-27T06:14:07.664Z", - "contributors": [ - "edward_hu", - "edgar-chen", - "xxi511" - ] - }, - "Learn/Server-side/Express_Nodejs/Tutorial_local_library_website": { - "modified": "2020-07-16T22:38:17.846Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/deployment": { - "modified": "2020-07-16T22:38:51.489Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/development_environment": { - "modified": "2020-09-27T05:38:44.626Z", - "contributors": [ - "chengzee", - "edgar-chen", - "xxi511" - ] - }, - "Learn/Server-side/Express_Nodejs/forms": { - "modified": "2020-07-16T22:38:42.914Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/forms/Create_BookInstance_form": { - "modified": "2020-07-16T22:38:46.419Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/forms/Create_author_form": { - "modified": "2020-07-16T22:38:44.881Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/forms/Create_book_form": { - "modified": "2020-07-16T22:38:45.325Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/forms/Create_genre_form": { - "modified": "2020-07-16T22:38:44.086Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/forms/Delete_author_form": { - "modified": "2020-07-16T22:38:46.873Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/mongoose": { - "modified": "2020-09-28T05:01:32.342Z", - "contributors": [ - "chengzee", - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/routes": { - "modified": "2020-07-16T22:38:29.382Z", - "contributors": [ - "edgar-chen" - ] - }, - "Learn/Server-side/Express_Nodejs/skeleton_website": { - "modified": "2020-09-28T00:50:58.875Z", - "contributors": [ - "chengzee", - "edgar-chen" - ] - }, - "Learn/Server-side/First_steps": { - "modified": "2020-07-16T22:36:11.738Z", - "contributors": [ - "iigmir" - ] - }, - "Learn/Server-side/First_steps/介紹": { - "modified": "2020-10-29T10:39:42.677Z", - "contributors": [ - "JamesGoler", - "Kun-Neng", - "vivihenry", - "frank030310" - ] - }, - "Learn/Tools_and_testing": { - "modified": "2020-07-16T22:38:58.702Z", - "contributors": [ - "iigmir" - ] - }, - "Learn/Tools_and_testing/Client-side_JavaScript_frameworks": { - "modified": "2020-07-16T22:39:34.178Z", - "contributors": [ - "iigmir" - ] - }, - "Learn/Tools_and_testing/Client-side_JavaScript_frameworks/Introduction": { - "modified": "2020-11-18T23:19:28.135Z", - "contributors": [ - "MerlinCute", - "iigmir" - ] - }, - "Learn/Tools_and_testing/Client-side_JavaScript_frameworks/React_todo_list_beginning": { - "modified": "2020-11-10T07:16:31.083Z", - "contributors": [ - "RocketSH" - ] - }, - "Learn/Tools_and_testing/Cross_browser_testing": { - "modified": "2020-07-16T22:39:02.574Z", - "contributors": [ - "wbamberg", - "iigmir" - ] - }, - "Learn/Tools_and_testing/Cross_browser_testing/Automated_testing": { - "modified": "2020-07-16T22:39:19.937Z", - "contributors": [ - "wbamberg", - "iigmir", - "roycrxtw" - ] - }, - "MDN": { - "modified": "2019-09-10T15:45:39.460Z", - "contributors": [ - "SphinxKnight", - "wbamberg", - "jmlntw", - "Jeremie", - "SecondSpirit", - "irvinfly", - "Sheppy" - ] - }, - "MDN/About": { - "modified": "2019-09-10T08:57:06.612Z", - "contributors": [ - "SphinxKnight", - "wbamberg", - "jackblackevo", - "Rocker", - "jmlntw", - "jswisher", - "iigmir", - "teoli", - "young3578671", - "irvinfly", - "abs0986211642" - ] - }, - "MDN/Community": { - "modified": "2020-05-24T00:35:19.952Z", - "contributors": [ - "nighet", - "wbamberg", - "SecondSpirit", - "ALiangLiang", - "a0983891582", - "king_5266" - ] - }, - "MDN/Community/論壇": { - "modified": "2020-05-24T00:50:25.189Z", - "contributors": [ - "nighet" - ] - }, - "MDN/Contribute": { - "modified": "2019-01-16T19:25:51.462Z", - "contributors": [ - "wbamberg", - "iigmir", - "irvinfly", - "PHIDIAS", - "emmanuelodenyire" - ] - }, - "MDN/Contribute/Getting_started": { - "modified": "2020-09-30T17:17:21.724Z", - "contributors": [ - "chrisdavidmills", - "did1335", - "ayugioh2003", - "wbamberg", - "Rocker", - "iigmir", - "jmlntw", - "RichKe", - "SecondSpirit", - "ALiangLiang", - "Seinlin", - "BobChao", - "anna.hp.huang", - "zzzzpaul", - "wildsky" - ] - }, - "MDN/Contribute/Howto": { - "modified": "2019-01-16T20:46:52.062Z", - "contributors": [ - "wbamberg", - "ArvinH", - "klez" - ] - }, - "MDN/Contribute/Howto/Create_an_MDN_account": { - "modified": "2019-01-16T21:17:57.540Z", - "contributors": [ - "wbamberg", - "iigmir", - "f19857466" - ] - }, - "MDN/Contribute/Howto/Create_and_edit_pages": { - "modified": "2019-04-23T05:30:19.186Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "Shiyou", - "Supaplex", - "darksnidget", - "SecondSpirit", - "coby777" - ] - }, - "MDN/Contribute/Howto/Do_a_technical_review": { - "modified": "2019-03-23T22:32:06.855Z", - "contributors": [ - "wbamberg", - "iigmir", - "mgrn" - ] - }, - "MDN/Contribute/Howto/Do_an_editorial_review": { - "modified": "2019-08-12T14:08:44.950Z", - "contributors": [ - "ayugioh2003", - "wbamberg", - "jwhitlock", - "flyinglimao" - ] - }, - "MDN/Contribute/Howto/Set_the_summary_for_a_page": { - "modified": "2019-03-23T22:02:13.738Z", - "contributors": [ - "wbamberg", - "Astrid-GitHub", - "RSyehann" - ] - }, - "MDN/Contribute/Howto/Tag": { - "modified": "2019-03-23T22:54:12.092Z", - "contributors": [ - "wbamberg", - "yami" - ] - }, - "MDN/Contribute/Localize": { - "modified": "2019-01-16T19:52:54.512Z", - "contributors": [ - "wbamberg", - "ballfish", - "Sheppy" - ] - }, - "MDN/Contribute/Localize/Localization_projects": { - "modified": "2019-03-18T21:23:31.576Z", - "contributors": [ - "eyeccc" - ] - }, - "MDN/Contribute/Localize/Translating_pages": { - "modified": "2019-09-03T06:12:45.102Z", - "contributors": [ - "Lazine", - "wbamberg", - "iigmir", - "irvinfly", - "tai58585888@gmail.com", - "bryanyou" - ] - }, - "MDN/Editor": { - "modified": "2020-09-30T15:44:37.576Z", - "contributors": [ - "chrisdavidmills", - "wbamberg", - "EatPizza311", - "tpst1114", - "jswisher" - ] - }, - "MDN/Editor/Basics": { - "modified": "2020-09-30T15:44:37.917Z", - "contributors": [ - "chrisdavidmills", - "wbamberg", - "tpst1114" - ] - }, - "MDN/Editor/Edit_box": { - "modified": "2020-09-30T15:44:37.748Z", - "contributors": [ - "chrisdavidmills", - "wbamberg", - "jackblackevo", - "JoanneWu" - ] - }, - "MDN/Guidelines": { - "modified": "2020-09-30T15:33:00.096Z", - "contributors": [ - "chrisdavidmills", - "wbamberg", - "fscholz", - "irvinfly", - "Sheppy" - ] - }, - "MDN/Guidelines/Writing_style_guide": { - "modified": "2020-09-30T15:33:00.614Z", - "contributors": [ - "chrisdavidmills", - "jswisher", - "wbamberg", - "flyinglimao", - "iigmir", - "fscholz", - "BrianHuang", - "irvinfly", - "kiss007sky", - "wildsky" - ] - }, - "MDN/Kuma": { - "modified": "2019-09-06T03:30:44.825Z", - "contributors": [ - "SphinxKnight", - "wbamberg", - "iigmir", - "SecondSpirit", - "a8040282", - "Sheppy" - ] - }, - "MDN/Tools": { - "modified": "2020-09-30T16:55:39.074Z", - "contributors": [ - "chrisdavidmills", - "wbamberg", - "jackblackevo" - ] - }, - "MDN/Tools/KumaScript": { - "modified": "2020-09-30T16:55:39.461Z", - "contributors": [ - "chrisdavidmills", - "wbamberg", - "jackblackevo" - ] - }, - "MDN/Tools/KumaScript/Troubleshooting": { - "modified": "2020-09-30T16:55:39.606Z", - "contributors": [ - "chrisdavidmills", - "wbamberg", - "jackblackevo", - "iigmir", - "alk03073135" - ] - }, - "MDN_at_ten": { - "modified": "2019-03-23T22:49:37.556Z", - "contributors": [ - "alk03073135" - ] - }, - "Mozilla": { - "modified": "2019-03-23T23:33:56.932Z", - "contributors": [ - "iigmir", - "ethertank" - ] - }, - "Mozilla/Add-ons": { - "modified": "2019-03-18T21:08:19.815Z", - "contributors": [ - "iigmir", - "refrain4121", - "a780201", - "A520", - "irvinfly", - "softcup", - "teoli", - "petercpg", - "wildsky", - "Anomitro_Munshi" - ] - }, - "Mozilla/Add-ons/WebExtensions": { - "modified": "2019-03-18T21:07:16.806Z", - "contributors": [ - "jmlntw", - "flyinglimao", - "iigmir", - "ALiangLiang", - "wbamberg" - ] - }, - "Mozilla/Add-ons/WebExtensions/API": { - "modified": "2019-11-26T22:20:23.005Z", - "contributors": [ - "wbamberg", - "Makyen" - ] - }, - "Mozilla/Add-ons/WebExtensions/API/cookies": { - "modified": "2020-10-15T21:56:17.735Z", - "contributors": [ - "wbamberg", - "BobChao" - ] - }, - "Mozilla/Add-ons/WebExtensions/API/cookies/CookieStore": { - "modified": "2020-10-15T21:56:17.810Z", - "contributors": [ - "wbamberg", - "iigmir" - ] - }, - "Mozilla/Add-ons/WebExtensions/API/cookies/OnChangedCause": { - "modified": "2020-10-15T21:56:19.833Z", - "contributors": [ - "wbamberg", - "iigmir" - ] - }, - "Mozilla/Add-ons/WebExtensions/API/cookies/onChanged": { - "modified": "2020-10-15T21:56:17.446Z", - "contributors": [ - "wbamberg", - "iigmir" - ] - }, - "Mozilla/Add-ons/WebExtensions/API/storage": { - "modified": "2020-10-15T21:57:11.902Z", - "contributors": [ - "wbamberg", - "0711kps", - "Makyen" - ] - }, - "Mozilla/Add-ons/WebExtensions/API/storage/StorageArea": { - "modified": "2020-10-15T22:02:56.746Z", - "contributors": [ - "wbamberg", - "chrisdavidmills" - ] - }, - "Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/get": { - "modified": "2020-10-15T22:02:56.819Z", - "contributors": [ - "wbamberg", - "iigmir" - ] - }, - "Mozilla/Add-ons/WebExtensions/API/storage/local": { - "modified": "2020-10-15T21:57:10.754Z", - "contributors": [ - "wbamberg", - "iigmir" - ] - }, - "Mozilla/Add-ons/WebExtensions/Anatomy_of_a_WebExtension": { - "modified": "2020-04-20T22:14:29.842Z", - "contributors": [ - "eugene87222", - "JamesGoler", - "Dream_Rhythm", - "a39705397", - "start1119", - "Kahiro" - ] - }, - "Mozilla/Add-ons/WebExtensions/Content_scripts": { - "modified": "2019-03-18T21:02:28.504Z", - "contributors": [ - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/Internationalization": { - "modified": "2019-03-18T21:04:29.607Z", - "contributors": [ - "iigmir" - ] - }, - "Mozilla/Add-ons/WebExtensions/What_are_WebExtensions": { - "modified": "2019-03-18T21:06:44.158Z", - "contributors": [ - "honeymagico", - "iigmir" - ] - }, - "Mozilla/Add-ons/WebExtensions/Your_first_WebExtension": { - "modified": "2019-03-18T21:06:51.398Z", - "contributors": [ - "BobChao", - "iigmir", - "ALiangLiang" - ] - }, - "Mozilla/Add-ons/WebExtensions/Your_second_WebExtension": { - "modified": "2020-06-30T05:06:14.538Z", - "contributors": [ - "LeonH", - "eugene87222", - "RishYang", - "timmyshih", - "Tamako" - ] - }, - "Mozilla/Add-ons/WebExtensions/manifest.json": { - "modified": "2020-10-15T22:06:23.531Z", - "contributors": [ - "landylan", - "wbamberg", - "ExE-Boss" - ] - }, - "Mozilla/Add-ons/WebExtensions/manifest.json/author": { - "modified": "2020-10-15T22:06:20.756Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/manifest.json/background": { - "modified": "2020-10-15T22:06:22.887Z", - "contributors": [ - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings": { - "modified": "2020-10-15T22:06:22.269Z", - "contributors": [ - "wbamberg", - "ExE-Boss", - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/manifest.json/homepage_url": { - "modified": "2020-10-15T22:06:22.588Z", - "contributors": [ - "wbamberg", - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/manifest.json/options_ui": { - "modified": "2020-10-15T22:06:23.412Z", - "contributors": [ - "wbamberg", - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/user_interface": { - "modified": "2019-04-23T05:01:36.148Z", - "contributors": [ - "jackblackevo", - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/user_interface/Browser_action": { - "modified": "2019-04-23T05:01:57.057Z", - "contributors": [ - "jackblackevo", - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/user_interface/Context_menu_items": { - "modified": "2019-04-23T05:04:17.208Z", - "contributors": [ - "jackblackevo", - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/user_interface/Sidebars": { - "modified": "2019-04-23T05:02:36.826Z", - "contributors": [ - "jackblackevo", - "0711kps" - ] - }, - "Mozilla/Add-ons/WebExtensions/user_interface/devtools_panels": { - "modified": "2019-04-23T05:05:05.338Z", - "contributors": [ - "jackblackevo", - "0711kps" - ] - }, - "Mozilla/Developer_guide": { - "modified": "2019-03-23T23:37:29.771Z", - "contributors": [ - "jackblackevo", - "pytseng", - "tessarakt3" - ] - }, - "Mozilla/Developer_guide/Source_Code": { - "modified": "2019-03-23T23:37:28.223Z", - "contributors": [ - "jackblackevo", - "iigmir", - "yehchge" - ] - }, - "Mozilla/Developer_guide/Source_Code/CVS": { - "modified": "2019-04-21T11:31:24.705Z", - "contributors": [ - "wangshi3" - ] - }, - "Mozilla/Firefox": { - "modified": "2020-01-18T14:58:24.025Z", - "contributors": [ - "leela52452", - "SphinxKnight", - "wbamberg", - "wildsky", - "RJ_Hsiao", - "Flymok", - "Prashanth" - ] - }, - "Mozilla/Firefox/Releases": { - "modified": "2019-01-16T17:46:20.383Z", - "contributors": [ - "wbamberg", - "RJ_Hsiao", - "ziyunfei" - ] - }, - "Mozilla/Firefox/Releases/1.5": { - "modified": "2019-03-23T23:06:56.466Z", - "contributors": [ - "wbamberg", - "RJ_Hsiao" - ] - }, - "Mozilla/Firefox/Releases/10": { - "modified": "2019-03-18T21:09:01.391Z", - "contributors": [ - "fscholz", - "wbamberg", - "RJ_Hsiao" - ] - }, - "Mozilla/Firefox/Releases/11": { - "modified": "2019-03-23T23:07:01.282Z", - "contributors": [ - "wbamberg", - "RJ_Hsiao" - ] - }, - "Mozilla/Firefox/Releases/2": { - "modified": "2019-04-23T05:37:52.313Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "Josesun", - "BobChao" - ] - }, - "Mozilla/Firefox/Releases/2/Adding_feed_readers_to_Firefox": { - "modified": "2019-04-23T05:38:36.737Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "BobChao" - ] - }, - "Mozilla/Firefox/Releases/2/Security_changes": { - "modified": "2019-04-23T05:38:12.921Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "SphinxKnight", - "Sheppy", - "Tobbytw", - "BobChao" - ] - }, - "Mozilla/Firefox/Releases/3": { - "modified": "2019-04-23T05:36:15.221Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "RJ_Hsiao", - "teoli", - "Mgjbot", - "BobChao", - "Coolcd" - ] - }, - "Mozilla/Firefox/Releases/3.6": { - "modified": "2019-12-13T20:33:24.338Z", - "contributors": [ - "wbamberg", - "SphinxKnight", - "RJ_Hsiao" - ] - }, - "Mozilla/Firefox/Releases/3/DOM_improvements": { - "modified": "2019-04-23T05:36:36.182Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "teoli", - "Coolcd" - ] - }, - "Mozilla/Firefox/Releases/35": { - "modified": "2019-12-13T20:33:34.355Z", - "contributors": [ - "wbamberg", - "RJ_Hsiao" - ] - }, - "Mozilla/Firefox/Releases/4": { - "modified": "2019-04-23T03:28:51.373Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "SphinxKnight", - "Kennyluck", - "BobChao" - ] - }, - "Mozilla/Firefox/Releases/4/Firefox_4_開發者新功能概覽": { - "modified": "2019-04-23T03:28:52.095Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "SphinxKnight", - "irvinfly", - "teoli", - "BobChao" - ] - }, - "Mozilla/Firefox/Releases/5": { - "modified": "2019-03-23T23:06:59.171Z", - "contributors": [ - "fscholz", - "wbamberg", - "iigmir", - "RJ_Hsiao" - ] - }, - "Mozilla/Firefox/Releases/6": { - "modified": "2019-11-21T00:43:15.848Z", - "contributors": [ - "wbamberg", - "RJ_Hsiao" - ] - }, - "Mozilla/Firefox/Releases/61": { - "modified": "2019-01-17T03:05:55.327Z", - "contributors": [ - "wbamberg", - "BobChao" - ] - }, - "Mozilla/Firefox/Releases/68": { - "modified": "2020-05-02T05:45:42.258Z", - "contributors": [ - "abc52090241" - ] - }, - "Mozilla/Firefox/Releases/7": { - "modified": "2019-04-23T05:35:00.727Z", - "contributors": [ - "jackblackevo", - "wbamberg", - "RJ_Hsiao", - "ethertank", - "Sheppy" - ] - }, - "Mozilla/Firefox/Releases/8": { - "modified": "2019-11-21T00:43:09.976Z", - "contributors": [ - "wbamberg", - "Sebastianz", - "RJ_Hsiao" - ] - }, - "Mozilla/Firefox/Releases/9": { - "modified": "2019-12-13T20:33:11.984Z", - "contributors": [ - "wbamberg", - "fscholz", - "RJ_Hsiao" - ] - }, - "Python": { - "modified": "2019-03-23T23:33:19.493Z", - "contributors": [ - "garylai1990" - ] - }, - "SVG/Tutorial/Basic_Shapes": { - "modified": "2019-04-23T03:35:52.184Z", - "contributors": [ - "jackblackevo", - "ethertank", - "Dx.Yang" - ] - }, - "Tools": { - "modified": "2020-07-16T22:44:20.103Z", - "contributors": [ - "SphinxKnight", - "wbamberg", - "iigmir", - "irvinfly", - "Weicheng", - "a0983891582", - "kingt_tsai", - "RJ_Hsiao", - "iinnttoo", - "yangshiqiangzy", - "Somnlent", - "benson.peng", - "dinoop.p1" - ] - }, - "Tools/3D_View": { - "modified": "2020-07-16T22:34:25.840Z", - "contributors": [ - "Sean64", - "Seafox" - ] - }, - "Tools/Browser_Toolbox": { - "modified": "2020-07-16T22:35:56.020Z", - "contributors": [ - "grapherd", - "a0983891582", - "jan730921" - ] - }, - "Tools/Debugger": { - "modified": "2020-07-16T22:35:06.897Z", - "contributors": [ - "iigmir", - "wbamberg", - "stephaniehobson", - "yurenju", - "MashKao" - ] - }, - "Tools/Debugger/How_to": { - "modified": "2020-07-16T22:35:08.733Z", - "contributors": [ - "wbamberg" - ] - }, - "Tools/Debugger/How_to/Open_the_debugger": { - "modified": "2020-07-16T22:35:09.582Z", - "contributors": [ - "marcus7777777" - ] - }, - "Tools/Debugger/How_to/Set_a_breakpoint": { - "modified": "2020-07-16T22:35:10.325Z", - "contributors": [ - "Kevinwuu" - ] - }, - "Tools/Firefox_OS_1.1_Simulator": { - "modified": "2020-07-16T22:35:58.639Z", - "contributors": [ - "MashKao" - ] - }, - "Tools/Network_Monitor": { - "modified": "2020-07-16T22:35:32.529Z", - "contributors": [ - "Fashaun" - ] - }, - "Tools/Page_Inspector": { - "modified": "2020-07-16T22:34:30.099Z", - "contributors": [ - "Fashaun", - "iigmir", - "jsx", - "zmh_w", - "RJ_Hsiao" - ] - }, - "Tools/Page_Inspector/How_to": { - "modified": "2020-07-16T22:34:32.460Z", - "contributors": [ - "iigmir", - "sidgan" - ] - }, - "Tools/Page_Inspector/How_to/Examine_grid_layouts": { - "modified": "2020-07-16T22:34:47.546Z", - "contributors": [ - "iigmir" - ] - }, - "Tools/Performance": { - "modified": "2020-07-16T22:36:14.144Z", - "contributors": [ - "irvinfly" - ] - }, - "Tools/Performance/Allocations": { - "modified": "2020-07-16T22:36:22.457Z", - "contributors": [ - "johnny801018" - ] - }, - "Tools/Performance/Frame_rate": { - "modified": "2020-07-16T22:36:19.429Z", - "contributors": [ - "black80887" - ] - }, - "Tools/Remote_Debugging": { - "modified": "2020-07-16T22:35:38.579Z", - "contributors": [ - "Keung162", - "yhn5525" - ] - }, - "Tools/Remote_Debugging/Firefox_for_Android": { - "modified": "2020-07-16T22:35:39.658Z", - "contributors": [ - "king620707" - ] - }, - "Tools/Responsive_Design_Mode": { - "modified": "2020-07-16T22:35:22.603Z", - "contributors": [ - "iigmir" - ] - }, - "Tools/Settings": { - "modified": "2020-07-16T22:36:35.954Z", - "contributors": [ - "abc52090241" - ] - }, - "Tools/Style_Editor": { - "modified": "2020-07-16T22:35:02.268Z", - "contributors": [ - "Kashashi", - "bassam", - "RJ_Hsiao" - ] - }, - "Tools/Web_Audio_Editor": { - "modified": "2020-07-16T22:36:09.045Z", - "contributors": [ - "Seafox" - ] - }, - "Tools/Web_Console": { - "modified": "2020-07-16T22:34:10.824Z", - "contributors": [ - "iigmir", - "maybe", - "bassam", - "king_5266" - ] - }, - "Tools/Web_Console/Console_messages": { - "modified": "2020-07-16T22:34:16.848Z", - "contributors": [ - "iigmir" - ] - }, - "Tools/Web_Console/Keyboard_shortcuts": { - "modified": "2020-07-16T22:34:24.444Z", - "contributors": [ - "iigmir" - ] - }, - "Tools/Web_Console/Opening_the_Web_Console": { - "modified": "2020-07-16T22:34:17.831Z", - "contributors": [ - "iigmir" - ] - }, - "Tools/Web_Console/Rich_output": { - "modified": "2020-07-16T22:34:20.675Z", - "contributors": [ - "iigmir" - ] - }, - "Tools/Web_Console/Split_console": { - "modified": "2020-07-16T22:34:21.659Z", - "contributors": [ - "iigmir" - ] - }, - "Tools/Web_Console/The_command_line_interpreter": { - "modified": "2020-07-16T22:34:19.994Z", - "contributors": [ - "iigmir" - ] - }, - "Web": { - "modified": "2020-04-05T02:12:59.455Z", - "contributors": [ - "nighet", - "santoschenwbu", - "ppdada", - "Honesty1997", - "xerviam", - "willynpi", - "sos418", - "Luke.Liu", - "tigercosmos", - "iigmir", - "irvinfly", - "togorepqddj", - "sailplaneTW", - "Sheppy" - ] - }, - "Web/API": { - "modified": "2019-03-23T23:28:12.241Z", - "contributors": [ - "xerviam", - "Demi_Yu", - "jackblackevo", - "iigmir", - "teoli", - "zhangmingyu", - "Shiyou", - "saka6333", - "ethertank" - ] - }, - "Web/API/AbortController": { - "modified": "2020-10-15T22:21:29.412Z", - "contributors": [ - "Zhusee", - "lixingnan200" - ] - }, - "Web/API/Ambient_Light_Events": { - "modified": "2019-03-23T23:27:04.119Z", - "contributors": [ - "jackblackevo", - "teoli", - "MashKao" - ] - }, - "Web/API/AnalyserNode": { - "modified": "2019-03-23T22:40:29.435Z", - "contributors": [ - "Sebastianz" - ] - }, - "Web/API/AnalyserNode/getByteFrequencyData": { - "modified": "2019-03-23T22:40:34.425Z", - "contributors": [ - "ALiangLiang", - "wildsky" - ] - }, - "Web/API/AnimationEvent": { - "modified": "2019-03-23T22:58:51.711Z", - "contributors": [ - "iigmir", - "saka6333", - "fscholz" - ] - }, - "Web/API/AnimationEvent/initAnimationEvent": { - "modified": "2019-03-23T22:58:50.823Z", - "contributors": [ - "teoli", - "cs047899" - ] - }, - "Web/API/Battery_Status_API": { - "modified": "2019-03-23T23:27:02.640Z", - "contributors": [ - "jackblackevo", - "MashKao" - ] - }, - "Web/API/Blob": { - "modified": "2020-10-15T21:38:13.856Z", - "contributors": [ - "jackblackevo", - "flyinglimao", - "changbenny", - "alk03073135" - ] - }, - "Web/API/Blob/Blob": { - "modified": "2019-03-23T22:31:20.533Z", - "contributors": [ - "flyinglimao", - "jackblackevo" - ] - }, - "Web/API/Blob/size": { - "modified": "2019-03-23T22:05:46.891Z", - "contributors": [ - "flyinglimao" - ] - }, - "Web/API/Blob/type": { - "modified": "2019-03-23T22:05:38.897Z", - "contributors": [ - "flyinglimao" - ] - }, - "Web/API/Body": { - "modified": "2020-10-15T22:10:19.507Z", - "contributors": [ - "RickBrown" - ] - }, - "Web/API/Body/json": { - "modified": "2020-10-15T22:10:18.425Z", - "contributors": [ - "xstar", - "eyeccc" - ] - }, - "Web/API/CSSStyleDeclaration": { - "modified": "2019-03-23T22:30:39.103Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/CSSStyleSheet": { - "modified": "2019-03-23T22:04:52.980Z", - "contributors": [ - "jpmedley" - ] - }, - "Web/API/CSSStyleSheet/insertRule": { - "modified": "2019-03-23T22:04:53.326Z", - "contributors": [ - "oooooo" - ] - }, - "Web/API/CSS_Object_Model": { - "modified": "2019-03-23T22:48:37.625Z", - "contributors": [ - "jackblackevo", - "fscholz" - ] - }, - "Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements": { - "modified": "2019-03-18T20:58:55.989Z", - "contributors": [ - "SphinxKnight", - "iigmir", - "alk03073135" - ] - }, - "Web/API/CSS_Object_Model/Managing_screen_orientation": { - "modified": "2019-03-23T23:25:59.570Z", - "contributors": [ - "jackblackevo", - "MashKao" - ] - }, - "Web/API/CSS_Object_Model/Using_dynamic_styling_information": { - "modified": "2019-03-23T22:20:10.346Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/CanvasRenderingContext2D": { - "modified": "2019-03-23T22:19:40.312Z", - "contributors": [ - "jsgao0", - "jackblackevo" - ] - }, - "Web/API/CanvasRenderingContext2D/clearRect": { - "modified": "2019-03-23T22:19:19.507Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Canvas_API": { - "modified": "2019-03-24T00:16:12.599Z", - "contributors": [ - "pig3629", - "jackblackevo", - "fscholz", - "teoli", - "elin", - "ethertank", - "dextra", - "Kennyluck", - "happysadman" - ] - }, - "Web/API/Canvas_API/Drawing_graphics_with_canvas": { - "modified": "2019-03-23T23:13:40.314Z", - "contributors": [ - "fscholz", - "sailplaneTW" - ] - }, - "Web/API/Canvas_API/Tutorial": { - "modified": "2019-03-18T20:36:19.502Z", - "contributors": [ - "sheng-tai", - "jackblackevo", - "fscholz", - "elin", - "foxbrush" - ] - }, - "Web/API/Canvas_API/Tutorial/Advanced_animations": { - "modified": "2019-03-23T22:03:12.070Z", - "contributors": [ - "pig3629" - ] - }, - "Web/API/Canvas_API/Tutorial/Applying_styles_and_colors": { - "modified": "2019-10-10T16:48:11.045Z", - "contributors": [ - "jackblackevo", - "fscholz", - "Sebastianz", - "foxbrush" - ] - }, - "Web/API/Canvas_API/Tutorial/Basic_animations": { - "modified": "2019-03-23T23:26:07.752Z", - "contributors": [ - "jackblackevo", - "Lambert", - "fscholz", - "foxbrush" - ] - }, - "Web/API/Canvas_API/Tutorial/Basic_usage": { - "modified": "2019-06-14T06:57:52.611Z", - "contributors": [ - "jackblackevo", - "fscholz", - "foxbrush" - ] - }, - "Web/API/Canvas_API/Tutorial/Compositing": { - "modified": "2019-03-23T23:14:05.379Z", - "contributors": [ - "jackblackevo", - "fscholz", - "elin", - "foxbrush" - ] - }, - "Web/API/Canvas_API/Tutorial/Drawing_shapes": { - "modified": "2019-03-23T23:27:29.654Z", - "contributors": [ - "Snailpool", - "jackblackevo", - "fscholz", - "foxbrush", - "elin" - ] - }, - "Web/API/Canvas_API/Tutorial/Drawing_text": { - "modified": "2019-03-23T23:38:19.546Z", - "contributors": [ - "jackblackevo", - "sssdx" - ] - }, - "Web/API/Canvas_API/Tutorial/Optimizing_canvas": { - "modified": "2019-03-23T23:26:06.214Z", - "contributors": [ - "jackblackevo", - "fscholz", - "foxbrush" - ] - }, - "Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas": { - "modified": "2019-09-28T03:43:09.354Z", - "contributors": [ - "pig3629" - ] - }, - "Web/API/Canvas_API/Tutorial/Transformations": { - "modified": "2019-10-10T16:48:13.377Z", - "contributors": [ - "Chi-Hsin", - "jackblackevo", - "fscholz", - "foxbrush" - ] - }, - "Web/API/Canvas_API/Tutorial/Using_images": { - "modified": "2019-03-23T23:12:00.146Z", - "contributors": [ - "aver803bath5", - "jackblackevo", - "fscholz", - "foxbrush" - ] - }, - "Web/API/Channel_Messaging_API": { - "modified": "2019-03-23T22:49:07.205Z", - "contributors": [ - "foxbrush" - ] - }, - "Web/API/CharacterData": { - "modified": "2019-03-23T22:30:36.282Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/ChildNode": { - "modified": "2019-03-23T22:30:29.724Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Clients": { - "modified": "2019-03-23T22:41:01.027Z", - "contributors": [ - "xiantank" - ] - }, - "Web/API/ClipboardEvent": { - "modified": "2019-03-23T22:31:08.942Z", - "contributors": [ - "fscholz", - "jackblackevo" - ] - }, - "Web/API/Console": { - "modified": "2020-10-15T22:03:31.329Z", - "contributors": [ - "Syihoy", - "porfirion" - ] - }, - "Web/API/CustomEvent": { - "modified": "2020-10-15T21:38:37.754Z", - "contributors": [ - "fscholz", - "jackblackevo", - "Shiyou" - ] - }, - "Web/API/CustomEvent/CustomEvent": { - "modified": "2020-10-15T21:38:44.505Z", - "contributors": [ - "fscholz", - "Shiyou" - ] - }, - "Web/API/DOMParser": { - "modified": "2019-03-23T22:32:53.615Z", - "contributors": [ - "kenttsai" - ] - }, - "Web/API/DOMString": { - "modified": "2019-03-23T22:48:01.923Z", - "contributors": [ - "Shiyou" - ] - }, - "Web/API/DOMTokenList": { - "modified": "2019-03-23T22:30:39.565Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/DataTransfer": { - "modified": "2019-03-23T22:31:19.371Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Detecting_device_orientation": { - "modified": "2019-03-23T23:27:03.486Z", - "contributors": [ - "jackblackevo", - "MashKao" - ] - }, - "Web/API/DeviceMotionEvent": { - "modified": "2019-03-23T22:19:09.256Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/DeviceOrientationEvent": { - "modified": "2019-03-23T22:19:19.032Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Document": { - "modified": "2019-12-24T11:58:47.714Z", - "contributors": [ - "ianchen0119", - "jackblackevo", - "Sheppy" - ] - }, - "Web/API/Document/body": { - "modified": "2019-03-23T22:12:47.911Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Document/createDocumentFragment": { - "modified": "2019-03-23T22:05:41.694Z", - "contributors": [ - "tigercosmos" - ] - }, - "Web/API/Document/createElement": { - "modified": "2019-06-17T10:27:41.514Z", - "contributors": [ - "lebniz", - "jackblackevo" - ] - }, - "Web/API/Document/createRange": { - "modified": "2019-03-23T22:26:49.785Z", - "contributors": [ - "jackblackevo", - "bblurock" - ] - }, - "Web/API/Document/createTextNode": { - "modified": "2019-03-23T22:30:00.695Z", - "contributors": [ - "jackblackevo", - "rikrik527" - ] - }, - "Web/API/Document/defaultView": { - "modified": "2019-03-23T22:30:50.854Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Document/designMode": { - "modified": "2019-03-23T22:04:59.325Z", - "contributors": [ - "jmlntw" - ] - }, - "Web/API/Document/documentElement": { - "modified": "2019-03-23T22:12:40.763Z", - "contributors": [ - "Snailpool", - "jackblackevo" - ] - }, - "Web/API/Document/execCommand": { - "modified": "2020-10-15T21:57:17.621Z", - "contributors": [ - "t7yang", - "grain0217", - "Mrscrystal", - "tpst1114" - ] - }, - "Web/API/Document/forms": { - "modified": "2019-03-23T22:31:24.583Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Document/getElementsByClassName": { - "modified": "2019-03-23T22:49:19.402Z", - "contributors": [ - "jackblackevo", - "iigmir", - "Shiyou", - "alk03073135" - ] - }, - "Web/API/Document/head": { - "modified": "2019-03-23T22:48:02.502Z", - "contributors": [ - "jackblackevo", - "Shiyou" - ] - }, - "Web/API/Document/keyup_event": { - "modified": "2019-04-18T03:52:12.531Z", - "contributors": [ - "irenesmith", - "fscholz", - "JoanneWu" - ] - }, - "Web/API/Document/querySelector": { - "modified": "2019-03-23T23:28:13.625Z", - "contributors": [ - "jackblackevo", - "jsx", - "AshfaqHossain", - "carl_tw" - ] - }, - "Web/API/Document/readyState": { - "modified": "2019-06-11T20:31:50.296Z", - "contributors": [ - "StanleyDing", - "jackblackevo", - "Shiyou", - "alk03073135" - ] - }, - "Web/API/Document/registerElement": { - "modified": "2019-03-18T21:37:29.505Z", - "contributors": [ - "Chang-jui-hsuan" - ] - }, - "Web/API/Document/scroll_event": { - "modified": "2019-04-08T09:05:58.589Z", - "contributors": [ - "irenesmith", - "fscholz", - "dwatow" - ] - }, - "Web/API/Document/width": { - "modified": "2019-03-23T22:21:01.741Z", - "contributors": [ - "jackblackevo", - "ginszme" - ] - }, - "Web/API/DocumentFragment": { - "modified": "2019-03-23T22:30:16.185Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/DocumentType": { - "modified": "2019-03-23T22:31:03.437Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Document_Object_Model": { - "modified": "2019-03-24T00:03:11.264Z", - "contributors": [ - "jackblackevo", - "fscholz", - "irvinfly", - "shyangs" - ] - }, - "Web/API/Document_Object_Model/Examples": { - "modified": "2019-04-22T07:31:11.966Z", - "contributors": [ - "jackblackevo", - "PJCHENder" - ] - }, - "Web/API/Document_Object_Model/How_to_create_a_DOM_tree": { - "modified": "2019-03-23T22:13:19.887Z", - "contributors": [ - "seantw" - ] - }, - "Web/API/Document_Object_Model/Whitespace": { - "modified": "2020-01-30T13:21:14.453Z", - "contributors": [ - "chrisdavidmills", - "jackblackevo", - "ethertank", - "Mgjbot", - "BobChao" - ] - }, - "Web/API/Document_Object_Model/事件": { - "modified": "2019-03-23T22:27:33.501Z", - "contributors": [ - "H-W-Chang" - ] - }, - "Web/API/DragEvent": { - "modified": "2020-02-27T01:36:51.610Z", - "contributors": [ - "moojitsai", - "hunterflag", - "jackblackevo" - ] - }, - "Web/API/DragEvent/dataTransfer": { - "modified": "2019-03-23T22:31:17.568Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Element": { - "modified": "2019-03-18T21:08:56.279Z", - "contributors": [ - "fscholz", - "jackblackevo", - "arhoads" - ] - }, - "Web/API/Element/attributes": { - "modified": "2020-10-15T22:14:29.910Z", - "contributors": [ - "WangHsuan" - ] - }, - "Web/API/Element/classList": { - "modified": "2019-03-23T22:30:27.664Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Element/click_event": { - "modified": "2019-03-18T20:47:28.188Z", - "contributors": [ - "irenesmith", - "fscholz", - "Shiyou" - ] - }, - "Web/API/Element/clientHeight": { - "modified": "2019-03-18T20:58:47.478Z", - "contributors": [ - "SphinxKnight", - "iigmir", - "alk03073135" - ] - }, - "Web/API/Element/getAttribute": { - "modified": "2019-03-23T22:25:57.546Z", - "contributors": [ - "pdexx" - ] - }, - "Web/API/Element/innerHTML": { - "modified": "2020-10-15T22:21:46.093Z", - "contributors": [ - "itsems", - "dayknchung" - ] - }, - "Web/API/Element/insertAdjacentHTML": { - "modified": "2019-03-18T21:29:09.618Z", - "contributors": [ - "akccakcctw", - "NoobTW" - ] - }, - "Web/API/Element/querySelectorAll": { - "modified": "2020-10-15T21:51:24.241Z", - "contributors": [ - "wbamberg", - "Shiyou", - "alk03073135" - ] - }, - "Web/API/Element/scrollHeight": { - "modified": "2019-03-18T20:59:06.982Z", - "contributors": [ - "SphinxKnight", - "iigmir", - "alk03073135" - ] - }, - "Web/API/Element/scrollTop": { - "modified": "2019-03-23T22:48:35.906Z", - "contributors": [ - "iigmir", - "alk03073135" - ] - }, - "Web/API/Element/touchcancel_event": { - "modified": "2019-04-30T14:15:58.983Z", - "contributors": [ - "wbamberg", - "irenesmith", - "fscholz", - "jackblackevo", - "james_yang" - ] - }, - "Web/API/ErrorEvent": { - "modified": "2019-03-23T22:48:04.106Z", - "contributors": [ - "Shiyou" - ] - }, - "Web/API/Event": { - "modified": "2020-10-15T21:38:26.088Z", - "contributors": [ - "jackblackevo", - "Shiyou", - "Sheppy" - ] - }, - "Web/API/Event/Comparison_of_Event_Targets": { - "modified": "2019-03-23T22:31:03.921Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Event/Event": { - "modified": "2020-10-15T21:38:36.713Z", - "contributors": [ - "fscholz", - "jackblackevo", - "Shiyou" - ] - }, - "Web/API/Event/bubbles": { - "modified": "2019-03-23T22:31:08.554Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Event/createEvent": { - "modified": "2019-03-23T22:46:58.596Z", - "contributors": [ - "Shiyou" - ] - }, - "Web/API/Event/currentTarget": { - "modified": "2020-10-15T21:47:11.367Z", - "contributors": [ - "iigmir", - "jackblackevo" - ] - }, - "Web/API/Event/defaultPrevented": { - "modified": "2019-03-23T22:31:01.738Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Event/eventPhase": { - "modified": "2019-03-23T22:31:04.871Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Event/isTrusted": { - "modified": "2019-03-23T22:31:07.261Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Event/preventDefault": { - "modified": "2019-03-23T22:31:19.138Z", - "contributors": [ - "SphinxKnight", - "peter611122", - "jackblackevo" - ] - }, - "Web/API/Event/stopImmediatePropagation": { - "modified": "2019-03-23T22:48:43.662Z", - "contributors": [ - "jackblackevo", - "alk03073135" - ] - }, - "Web/API/Event/stopPropagation": { - "modified": "2020-10-15T21:47:06.947Z", - "contributors": [ - "jackblackevo", - "iigmir" - ] - }, - "Web/API/Event/target": { - "modified": "2019-03-23T22:30:57.189Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Event/timeStamp": { - "modified": "2019-03-23T22:47:41.207Z", - "contributors": [ - "Shiyou" - ] - }, - "Web/API/Event/type": { - "modified": "2019-03-23T22:31:05.836Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/EventListener": { - "modified": "2020-10-15T21:47:11.807Z", - "contributors": [ - "t7yang", - "tigercosmos", - "jackblackevo" - ] - }, - "Web/API/EventTarget": { - "modified": "2019-03-23T22:55:39.329Z", - "contributors": [ - "jackblackevo", - "Shiyou", - "alk03073135", - "teoli" - ] - }, - "Web/API/EventTarget/dispatchEvent": { - "modified": "2019-03-23T22:48:01.449Z", - "contributors": [ - "jackblackevo", - "Shiyou" - ] - }, - "Web/API/EventTarget/removeEventListener": { - "modified": "2019-03-23T22:31:15.037Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Fetch_API": { - "modified": "2020-10-15T21:51:00.689Z", - "contributors": [ - "Zhusee", - "iigmir", - "guAnsunyata", - "jackblackevo" - ] - }, - "Web/API/Fetch_API/Using_Fetch": { - "modified": "2020-10-15T22:05:15.481Z", - "contributors": [ - "MollyHuang", - "JamesGoler", - "LeonClancy", - "cakeant", - "hms5232", - "Tamako", - "MOSapeizer" - ] - }, - "Web/API/File": { - "modified": "2020-10-15T21:47:08.052Z", - "contributors": [ - "pan93412", - "jackblackevo" - ] - }, - "Web/API/File/File": { - "modified": "2019-03-23T22:06:05.257Z", - "contributors": [ - "Freeeeze", - "lynn456" - ] - }, - "Web/API/File/Using_files_from_web_applications": { - "modified": "2019-03-24T00:11:30.210Z", - "contributors": [ - "chrisdavidmills", - "PtCt", - "y7t2ffff", - "Shiyou", - "alk03073135", - "irvinfly", - "Vdragon", - "orinx" - ] - }, - "Web/API/File/fileName": { - "modified": "2019-03-23T22:06:22.686Z", - "contributors": [ - "lynn456" - ] - }, - "Web/API/FileList": { - "modified": "2019-03-23T22:31:11.090Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/FileReader": { - "modified": "2019-03-23T22:31:25.177Z", - "contributors": [ - "jackblackevo", - "iigmir" - ] - }, - "Web/API/FileReader/error": { - "modified": "2019-03-23T22:06:18.177Z", - "contributors": [ - "lynn456" - ] - }, - "Web/API/FileReader/readyState": { - "modified": "2019-03-23T22:06:21.825Z", - "contributors": [ - "lynn456" - ] - }, - "Web/API/FileSystem": { - "modified": "2019-03-23T22:12:37.390Z", - "contributors": [ - "abc225666" - ] - }, - "Web/API/File_Handle_API": { - "modified": "2019-03-23T23:28:50.291Z", - "contributors": [ - "jackblackevo", - "MashKao" - ] - }, - "Web/API/FormData": { - "modified": "2019-03-23T23:35:14.599Z", - "contributors": [ - "lowtan", - "jackblackevo", - "teoli", - "Shiyou", - "ziyunfei" - ] - }, - "Web/API/FormData/Using_FormData_Objects": { - "modified": "2019-03-23T22:18:54.087Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/FormData/get": { - "modified": "2019-03-23T22:25:04.671Z", - "contributors": [ - "Snailpool" - ] - }, - "Web/API/Fullscreen_API": { - "modified": "2019-03-23T22:49:47.826Z", - "contributors": [ - "wbamberg", - "jackblackevo", - "lee011", - "alk03073135" - ] - }, - "Web/API/GainNode": { - "modified": "2019-03-23T22:20:28.411Z", - "contributors": [ - "stdio2017" - ] - }, - "Web/API/GainNode/gain": { - "modified": "2019-03-23T22:20:30.391Z", - "contributors": [ - "stdio2017" - ] - }, - "Web/API/Geolocation": { - "modified": "2019-03-23T22:36:12.802Z", - "contributors": [ - "yachiehwu", - "fscholz" - ] - }, - "Web/API/Geolocation/Using_geolocation": { - "modified": "2019-12-15T11:33:42.173Z", - "contributors": [ - "ayugioh2003", - "jackblackevo", - "MashKao" - ] - }, - "Web/API/Geolocation/clearWatch": { - "modified": "2019-03-23T22:36:15.036Z", - "contributors": [ - "yachiehwu" - ] - }, - "Web/API/Geolocation/getCurrentPosition": { - "modified": "2019-03-23T22:36:11.405Z", - "contributors": [ - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/Geolocation/watchPosition": { - "modified": "2019-03-23T22:36:17.405Z", - "contributors": [ - "yachiehwu" - ] - }, - "Web/API/GeolocationCoordinates": { - "modified": "2019-12-10T09:36:01.136Z", - "contributors": [ - "chrisdavidmills", - "yachiehwu", - "alphan_chen" - ] - }, - "Web/API/GeolocationCoordinates/accuracy": { - "modified": "2019-12-10T09:36:00.979Z", - "contributors": [ - "chrisdavidmills", - "yachiehwu" - ] - }, - "Web/API/GeolocationCoordinates/altitude": { - "modified": "2019-12-10T09:36:00.968Z", - "contributors": [ - "chrisdavidmills", - "yachiehwu" - ] - }, - "Web/API/GeolocationCoordinates/altitudeAccuracy": { - "modified": "2019-12-10T09:36:01.111Z", - "contributors": [ - "chrisdavidmills", - "yachiehwu" - ] - }, - "Web/API/GeolocationCoordinates/heading": { - "modified": "2019-12-10T09:36:01.669Z", - "contributors": [ - "chrisdavidmills", - "yachiehwu" - ] - }, - "Web/API/GeolocationCoordinates/latitude": { - "modified": "2019-12-10T09:36:01.243Z", - "contributors": [ - "chrisdavidmills", - "yachiehwu" - ] - }, - "Web/API/GeolocationCoordinates/longitude": { - "modified": "2019-12-10T09:36:01.384Z", - "contributors": [ - "chrisdavidmills", - "yachiehwu" - ] - }, - "Web/API/GeolocationCoordinates/speed": { - "modified": "2019-12-10T09:36:01.521Z", - "contributors": [ - "chrisdavidmills", - "yachiehwu" - ] - }, - "Web/API/GeolocationPosition": { - "modified": "2019-12-10T11:05:17.271Z", - "contributors": [ - "chrisdavidmills", - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/GeolocationPosition/coords": { - "modified": "2019-12-10T11:05:17.441Z", - "contributors": [ - "chrisdavidmills", - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/GeolocationPosition/timestamp": { - "modified": "2019-12-10T11:05:17.586Z", - "contributors": [ - "chrisdavidmills", - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/GeolocationPositionError": { - "modified": "2019-12-10T10:46:55.263Z", - "contributors": [ - "chrisdavidmills", - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/GeolocationPositionError/code": { - "modified": "2019-12-10T10:46:55.437Z", - "contributors": [ - "chrisdavidmills", - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/GeolocationPositionError/message": { - "modified": "2019-12-10T10:46:55.457Z", - "contributors": [ - "chrisdavidmills", - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/GlobalEventHandlers": { - "modified": "2019-03-23T22:31:11.882Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/GlobalEventHandlers/onclick": { - "modified": "2019-08-27T10:57:49.300Z", - "contributors": [ - "StanleyDing" - ] - }, - "Web/API/GlobalEventHandlers/onclose": { - "modified": "2019-03-23T22:13:45.424Z", - "contributors": [ - "StanleyDing" - ] - }, - "Web/API/HTMLCanvasElement": { - "modified": "2019-03-23T22:48:19.691Z", - "contributors": [ - "jackblackevo", - "alk03073135", - "teoli" - ] - }, - "Web/API/HTMLCanvasElement/toDataURL": { - "modified": "2019-03-23T22:48:22.609Z", - "contributors": [ - "Ethan", - "alk03073135" - ] - }, - "Web/API/HTMLCollection": { - "modified": "2019-03-23T22:30:38.649Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLDataElement": { - "modified": "2020-10-15T22:09:39.473Z", - "contributors": [ - "qwer5656" - ] - }, - "Web/API/HTMLDocument": { - "modified": "2019-03-23T22:30:43.077Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLElement": { - "modified": "2019-03-23T22:30:28.594Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLElement/click": { - "modified": "2019-03-23T22:19:07.322Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLElement/dataset": { - "modified": "2019-03-18T21:38:45.005Z", - "contributors": [ - "willynpi" - ] - }, - "Web/API/HTMLElement/lang": { - "modified": "2019-03-23T22:12:53.096Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLElement/style": { - "modified": "2019-03-23T22:20:07.015Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLFormElement": { - "modified": "2019-03-23T22:18:52.812Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLFormElement/submit_event": { - "modified": "2019-04-12T00:17:26.826Z", - "contributors": [ - "estelle", - "fscholz", - "Shiyou" - ] - }, - "Web/API/HTMLImageElement": { - "modified": "2019-03-23T22:18:52.559Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLInputElement": { - "modified": "2019-03-23T22:30:03.357Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLMediaElement": { - "modified": "2020-10-15T22:01:39.859Z", - "contributors": [ - "fscholz", - "jsgao0" - ] - }, - "Web/API/HTMLMediaElement/ratechange_event": { - "modified": "2019-03-18T20:49:27.842Z", - "contributors": [ - "estelle", - "EvenC" - ] - }, - "Web/API/HTMLMediaElement/readyState": { - "modified": "2020-10-15T22:07:42.605Z", - "contributors": [ - "NoobTW" - ] - }, - "Web/API/HTMLSelectElement": { - "modified": "2019-03-23T22:18:47.753Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLSelectElement/checkValidity": { - "modified": "2019-03-23T22:10:09.837Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/HTMLSelectElement/setCustomValidity": { - "modified": "2020-10-15T21:54:50.657Z", - "contributors": [ - "iigmir", - "jackblackevo" - ] - }, - "Web/API/HTML_Drag_and_Drop_API": { - "modified": "2019-03-23T23:10:47.648Z", - "contributors": [ - "ayhaadam", - "iigmir", - "jackblackevo", - "teoli", - "foxbrush" - ] - }, - "Web/API/HTML_Drag_and_Drop_API/Drag_operations": { - "modified": "2019-03-23T23:10:36.835Z", - "contributors": [ - "oooooo", - "jackblackevo", - "foxbrush" - ] - }, - "Web/API/History": { - "modified": "2019-03-23T22:06:32.333Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/History_API": { - "modified": "2019-05-23T03:21:29.855Z", - "contributors": [ - "SphinxKnight", - "KatsuragiCSL", - "jackblackevo", - "changbenny", - "rexct", - "irvinfly", - "Klern", - "Sheppy", - "ChiLiJung" - ] - }, - "Web/API/IDBDatabase": { - "modified": "2019-03-23T22:39:46.666Z", - "contributors": [ - "ALiangLiang" - ] - }, - "Web/API/IndexedDB_API": { - "modified": "2019-03-23T23:34:48.559Z", - "contributors": [ - "wbamberg", - "jackblackevo", - "foxbrush", - "MashKao", - "ethertank", - "princetoad@gmail.com" - ] - }, - "Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB": { - "modified": "2019-03-18T20:39:41.131Z", - "contributors": [ - "choznerol", - "jackblackevo", - "birdca", - "foxbrush", - "thomaschen" - ] - }, - "Web/API/IndexedDB_API/Using_IndexedDB": { - "modified": "2019-06-26T04:56:24.502Z", - "contributors": [ - "jackblackevo", - "foxbrush" - ] - }, - "Web/API/KeyboardEvent": { - "modified": "2019-03-18T21:09:08.334Z", - "contributors": [ - "fscholz", - "wbamberg", - "Shiyou" - ] - }, - "Web/API/KeyboardEvent/KeyboardEvent": { - "modified": "2019-03-23T22:47:21.168Z", - "contributors": [ - "Shiyou" - ] - }, - "Web/API/MediaQueryList": { - "modified": "2019-03-23T22:56:00.808Z", - "contributors": [ - "foxbrush" - ] - }, - "Web/API/MediaSource": { - "modified": "2020-10-15T21:52:20.197Z", - "contributors": [ - "aChinKaiWu" - ] - }, - "Web/API/MediaSource/MediaSource": { - "modified": "2019-03-23T22:17:49.071Z", - "contributors": [ - "aChinKaiWu" - ] - }, - "Web/API/MediaSource/activeSourceBuffers": { - "modified": "2019-03-23T22:17:50.588Z", - "contributors": [ - "aChinKaiWu" - ] - }, - "Web/API/MediaSource/duration": { - "modified": "2019-03-23T22:17:52.088Z", - "contributors": [ - "aChinKaiWu" - ] - }, - "Web/API/MediaSource/readyState": { - "modified": "2019-03-23T22:17:05.691Z", - "contributors": [ - "aChinKaiWu" - ] - }, - "Web/API/Media_Streams_API": { - "modified": "2020-11-05T04:25:49.611Z", - "contributors": [ - "SphinxKnight", - "yckevin1130" - ] - }, - "Web/API/MouseEvent": { - "modified": "2019-03-23T22:19:36.683Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/MutationObserver": { - "modified": "2019-03-23T22:39:23.098Z", - "contributors": [ - "Petingo", - "ALiangLiang" - ] - }, - "Web/API/NamedNodeMap": { - "modified": "2019-03-23T22:30:37.384Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Navigator": { - "modified": "2019-03-23T22:36:11.927Z", - "contributors": [ - "iigmir", - "jackblackevo", - "teoli" - ] - }, - "Web/API/Navigator/geolocation": { - "modified": "2019-03-23T22:36:10.122Z", - "contributors": [ - "yachiehwu", - "alphan_chen" - ] - }, - "Web/API/Navigator/registerProtocolHandler": { - "modified": "2019-03-23T22:01:47.891Z", - "contributors": [ - "chrisdavidmills" - ] - }, - "Web/API/Navigator/registerProtocolHandler/Web-based_protocol_handlers": { - "modified": "2019-03-23T23:51:06.175Z", - "contributors": [ - "chrisdavidmills", - "teoli", - "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": [ - "jackblackevo", - "MashKao" - ] - }, - "Web/API/Node": { - "modified": "2019-03-23T22:31:01.035Z", - "contributors": [ - "jackblackevo", - "Sebastianz" - ] - }, - "Web/API/Node/childNodes": { - "modified": "2019-03-23T22:12:04.783Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Node/cloneNode": { - "modified": "2019-03-23T22:18:53.920Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Node/innerText": { - "modified": "2019-03-23T22:12:44.697Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Node/insertBefore": { - "modified": "2020-10-15T22:10:04.295Z", - "contributors": [ - "willynpi" - ] - }, - "Web/API/Node/nodeName": { - "modified": "2019-03-23T22:12:43.285Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Node/nodeType": { - "modified": "2019-03-23T22:30:58.367Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Node/ownerDocument": { - "modified": "2019-03-23T22:30:38.954Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Node/removeChild": { - "modified": "2020-10-15T22:20:11.215Z", - "contributors": [ - "ginszme", - "lebniz" - ] - }, - "Web/API/Node/textContent": { - "modified": "2019-03-23T22:30:14.613Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/NodeList": { - "modified": "2019-03-23T22:30:29.129Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/NonDocumentTypeChildNode": { - "modified": "2019-03-23T22:30:38.352Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Notifications_API": { - "modified": "2020-04-21T06:01:14.944Z", - "contributors": [ - "kinlish", - "jackblackevo" - ] - }, - "Web/API/Notifications_API/Using_the_Notifications_API": { - "modified": "2019-03-23T23:25:54.456Z", - "contributors": [ - "SiderealArt", - "jackblackevo", - "MashKao" - ] - }, - "Web/API/ParentNode": { - "modified": "2019-12-24T08:07:24.128Z", - "contributors": [ - "ianchen0119", - "jackblackevo" - ] - }, - "Web/API/ParentNode/children": { - "modified": "2019-03-23T22:12:04.488Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/ParentNode/firstElementChild": { - "modified": "2020-10-15T22:25:38.862Z", - "contributors": [ - "ianchen0119" - ] - }, - "Web/API/PaymentRequest": { - "modified": "2020-10-15T22:13:15.817Z", - "contributors": [ - "iigmir" - ] - }, - "Web/API/Payment_Request_API": { - "modified": "2020-10-15T22:17:10.641Z", - "contributors": [ - "iigmir" - ] - }, - "Web/API/Performance": { - "modified": "2020-10-15T22:10:19.285Z", - "contributors": [ - "fscholz", - "jasonslyvia" - ] - }, - "Web/API/Performance.timing": { - "modified": "2020-10-15T21:29:18.100Z", - "contributors": [ - "fscholz", - "BobChao" - ] - }, - "Web/API/Pointer_Lock_API": { - "modified": "2019-03-23T23:21:42.932Z", - "contributors": [ - "fscholz", - "jackblackevo", - "MashKao" - ] - }, - "Web/API/PositionOptions": { - "modified": "2019-03-23T22:36:10.505Z", - "contributors": [ - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/PositionOptions/enableHighAccuracy": { - "modified": "2019-03-23T22:36:14.585Z", - "contributors": [ - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/PositionOptions/maximumAge": { - "modified": "2019-03-23T22:36:18.389Z", - "contributors": [ - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/PositionOptions/timeout": { - "modified": "2019-03-23T22:36:20.985Z", - "contributors": [ - "alphan_chen", - "yachiehwu" - ] - }, - "Web/API/ProgressEvent": { - "modified": "2019-03-23T22:23:49.095Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Proximity_Events": { - "modified": "2019-03-23T23:26:18.756Z", - "contributors": [ - "jackblackevo", - "teoli", - "MashKao" - ] - }, - "Web/API/Range": { - "modified": "2019-03-23T22:11:39.715Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Response": { - "modified": "2020-10-15T22:20:33.291Z", - "contributors": [ - "Snailpool" - ] - }, - "Web/API/Screen": { - "modified": "2019-03-23T22:19:37.677Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Screen/orientation": { - "modified": "2019-03-23T22:19:12.880Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Server-sent_events": { - "modified": "2019-03-23T22:48:59.519Z", - "contributors": [ - "alk03073135" - ] - }, - "Web/API/Server-sent_events/Using_server-sent_events": { - "modified": "2020-10-15T21:38:16.488Z", - "contributors": [ - "t7yang", - "Shiyou", - "alk03073135" - ] - }, - "Web/API/Storage": { - "modified": "2020-10-15T22:18:31.680Z", - "contributors": [ - "Snailpool" - ] - }, - "Web/API/Touch": { - "modified": "2019-03-23T22:19:42.184Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/TouchEvent": { - "modified": "2019-03-23T22:19:43.288Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/TouchList": { - "modified": "2019-03-23T22:19:16.026Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Touch_events": { - "modified": "2019-03-23T22:19:45.724Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/UIEvent": { - "modified": "2019-03-23T22:47:07.957Z", - "contributors": [ - "jackblackevo", - "Shiyou" - ] - }, - "Web/API/UIEvent/UIEvent": { - "modified": "2019-03-23T22:47:00.620Z", - "contributors": [ - "Shiyou" - ] - }, - "Web/API/URL": { - "modified": "2019-03-23T22:45:27.784Z", - "contributors": [ - "jackblackevo", - "Sebastianz" - ] - }, - "Web/API/URL/createObjectURL": { - "modified": "2019-03-23T22:45:24.757Z", - "contributors": [ - "mike-su" - ] - }, - "Web/API/ValidityState": { - "modified": "2019-03-23T22:10:00.790Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Vibration_API": { - "modified": "2019-03-23T23:26:11.215Z", - "contributors": [ - "jackblackevo", - "MashKao" - ] - }, - "Web/API/WebGL_API": { - "modified": "2019-03-23T23:05:10.310Z", - "contributors": [ - "oberonfrog", - "JamsYC.Huang", - "fscholz", - "bassam", - "wildsky" - ] - }, - "Web/API/WebGL_API/Tutorial": { - "modified": "2019-03-23T22:28:04.854Z", - "contributors": [ - "oberonfrog", - "leannechen", - "fscholz" - ] - }, - "Web/API/WebGL_API/Tutorial/Adding_2D_content_to_a_WebGL_context": { - "modified": "2019-03-23T22:05:33.181Z", - "contributors": [ - "oberonfrog" - ] - }, - "Web/API/WebGL_API/Tutorial/Animating_objects_with_WebGL": { - "modified": "2019-03-23T22:05:08.179Z", - "contributors": [ - "oberonfrog" - ] - }, - "Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL": { - "modified": "2019-03-23T22:28:11.788Z", - "contributors": [ - "Milkker", - "jackblackevo", - "mmis1000", - "oberonfrog", - "iamlockon" - ] - }, - "Web/API/WebGL_API/Tutorial/Using_shaders_to_apply_color_in_WebGL": { - "modified": "2019-03-23T22:05:32.507Z", - "contributors": [ - "oberonfrog" - ] - }, - "Web/API/WebRTC_API": { - "modified": "2020-03-24T21:28:22.800Z", - "contributors": [ - "LeonH", - "VirtualDruid", - "jackblackevo" - ] - }, - "Web/API/WebVR_API": { - "modified": "2019-03-23T22:05:10.343Z", - "contributors": [ - "oberonfrog" - ] - }, - "Web/API/Web_Audio_API": { - "modified": "2019-04-23T04:18:05.778Z", - "contributors": [ - "jackblackevo", - "MashKao" - ] - }, - "Web/API/Web_Video_Text_Tracks_Format": { - "modified": "2019-03-23T23:11:00.411Z", - "contributors": [ - "wbamberg", - "BobChao" - ] - }, - "Web/API/Web_Workers_API": { - "modified": "2019-03-23T22:31:22.820Z", - "contributors": [ - "teoli" - ] - }, - "Web/API/Web_Workers_API/Using_web_workers": { - "modified": "2019-03-23T23:27:47.429Z", - "contributors": [ - "t7yang", - "teoli", - "jackblackevo", - "foxbrush", - "walkingice" - ] - }, - "Web/API/WheelEvent": { - "modified": "2019-03-18T21:36:10.655Z", - "contributors": [ - "Zhang-Junzhi" - ] - }, - "Web/API/Window": { - "modified": "2019-03-23T22:30:42.242Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Window.history": { - "modified": "2019-03-23T23:27:30.087Z", - "contributors": [ - "jackblackevo", - "jsx", - "ChiLiJung" - ] - }, - "Web/API/Window.onpopstate": { - "modified": "2019-03-23T23:27:28.070Z", - "contributors": [ - "irvinfly", - "khalid32", - "ChiLiJung" - ] - }, - "Web/API/Window.requestAnimationFrame": { - "modified": "2020-10-15T21:24:54.235Z", - "contributors": [ - "t7yang", - "Ekanan", - "North", - "foxbrush" - ] - }, - "Web/API/Window/getComputedStyle": { - "modified": "2019-03-23T22:10:08.484Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Window/localStorage": { - "modified": "2020-10-15T22:24:50.356Z", - "contributors": [ - "chrischi0922s", - "alkalineW" - ] - }, - "Web/API/Window/location": { - "modified": "2019-04-23T03:35:06.433Z", - "contributors": [ - "jackblackevo", - "khalid32", - "appleboy" - ] - }, - "Web/API/Window/navigator": { - "modified": "2019-07-25T17:42:57.501Z", - "contributors": [ - "lixingnan200", - "jackblackevo" - ] - }, - "Web/API/Window/opener": { - "modified": "2019-03-23T22:06:26.845Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/Window/orientationchange_event": { - "modified": "2020-10-15T22:05:03.774Z", - "contributors": [ - "jackblackevo", - "fscholz", - "BwayCer" - ] - }, - "Web/API/Window/print": { - "modified": "2019-03-18T21:45:25.421Z", - "contributors": [ - "laneser" - ] - }, - "Web/API/Window/requestIdleCallback": { - "modified": "2019-03-23T22:08:40.506Z", - "contributors": [ - "zonr" - ] - }, - "Web/API/Window/sessionStorage": { - "modified": "2020-10-15T21:58:23.409Z", - "contributors": [ - "iigmir", - "EyiLee", - "EricPing" - ] - }, - "Web/API/Window/sidebar": { - "modified": "2019-03-23T22:03:03.633Z", - "contributors": [ - "IsaacSchemm" - ] - }, - "Web/API/Window/sidebar/Adding_search_engines_from_Web_pages": { - "modified": "2019-01-16T15:28:04.055Z", - "contributors": [ - "jackblackevo", - "Mgjbot", - "BobChao" - ] - }, - "Web/API/WindowBase64": { - "modified": "2019-03-23T22:30:45.308Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/WindowEventHandlers": { - "modified": "2019-03-23T22:30:52.273Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/WindowEventHandlers/onbeforeunload": { - "modified": "2019-03-23T22:27:46.116Z", - "contributors": [ - "hstarorg" - ] - }, - "Web/API/WindowOrWorkerGlobalScope": { - "modified": "2020-10-15T22:29:08.795Z", - "contributors": [ - "mfuji09" - ] - }, - "Web/API/WindowOrWorkerGlobalScope/btoa": { - "modified": "2020-10-15T22:35:15.820Z", - "contributors": [ - "evo938evo938" - ] - }, - "Web/API/WindowOrWorkerGlobalScope/setInterval": { - "modified": "2020-10-15T22:29:07.467Z", - "contributors": [ - "chrischi0922s" - ] - }, - "Web/API/WindowTimers": { - "modified": "2019-03-18T21:16:54.761Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/XMLHttpRequest": { - "modified": "2020-10-15T21:21:13.079Z", - "contributors": [ - "ginszme", - "fscholz", - "willynpi", - "jackblackevo", - "teoli", - "foxbrush", - "natevw" - ] - }, - "Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests": { - "modified": "2019-03-23T22:55:39.839Z", - "contributors": [ - "blackbingo", - "teoli", - "alk03073135" - ] - }, - "Web/API/XMLHttpRequest/Using_XMLHttpRequest": { - "modified": "2019-03-23T23:25:28.545Z", - "contributors": [ - "jackblackevo", - "teoli", - "foxbrush" - ] - }, - "Web/API/XMLHttpRequest/XMLHttpRequest": { - "modified": "2020-04-01T05:25:46.906Z", - "contributors": [ - "ginszme" - ] - }, - "Web/API/XMLHttpRequest/onreadystatechange": { - "modified": "2019-03-23T22:16:06.897Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/XMLHttpRequest/readyState": { - "modified": "2019-03-23T22:16:03.865Z", - "contributors": [ - "jWorker", - "jackblackevo", - "ginszme" - ] - }, - "Web/API/XMLHttpRequest/setRequestHeader": { - "modified": "2020-10-15T22:28:44.084Z", - "contributors": [ - "ginszme" - ] - }, - "Web/API/XMLHttpRequest/status": { - "modified": "2019-03-23T22:12:50.172Z", - "contributors": [ - "ginszme" - ] - }, - "Web/API/XMLHttpRequest/withCredentials": { - "modified": "2020-10-15T22:17:19.013Z", - "contributors": [ - "willh" - ] - }, - "Web/API/XMLHttpRequestEventTarget": { - "modified": "2019-03-23T22:12:26.382Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/API/console/assert": { - "modified": "2020-10-15T22:03:27.482Z", - "contributors": [ - "lin826", - "iigmir" - ] - }, - "Web/API/document.createTreeWalker": { - "modified": "2019-03-23T23:14:12.386Z", - "contributors": [ - "jsx", - "shyangs" - ] - }, - "Web/API/notification": { - "modified": "2020-04-21T05:58:29.795Z", - "contributors": [ - "kinlish", - "bros0215", - "SphinxKnight", - "Shiyou" - ] - }, - "Web/Accessibility": { - "modified": "2019-09-11T08:39:45.699Z", - "contributors": [ - "SphinxKnight", - "iigmir", - "boa0332" - ] - }, - "Web/Accessibility/ARIA": { - "modified": "2019-03-23T22:50:56.989Z", - "contributors": [ - "teoli" - ] - }, - "Web/Accessibility/ARIA/ARIA_Techniques": { - "modified": "2019-03-18T21:39:54.388Z", - "contributors": [ - "oooooo" - ] - }, - "Web/Accessibility/ARIA/forms": { - "modified": "2019-06-27T12:10:30.271Z", - "contributors": [ - "FredericChang", - "Sheppy" - ] - }, - "Web/Accessibility/ARIA/forms/Basic_form_hints": { - "modified": "2019-03-23T22:50:58.911Z", - "contributors": [ - "PatrickTaiwan", - "Shiyou", - "alk03073135" - ] - }, - "Web/Accessibility/Mobile_accessibility_checklist": { - "modified": "2019-03-18T21:32:14.782Z", - "contributors": [ - "li-liam" - ] - }, - "Web/CSS": { - "modified": "2019-09-11T03:42:04.510Z", - "contributors": [ - "SphinxKnight", - "jjyaung", - "xuan0123", - "jackblackevo", - "iigmir", - "flyinglimao", - "thomasaria", - "irvinfly", - "teoli", - "ethertank", - "sailplaneTW", - "Mgjbot", - "BobChao" - ] - }, - "Web/CSS/::first-letter": { - "modified": "2019-03-23T22:31:14.643Z", - "contributors": [ - "iigmir" - ] - }, - "Web/CSS/:first-child": { - "modified": "2019-03-23T22:28:52.270Z", - "contributors": [ - "mgrn" - ] - }, - "Web/CSS/:first-of-type": { - "modified": "2019-03-23T22:10:08.926Z", - "contributors": [ - "nyngwang" - ] - }, - "Web/CSS/:lang": { - "modified": "2020-10-15T22:13:50.122Z", - "contributors": [ - "oooooo" - ] - }, - "Web/CSS/:target": { - "modified": "2019-03-23T22:49:40.294Z", - "contributors": [ - "alk03073135" - ] - }, - "Web/CSS/@font-face": { - "modified": "2019-03-23T23:28:16.382Z", - "contributors": [ - "fscholz", - "teoli", - "carl_tw" - ] - }, - "Web/CSS/@media": { - "modified": "2019-03-23T22:21:19.252Z", - "contributors": [ - "iigmir", - "xim" - ] - }, - "Web/CSS/@media/height": { - "modified": "2019-03-23T22:21:21.278Z", - "contributors": [ - "MashKao", - "yvonne6344" - ] - }, - "Web/CSS/@viewport": { - "modified": "2019-03-18T21:16:53.558Z", - "contributors": [ - "cvrebert" - ] - }, - "Web/CSS/@viewport/height": { - "modified": "2019-10-22T02:02:49.952Z", - "contributors": [ - "Zhang-Junzhi", - "yvonne6344" - ] - }, - "Web/CSS/CSS_Animations": { - "modified": "2019-03-23T22:43:48.571Z", - "contributors": [ - "teoli" - ] - }, - "Web/CSS/CSS_Animations/Using_CSS_animations": { - "modified": "2019-03-24T00:13:58.706Z", - "contributors": [ - "SphinxKnight", - "teoli", - "ethertank", - "sailplaneTW" - ] - }, - "Web/CSS/CSS_Background_and_Borders": { - "modified": "2019-03-23T22:44:17.591Z", - "contributors": [ - "teoli" - ] - }, - "Web/CSS/CSS_Background_and_Borders/Using_CSS_multiple_backgrounds": { - "modified": "2019-03-23T22:48:53.708Z", - "contributors": [ - "sss63232", - "Shiyou", - "teoli", - "alk03073135" - ] - }, - "Web/CSS/CSS_Box_Model": { - "modified": "2019-03-23T22:24:07.076Z", - "contributors": [ - "Sebastianz" - ] - }, - "Web/CSS/CSS_Box_Model/Mastering_margin_collapsing": { - "modified": "2020-08-17T06:43:18.638Z", - "contributors": [ - "osk2", - "lilychen1388", - "jackblackevo", - "MOSapeizer" - ] - }, - "Web/CSS/CSS_Colors": { - "modified": "2019-03-23T22:44:44.114Z", - "contributors": [ - "Sebastianz", - "teoli" - ] - }, - "Web/CSS/CSS_Colors/Color_picker_tool": { - "modified": "2019-03-23T22:44:42.147Z", - "contributors": [ - "Shiyou", - "alk03073135" - ] - }, - "Web/CSS/CSS_Flexible_Box_Layout": { - "modified": "2020-07-30T05:18:51.473Z", - "contributors": [ - "klareh", - "iigmir", - "1986slayer", - "WynnChen" - ] - }, - "Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes": { - "modified": "2020-05-11T23:59:37.780Z", - "contributors": [ - "wildsky", - "iigmir", - "1986slayer" - ] - }, - "Web/CSS/CSS_Grid_Layout": { - "modified": "2020-02-01T05:41:13.615Z", - "contributors": [ - "SvampK", - "iigmir", - "1986slayer", - "jackblackevo" - ] - }, - "Web/CSS/CSS_Grid_Layout/Basic_Concepts_of_Grid_Layout": { - "modified": "2019-10-24T13:10:33.813Z", - "contributors": [ - "akccakcctw", - "iigmir", - "1986slayer" - ] - }, - "Web/CSS/CSS_Lists_and_Counters": { - "modified": "2019-03-23T22:18:52.970Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/CSS/CSS_Lists_and_Counters/Consistent_list_indentation": { - "modified": "2019-03-24T00:14:02.326Z", - "contributors": [ - "jackblackevo", - "ethertank", - "sailplaneTW" - ] - }, - "Web/CSS/CSS_Positioning": { - "modified": "2019-03-23T22:18:48.097Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/CSS/CSS_Positioning/Understanding_z_index": { - "modified": "2019-03-23T22:55:06.815Z", - "contributors": [ - "jackblackevo", - "Jeremie" - ] - }, - "Web/CSS/CSS_Positioning/Understanding_z_index/Stacking_context_example_1": { - "modified": "2019-03-23T22:55:03.379Z", - "contributors": [ - "jackblackevo", - "h140100" - ] - }, - "Web/CSS/CSS_Properties_Reference": { - "modified": "2020-10-21T10:34:59.711Z", - "contributors": [ - "SvampK", - "jackblackevo" - ] - }, - "Web/CSS/CSS_Selectors": { - "modified": "2020-10-24T16:00:38.628Z", - "contributors": [ - "NekoChan-2851", - "weichengcing", - "BobChao", - "noih", - "jsgao0", - "jackblackevo" - ] - }, - "Web/CSS/CSS_Selectors/Using_the_:target_pseudo-class_in_selectors": { - "modified": "2019-03-23T22:49:42.209Z", - "contributors": [ - "jackblackevo", - "alk03073135" - ] - }, - "Web/CSS/CSS_Transitions": { - "modified": "2019-03-23T22:18:48.267Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/CSS/CSS_Transitions/Using_CSS_transitions": { - "modified": "2019-03-24T00:14:17.322Z", - "contributors": [ - "jackblackevo", - "elin", - "ethertank", - "sailplaneTW" - ] - }, - "Web/CSS/Common_CSS_Questions": { - "modified": "2020-07-16T22:25:46.290Z", - "contributors": [ - "fscholz", - "teoli", - "Mgjbot", - "BobChao" - ] - }, - "Web/CSS/Descendant_combinator": { - "modified": "2019-03-23T22:47:36.182Z", - "contributors": [ - "ExE-Boss", - "changbenny" - ] - }, - "Web/CSS/Media_Queries": { - "modified": "2019-03-23T22:18:53.365Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/CSS/Media_Queries/Testing_media_queries": { - "modified": "2019-03-23T22:55:57.771Z", - "contributors": [ - "jackblackevo", - "foxbrush" - ] - }, - "Web/CSS/Pseudo-classes": { - "modified": "2019-03-23T22:25:22.712Z", - "contributors": [ - "iigmir" - ] - }, - "Web/CSS/Reference": { - "modified": "2019-03-23T22:00:54.291Z", - "contributors": [ - "jackblackevo", - "pigmu" - ] - }, - "Web/CSS/Replaced_element": { - "modified": "2019-03-23T22:59:51.482Z", - "contributors": [ - "MashKao" - ] - }, - "Web/CSS/Shorthand_properties": { - "modified": "2019-03-23T23:05:17.353Z", - "contributors": [ - "fscholz", - "irvinfly", - "wildsky" - ] - }, - "Web/CSS/Syntax": { - "modified": "2020-06-01T00:28:11.978Z", - "contributors": [ - "bensontobeicsc", - "jackblackevo", - "xuan0123" - ] - }, - "Web/CSS/Type_selectors": { - "modified": "2020-10-15T22:16:41.850Z", - "contributors": [ - "a1178961372", - "YvonneYu" - ] - }, - "Web/CSS/animation-fill-mode": { - "modified": "2019-03-18T21:42:33.553Z", - "contributors": [ - "yoonasy" - ] - }, - "Web/CSS/attr()": { - "modified": "2020-11-04T08:52:16.034Z", - "contributors": [ - "chrisdavidmills", - "DevinKWu", - "SphinxKnight", - "iigmir", - "mrstork", - "prayash", - "andyyou" - ] - }, - "Web/CSS/background-attachment": { - "modified": "2020-10-15T22:23:27.829Z", - "contributors": [ - "ayugioh2003" - ] - }, - "Web/CSS/background-color": { - "modified": "2020-10-15T21:39:17.646Z", - "contributors": [ - "SphinxKnight", - "s10750257", - "Sebastianz", - "Shiyou" - ] - }, - "Web/CSS/border": { - "modified": "2020-10-15T22:17:53.607Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/CSS/border-image": { - "modified": "2019-03-24T00:08:26.325Z", - "contributors": [ - "wbamberg", - "teoli", - "Kennyluck" - ] - }, - "Web/CSS/border-image/border-image": { - "modified": "2019-03-24T00:08:11.061Z", - "contributors": [ - "mrstork", - "teoli", - "Kennyluck" - ] - }, - "Web/CSS/box-shadow": { - "modified": "2020-09-11T09:09:21.899Z", - "contributors": [ - "slivenred", - "jackblackevo", - "DoJQuadArts", - "Sebastianz", - "alk03073135" - ] - }, - "Web/CSS/box-sizing": { - "modified": "2020-10-15T21:47:19.062Z", - "contributors": [ - "chih-hsi-chen", - "yungshenglu", - "SJW", - "PJCHENder", - "iigmir", - "fscholz", - "jwhitlock", - "YuCheng" - ] - }, - "Web/CSS/clip": { - "modified": "2019-03-23T22:33:08.119Z", - "contributors": [ - "Jerry-Hong" - ] - }, - "Web/CSS/cursor": { - "modified": "2020-10-15T22:07:15.106Z", - "contributors": [ - "it4u" - ] - }, - "Web/CSS/grid-row": { - "modified": "2020-10-15T21:53:10.432Z", - "contributors": [ - "fscholz", - "1986slayer" - ] - }, - "Web/CSS/grid-template": { - "modified": "2020-10-15T22:30:52.332Z", - "contributors": [ - "blueanger31" - ] - }, - "Web/CSS/grid-template-columns": { - "modified": "2020-10-15T21:53:17.222Z", - "contributors": [ - "fscholz", - "1986slayer" - ] - }, - "Web/CSS/height": { - "modified": "2019-03-23T22:21:15.320Z", - "contributors": [ - "yvonne6344" - ] - }, - "Web/CSS/ime-mode": { - "modified": "2019-01-16T15:28:05.312Z", - "contributors": [ - "teoli", - "Mgjbot", - "BobChao" - ] - }, - "Web/CSS/inheritance": { - "modified": "2019-03-23T22:48:52.230Z", - "contributors": [ - "jackblackevo", - "alk03073135" - ] - }, - "Web/CSS/line-break": { - "modified": "2020-10-15T22:24:02.776Z", - "contributors": [ - "jsgao0" - ] - }, - "Web/CSS/object-fit": { - "modified": "2019-03-23T22:27:58.659Z", - "contributors": [ - "gn00979905" - ] - }, - "Web/CSS/radial-gradient()": { - "modified": "2020-11-18T14:43:15.827Z", - "contributors": [ - "chrisdavidmills", - "linzging" - ] - }, - "Web/CSS/ruby-position": { - "modified": "2020-10-15T21:51:03.131Z", - "contributors": [ - "iigmir" - ] - }, - "Web/CSS/transform": { - "modified": "2020-10-15T21:38:21.566Z", - "contributors": [ - "allchangechallenge", - "jackblackevo", - "Sebastianz", - "CarterTsai", - "SphinxKnight", - "fscholz", - "alk03073135" - ] - }, - "Web/CSS/transform-function": { - "modified": "2019-03-23T22:49:34.155Z", - "contributors": [ - "mrstork", - "prayash", - "alk03073135" - ] - }, - "Web/CSS/transform-function/translate3d()": { - "modified": "2020-11-30T13:00:00.920Z", - "contributors": [ - "chrisdavidmills", - "iigmir" - ] - }, - "Web/CSS/transform-origin": { - "modified": "2020-10-15T22:05:18.550Z", - "contributors": [ - "willynpi" - ] - }, - "Web/CSS/transition": { - "modified": "2020-10-15T22:08:09.027Z", - "contributors": [ - "willynpi" - ] - }, - "Web/CSS/transition-duration": { - "modified": "2020-10-15T22:08:04.691Z", - "contributors": [ - "willynpi" - ] - }, - "Web/CSS/transition-timing-function": { - "modified": "2020-10-15T22:02:01.243Z", - "contributors": [ - "flyinglimao" - ] - }, - "Web/CSS/white-space": { - "modified": "2019-03-23T22:06:04.997Z", - "contributors": [ - "ymcheung", - "leannechen" - ] - }, - "Web/CSS/width": { - "modified": "2020-10-15T22:01:32.599Z", - "contributors": [ - "yutzuch" - ] - }, - "Web/Demos_of_open_web_technologies": { - "modified": "2019-03-23T22:08:13.863Z", - "contributors": [ - "h223449961", - "tigercosmos" - ] - }, - "Web/Events": { - "modified": "2019-11-28T04:54:28.795Z", - "contributors": [ - "t7yang", - "fadeawaygod", - "wbamberg", - "Septem", - "fscholz", - "jackblackevo", - "Shiyou", - "ethertank", - "louisremi" - ] - }, - "Web/Events/DOMContentLoaded": { - "modified": "2019-04-30T13:56:21.954Z", - "contributors": [ - "wbamberg", - "fscholz", - "NoctisHsu", - "jackblackevo", - "ethertank", - "CarterTsai" - ] - }, - "Web/Events/abort": { - "modified": "2019-04-30T14:18:03.298Z", - "contributors": [ - "wbamberg", - "secminhr" - ] - }, - "Web/Events/load": { - "modified": "2019-03-23T22:18:11.736Z", - "contributors": [ - "fscholz", - "Snailpool" - ] - }, - "Web/Guide": { - "modified": "2019-03-23T23:29:55.855Z", - "contributors": [ - "Rocker", - "jackblackevo", - "alk03073135", - "ethertank", - "Sheppy" - ] - }, - "Web/Guide/AJAX": { - "modified": "2019-03-24T00:02:43.850Z", - "contributors": [ - "circlepen", - "drinktea28", - "jackblackevo", - "chrisdavidmills", - "ethertank", - "fscholz", - "happysadman", - "Mgjbot", - "kourge", - "BobChao" - ] - }, - "Web/Guide/AJAX/Getting_Started": { - "modified": "2020-08-21T06:49:10.440Z", - "contributors": [ - "timjtchang", - "jackblackevo", - "chrisdavidmills", - "luxun", - "happysadman", - "Cpthk", - "Mgjbot", - "BobChao" - ] - }, - "Web/Guide/API": { - "modified": "2019-09-11T09:35:56.658Z", - "contributors": [ - "SphinxKnight", - "shing0608" - ] - }, - "Web/Guide/DOM": { - "modified": "2019-03-23T23:29:56.158Z", - "contributors": [ - "Sheppy" - ] - }, - "Web/Guide/Events": { - "modified": "2019-03-23T22:48:03.662Z", - "contributors": [ - "jackblackevo", - "gportioli" - ] - }, - "Web/Guide/Events/Creating_and_triggering_events": { - "modified": "2019-03-23T22:48:01.128Z", - "contributors": [ - "jackblackevo", - "Shiyou" - ] - }, - "Web/Guide/Events/Event_handlers": { - "modified": "2020-05-13T00:05:39.122Z", - "contributors": [ - "ginszme", - "jackblackevo" - ] - }, - "Web/Guide/Graphics": { - "modified": "2019-04-23T04:21:07.806Z", - "contributors": [ - "jackblackevo", - "pytseng" - ] - }, - "Web/Guide/HTML/Content_categories": { - "modified": "2019-03-23T22:28:17.896Z", - "contributors": [ - "iigmir" - ] - }, - "Web/Guide/HTML/Event_attributes": { - "modified": "2019-11-20T21:38:26.184Z", - "contributors": [ - "wbamberg", - "jackblackevo" - ] - }, - "Web/Guide/HTML/HTML5": { - "modified": "2019-03-24T00:15:00.017Z", - "contributors": [ - "jackblackevo", - "Shiyou", - "teoli", - "alk03073135", - "wildsky", - "sailplaneTW", - "vigia122", - "Kennyluck", - "Dwchiang" - ] - }, - "Web/Guide/HTML/HTML5/Introduction_to_HTML5": { - "modified": "2019-03-23T22:57:07.502Z", - "contributors": [ - "jackblackevo", - "kwanjaiOP" - ] - }, - "Web/Guide/Introduction_to_Web_development": { - "modified": "2019-04-23T03:25:16.725Z", - "contributors": [ - "jackblackevo", - "khhyoshida", - "happysadman" - ] - }, - "Web/Guide/Performance": { - "modified": "2019-03-23T23:28:07.518Z", - "contributors": [ - "Sheppy" - ] - }, - "Web/Guide/WOFF": { - "modified": "2019-03-23T23:28:22.570Z", - "contributors": [ - "fscholz", - "carl_tw" - ] - }, - "Web/Guide/Writing_forward-compatible_websites": { - "modified": "2019-03-24T00:17:14.604Z", - "contributors": [ - "fscholz", - "irvinfly", - "Littlebtc", - "Sonrisa", - "sycheng" - ] - }, - "Web/HTML": { - "modified": "2020-10-16T05:00:10.652Z", - "contributors": [ - "j0987397957", - "j3ygithub", - "jjyaung", - "SphinxKnight", - "lalasoqTW", - "Mr430", - "XIGUO", - "xerviam", - "willynpi", - "iigmir", - "mybaseball52", - "antonytse", - "EtienneC", - "SecondSpirit", - "thomasaria", - "jackblackevo", - "archyaloha", - "Shiyou", - "irvinfly", - "stingyong", - "sailplaneTW" - ] - }, - "Web/HTML/Applying_color": { - "modified": "2019-03-18T21:29:53.605Z", - "contributors": [ - "WuBingHsuan" - ] - }, - "Web/HTML/Attributes": { - "modified": "2019-03-23T22:49:22.885Z", - "contributors": [ - "jackblackevo", - "stingyong" - ] - }, - "Web/HTML/Block-level_elements": { - "modified": "2019-03-23T22:04:44.255Z", - "contributors": [ - "jackblackevo", - "yimingxym" - ] - }, - "Web/HTML/Element": { - "modified": "2020-06-01T13:13:14.618Z", - "contributors": [ - "iigmir", - "ltsai323", - "unnhao", - "jackblackevo", - "irvinfly", - "teoli", - "BobChao" - ] - }, - "Web/HTML/Element/a": { - "modified": "2020-10-15T21:05:46.606Z", - "contributors": [ - "iigmir", - "hinet60613", - "jackblackevo", - "teoli", - "BobChao", - "ethertank" - ] - }, - "Web/HTML/Element/blink": { - "modified": "2020-10-15T21:53:26.779Z", - "contributors": [ - "teoli", - "iigmir" - ] - }, - "Web/HTML/Element/blockquote": { - "modified": "2019-03-23T22:32:36.058Z", - "contributors": [ - "iigmir", - "Shiyou" - ] - }, - "Web/HTML/Element/br": { - "modified": "2020-10-15T22:00:58.202Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Element/button": { - "modified": "2020-05-05T00:47:26.851Z", - "contributors": [ - "unnhao", - "weswithley" - ] - }, - "Web/HTML/Element/canvas": { - "modified": "2019-03-23T22:41:16.083Z", - "contributors": [ - "pig3629", - "GG9" - ] - }, - "Web/HTML/Element/code": { - "modified": "2019-03-23T22:29:09.754Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Element/div": { - "modified": "2020-10-15T21:47:03.763Z", - "contributors": [ - "Shiyou", - "iigmir" - ] - }, - "Web/HTML/Element/font": { - "modified": "2020-10-15T21:44:22.712Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Element/form": { - "modified": "2020-10-15T22:29:56.079Z", - "contributors": [ - "unnhao" - ] - }, - "Web/HTML/Element/frameset": { - "modified": "2019-03-23T22:28:05.345Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Element/hr": { - "modified": "2019-03-23T22:23:32.127Z", - "contributors": [ - "iigmir", - "ywchiao" - ] - }, - "Web/HTML/Element/input": { - "modified": "2019-03-23T22:08:13.272Z", - "contributors": [ - "Sheppy" - ] - }, - "Web/HTML/Element/input/submit": { - "modified": "2019-03-23T22:08:05.925Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Element/marquee": { - "modified": "2020-10-15T21:53:57.839Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Element/meter": { - "modified": "2019-04-09T18:21:26.397Z", - "contributors": [ - "jwhitlock", - "evildeepblue" - ] - }, - "Web/HTML/Element/nav": { - "modified": "2020-10-15T21:56:36.267Z", - "contributors": [ - "iigmir", - "jackblackevo", - "h223449961" - ] - }, - "Web/HTML/Element/optgroup": { - "modified": "2019-03-23T22:28:41.892Z", - "contributors": [ - "alk03073135" - ] - }, - "Web/HTML/Element/picture": { - "modified": "2020-10-15T22:32:35.687Z", - "contributors": [ - "leannechen2" - ] - }, - "Web/HTML/Element/q": { - "modified": "2020-10-15T21:49:02.776Z", - "contributors": [ - "fscholz", - "iigmir" - ] - }, - "Web/HTML/Element/ruby": { - "modified": "2020-10-15T21:49:21.871Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Element/script": { - "modified": "2020-10-15T21:41:05.397Z", - "contributors": [ - "SphinxKnight", - "t7yang", - "iigmir", - "roycrxtw", - "Shiyou" - ] - }, - "Web/HTML/Element/summary": { - "modified": "2019-03-23T22:30:12.195Z", - "contributors": [ - "Tingyu" - ] - }, - "Web/HTML/Element/table": { - "modified": "2020-10-15T21:43:36.560Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Element/template": { - "modified": "2020-10-15T22:00:56.747Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Element/time": { - "modified": "2019-03-23T22:32:35.538Z", - "contributors": [ - "Shiyou" - ] - }, - "Web/HTML/Forms_in_HTML": { - "modified": "2019-03-23T23:28:09.563Z", - "contributors": [ - "foxbrush" - ] - }, - "Web/HTML/Global_attributes": { - "modified": "2019-03-23T22:31:21.607Z", - "contributors": [ - "jackblackevo", - "iigmir" - ] - }, - "Web/HTML/Global_attributes/data-*": { - "modified": "2019-03-23T22:19:55.073Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTML/Global_attributes/spellcheck": { - "modified": "2019-03-23T23:43:42.545Z", - "contributors": [ - "jackblackevo", - "irvinfly", - "teoli", - "BobChao" - ] - }, - "Web/HTML/Quirks_Mode_and_Standards_Mode": { - "modified": "2019-03-23T22:31:44.412Z", - "contributors": [ - "iigmir", - "chrisdavidmills" - ] - }, - "Web/HTML/Reference": { - "modified": "2019-09-09T07:23:59.718Z", - "contributors": [ - "SphinxKnight", - "wbamberg", - "iigmir", - "TAlulu", - "irvinfly", - "stingyong" - ] - }, - "Web/HTML/Supported_media_formats": { - "modified": "2019-03-23T23:14:51.174Z", - "contributors": [ - "young3578671", - "Keeseonglee" - ] - }, - "Web/HTML/Using_the_application_cache": { - "modified": "2019-03-24T00:10:44.785Z", - "contributors": [ - "SphinxKnight", - "jackblackevo", - "teoli", - "Kennyluck", - "Mgjbot", - "Cooldll694", - "BobChao" - ] - }, - "Web/HTTP": { - "modified": "2020-05-09T15:09:07.858Z", - "contributors": [ - "mgrn", - "0807love0825", - "rayainman", - "xerviam", - "bnn00023", - "mybaseball52", - "jwhitlock", - "yyss" - ] - }, - "Web/HTTP/Authentication": { - "modified": "2019-03-18T21:31:55.684Z", - "contributors": [ - "hua-123" - ] - }, - "Web/HTTP/Basics_of_HTTP": { - "modified": "2020-03-16T05:38:40.530Z", - "contributors": [ - "mfuji09" - ] - }, - "Web/HTTP/Basics_of_HTTP/MIME_types": { - "modified": "2020-06-08T05:57:19.890Z", - "contributors": [ - "hikariTW", - "willynpi" - ] - }, - "Web/HTTP/Browser_detection_using_the_user_agent": { - "modified": "2020-09-21T11:14:16.789Z", - "contributors": [ - "iigmir", - "jwhitlock" - ] - }, - "Web/HTTP/CORS": { - "modified": "2020-10-15T21:21:52.967Z", - "contributors": [ - "kunyaoxu", - "LNDDYL", - "jackblackevo", - "iigmir", - "fscholz", - "hsinewu", - "jwhitlock", - "xgqfrms", - "yetisno", - "nfsnfs", - "foxbrush", - "DESKTOP-H9V56N1" - ] - }, - "Web/HTTP/CORS/Errors": { - "modified": "2019-05-07T03:11:46.742Z" - }, - "Web/HTTP/CORS/Errors/CORSDidNotSucceed": { - "modified": "2019-05-07T05:22:57.676Z", - "contributors": [ - "hms5232" - ] - }, - "Web/HTTP/CORS/Errors/CORSMissingAllowOrigin": { - "modified": "2019-05-07T05:23:32.648Z", - "contributors": [ - "hms5232" - ] - }, - "Web/HTTP/CORS/Errors/CORSNotSupportingCredentials": { - "modified": "2019-05-07T22:55:59.165Z", - "contributors": [ - "hms5232" - ] - }, - "Web/HTTP/Caching": { - "modified": "2019-09-07T05:43:44.819Z", - "contributors": [ - "CPMoviePHil", - "fadeawaygod" - ] - }, - "Web/HTTP/Cookies": { - "modified": "2019-03-18T21:43:21.294Z", - "contributors": [ - "jackblackevo", - "csiejoey" - ] - }, - "Web/HTTP/Headers": { - "modified": "2019-03-23T22:17:44.358Z", - "contributors": [ - "fscholz" - ] - }, - "Web/HTTP/Headers/Accept": { - "modified": "2020-10-15T22:27:22.748Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTTP/Headers/DNT": { - "modified": "2020-10-15T22:01:54.641Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTTP/Headers/Server": { - "modified": "2020-10-15T22:01:55.490Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTTP/Headers/Strict-Transport-Security": { - "modified": "2020-10-15T22:23:24.512Z", - "contributors": [ - "jasperlin1996", - "r1235613" - ] - }, - "Web/HTTP/Headers/User-Agent": { - "modified": "2020-10-15T21:52:25.725Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTTP/Headers/X-Forwarded-For": { - "modified": "2020-10-15T22:18:49.633Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTTP/Headers/X-Frame-Options": { - "modified": "2019-06-17T05:41:08.405Z", - "contributors": [ - "jackblackevo", - "jwhitlock", - "allenown", - "foxbrush" - ] - }, - "Web/HTTP/Link_prefetching_FAQ": { - "modified": "2019-03-23T22:49:36.623Z", - "contributors": [ - "imrobinized", - "jwhitlock", - "foxbrush" - ] - }, - "Web/HTTP/Methods": { - "modified": "2020-10-15T22:04:23.999Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTTP/Methods/CONNECT": { - "modified": "2020-10-15T22:08:59.762Z", - "contributors": [ - "flyinglimao" - ] - }, - "Web/HTTP/Methods/GET": { - "modified": "2020-10-15T22:16:59.594Z", - "contributors": [ - "sheiun" - ] - }, - "Web/HTTP/Methods/POST": { - "modified": "2020-10-15T22:17:01.111Z", - "contributors": [ - "sheiun" - ] - }, - "Web/HTTP/Protocol_upgrade_mechanism": { - "modified": "2019-11-03T23:58:28.570Z", - "contributors": [ - "nientsu" - ] - }, - "Web/HTTP/Server-Side_Access_Control": { - "modified": "2019-03-23T22:06:20.131Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/HTTP/Status": { - "modified": "2020-10-15T21:38:22.963Z", - "contributors": [ - "gogo.sanak", - "sideshowbarker", - "lesikolerina23", - "SphinxKnight", - "bobo.debila", - "iigmir", - "Fu_revwigs", - "slivenred", - "gamerslouis", - "tz70s", - "Hunsin", - "fscholz", - "jwhitlock", - "alk03073135" - ] - }, - "Web/HTTP/Status/100": { - "modified": "2020-10-15T22:17:55.422Z", - "contributors": [ - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/101": { - "modified": "2019-04-28T12:49:13.643Z", - "contributors": [ - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/200": { - "modified": "2020-10-15T22:02:32.760Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTTP/Status/201": { - "modified": "2020-10-15T22:18:06.540Z", - "contributors": [ - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/202": { - "modified": "2019-05-04T10:35:23.469Z", - "contributors": [ - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/203": { - "modified": "2019-05-18T10:26:00.843Z", - "contributors": [ - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/204": { - "modified": "2020-10-15T22:18:45.174Z", - "contributors": [ - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/205": { - "modified": "2019-05-18T10:36:04.142Z", - "contributors": [ - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/206": { - "modified": "2020-10-15T22:19:35.757Z", - "contributors": [ - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/300": { - "modified": "2019-06-01T11:53:52.718Z", - "contributors": [ - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/301": { - "modified": "2020-10-15T22:19:36.009Z", - "contributors": [ - "iigmir", - "Fu_revwigs" - ] - }, - "Web/HTTP/Status/403": { - "modified": "2020-10-15T22:18:46.702Z", - "contributors": [ - "gamerslouis" - ] - }, - "Web/HTTP/Status/404": { - "modified": "2020-10-15T22:00:39.486Z", - "contributors": [ - "bobo.debila", - "iigmir" - ] - }, - "Web/HTTP/Status/409": { - "modified": "2019-06-23T09:33:36.008Z", - "contributors": [ - "gamerslouis" - ] - }, - "Web/HTTP/Status/411": { - "modified": "2019-06-23T09:22:09.625Z", - "contributors": [ - "gamerslouis" - ] - }, - "Web/HTTP/Status/415": { - "modified": "2019-06-23T09:29:51.676Z", - "contributors": [ - "gamerslouis" - ] - }, - "Web/HTTP/Status/418_I_m_a_teapot": { - "modified": "2020-10-15T22:00:43.617Z", - "contributors": [ - "iigmir", - "dzamlo" - ] - }, - "Web/HTTP/Status/451": { - "modified": "2020-10-15T22:02:32.084Z", - "contributors": [ - "iigmir" - ] - }, - "Web/HTTP/Status/500": { - "modified": "2020-10-15T22:00:42.137Z", - "contributors": [ - "YagoZang", - "sideshowbarker", - "lesikolerina23", - "iigmir", - "slivenred" - ] - }, - "Web/HTTP/Status/502": { - "modified": "2020-10-15T22:22:34.836Z", - "contributors": [ - "bobo.debila", - "iigmir", - "slivenred" - ] - }, - "Web/HTTP/Status/503": { - "modified": "2020-10-15T22:21:37.501Z", - "contributors": [ - "iigmir", - "slivenred", - "katsmin" - ] - }, - "Web/HTTP/Status/504": { - "modified": "2020-11-05T06:35:40.877Z", - "contributors": [ - "terrylinooo", - "sideshowbarker", - "lesikolerina23", - "iigmir", - "slivenred" - ] - }, - "Web/HTTP/data_URIs": { - "modified": "2020-06-09T11:41:01.440Z", - "contributors": [ - "jhihruei", - "jwhitlock", - "Shiyou", - "alk03073135" - ] - }, - "Web/JavaScript": { - "modified": "2020-05-24T01:05:47.129Z", - "contributors": [ - "nighet", - "SphinxKnight", - "nykevinwong", - "xerviam", - "iigmir", - "cwlin0416", - "thomasaria", - "dolphinlin", - "flyinglimao", - "jackblackevo", - "mai7855", - "Shiyou", - "wildsky", - "teoli", - "steely.wing", - "ethertank", - "sycheng", - "sailplaneTW", - "linhomeyeu", - "happysadman", - "Mgjbot", - "BobChao", - "kourge" - ] - }, - "Web/JavaScript/A_re-introduction_to_JavaScript": { - "modified": "2020-03-12T19:36:04.881Z", - "contributors": [ - "kourge", - "locker_rj45", - "Q3Q", - "weihanglo", - "teoli", - "jackblackevo", - "TpWILovePanda", - "changyuheng", - "ArvinH", - "sailplaneTW", - "linhomeyeu", - "fillano", - "fscholz", - "Mgjbot", - "Smallwow", - "BobChao" - ] - }, - "Web/JavaScript/About_JavaScript": { - "modified": "2020-03-12T19:35:23.761Z", - "contributors": [ - "Talence0329", - "jackblackevo", - "irvinfly", - "teoli", - "ethertank", - "Sonrisa", - "sycheng" - ] - }, - "Web/JavaScript/Closures": { - "modified": "2020-08-07T04:58:02.421Z", - "contributors": [ - "vincent7293", - "shuboc", - "iigmir", - "roycrxtw", - "BigHeadDoggy", - "flyinglimao" - ] - }, - "Web/JavaScript/Data_structures": { - "modified": "2020-08-01T13:14:09.974Z", - "contributors": [ - "nannxnann", - "samzzz", - "iigmir", - "jackblackevo", - "eldisa" - ] - }, - "Web/JavaScript/Enumerability_and_ownership_of_properties": { - "modified": "2020-03-12T19:44:21.130Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Equality_comparisons_and_sameness": { - "modified": "2020-03-12T19:44:59.221Z", - "contributors": [ - "jsgao0", - "flyinglimao" - ] - }, - "Web/JavaScript/EventLoop": { - "modified": "2020-03-12T19:44:52.158Z", - "contributors": [ - "xuan0123", - "jackblackevo", - "roycrxtw", - "YuCheng", - "Snailpool", - "flyinglimao", - "enzoyaaaaa" - ] - }, - "Web/JavaScript/Guide": { - "modified": "2020-10-12T05:01:38.453Z", - "contributors": [ - "ShawnLin", - "nykevinwong", - "jackblackevo", - "cwlin0416", - "jwhitlock", - "teoli", - "sycheng" - ] - }, - "Web/JavaScript/Guide/Control_flow_and_error_handling": { - "modified": "2020-03-12T19:44:28.801Z", - "contributors": [ - "akccakcctw", - "iigmir", - "dews", - "jackblackevo", - "Yuki0916", - "jwhitlock", - "Kaiyeh" - ] - }, - "Web/JavaScript/Guide/Details_of_the_Object_Model": { - "modified": "2020-03-12T19:38:25.366Z", - "contributors": [ - "wbamberg", - "SphinxKnight", - "jwhitlock", - "jackblackevo", - "teoli", - "steely.wing" - ] - }, - "Web/JavaScript/Guide/Expressions_and_Operators": { - "modified": "2020-10-12T06:55:01.538Z", - "contributors": [ - "ShawnLin", - "jackblackevo", - "Kaiyeh" - ] - }, - "Web/JavaScript/Guide/Functions": { - "modified": "2020-03-12T19:39:15.149Z", - "contributors": [ - "wbamberg", - "jwhitlock", - "Kaiyeh", - "iigmir", - "jackblackevo", - "teoli", - "thomaschen" - ] - }, - "Web/JavaScript/Guide/Grammar_and_types": { - "modified": "2020-05-26T04:33:48.056Z", - "contributors": [ - "chumicat", - "King_Tzeng", - "YiyuWu", - "nykevinwong", - "Ruiyuan34", - "jackblackevo", - "Jenhaohsiao", - "KevinHuang", - "JianHuaHe", - "jwhitlock", - "Jack_Wu", - "lynn456", - "dodo4910", - "septemhill", - "fscholz", - "victor0801x", - "ShadowV", - "teoli", - "titan.liu" - ] - }, - "Web/JavaScript/Guide/Indexed_collections": { - "modified": "2020-03-12T19:47:20.689Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Guide/Introduction": { - "modified": "2020-03-12T19:35:21.304Z", - "contributors": [ - "wbamberg", - "mingyangshih", - "jwhitlock", - "jackblackevo", - "fscholz", - "irvinfly", - "teoli", - "ethertank", - "sycheng" - ] - }, - "Web/JavaScript/Guide/Iterators_and_Generators": { - "modified": "2020-03-23T19:43:30.431Z", - "contributors": [ - "hiimeimei", - "wanjingzhang" - ] - }, - "Web/JavaScript/Guide/Keyed_collections": { - "modified": "2020-03-12T19:42:35.494Z", - "contributors": [ - "jackblackevo", - "jwhitlock", - "fscholz", - "Shiyou" - ] - }, - "Web/JavaScript/Guide/Loops_and_iteration": { - "modified": "2020-03-12T19:44:25.077Z", - "contributors": [ - "MartinChang0723", - "jackblackevo", - "AmamiyaLee" - ] - }, - "Web/JavaScript/Guide/Numbers_and_dates": { - "modified": "2020-08-17T03:02:46.243Z", - "contributors": [ - "kenchill", - "UnciaX" - ] - }, - "Web/JavaScript/Guide/Regular_Expressions": { - "modified": "2020-05-25T23:31:32.570Z", - "contributors": [ - "LeoWangJ", - "oooooo", - "Lazine", - "yosia", - "seantw", - "drinktea28", - "joshra", - "jackblackevo", - "Jiaaa1014", - "jwhitlock", - "Kustz", - "pppdog", - "m80126colin", - "Shiyou", - "teoli", - "Rplus" - ] - }, - "Web/JavaScript/Guide/Using_promises": { - "modified": "2020-03-12T19:47:23.033Z", - "contributors": [ - "HamiltonWang", - "flyinglimao" - ] - }, - "Web/JavaScript/Guide/Working_with_Objects": { - "modified": "2020-03-12T19:38:34.548Z", - "contributors": [ - "Euphokumiko", - "SphinxKnight", - "AhQi", - "jwhitlock", - "pytseng", - "jackblackevo", - "iigmir", - "jigs12", - "YuXiangYen", - "teoli", - "steely.wing" - ] - }, - "Web/JavaScript/Inheritance_and_the_prototype_chain": { - "modified": "2020-11-20T06:14:21.309Z", - "contributors": [ - "tpps88206", - "pmc12thsuki", - "osk2", - "jackblackevo", - "iigmir", - "WellyHong", - "hiiamyes", - "Snailpool" - ] - }, - "Web/JavaScript/Introduction_to_Object-Oriented_JavaScript": { - "modified": "2020-08-05T00:50:19.955Z", - "contributors": [ - "nientsu", - "cwlin0416", - "fscholz", - "jackblackevo", - "nightsnow0918", - "irvinfly", - "sailplaneTW" - ] - }, - "Web/JavaScript/JavaScript_technologies_overview": { - "modified": "2020-03-12T19:35:23.439Z", - "contributors": [ - "jackblackevo", - "fscholz", - "irvinfly", - "chiayuan" - ] - }, - "Web/JavaScript/Language_Resources": { - "modified": "2020-03-12T19:36:06.284Z", - "contributors": [ - "jackblackevo", - "fscholz", - "irvinfly", - "sailplaneTW" - ] - }, - "Web/JavaScript/Memory_Management": { - "modified": "2020-12-04T15:05:56.547Z", - "contributors": [ - "chengr4", - "ballfish", - "mybaseball52" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/JavaScript_概要": { - "modified": "2019-01-16T14:44:37.660Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/LiveConnect_概要": { - "modified": "2019-01-16T14:43:16.706Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/Unicode": { - "modified": "2019-01-16T14:44:25.337Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/以類別為基礎的語言_vs._以原型為基礎的語言": { - "modified": "2019-01-16T14:43:47.289Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/例外處理語法": { - "modified": "2019-03-24T00:00:58.152Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/例外處理語法/throw_語法": { - "modified": "2019-03-24T00:00:57.682Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/例外處理語法/try...catch_語法": { - "modified": "2020-08-31T05:59:42.160Z", - "contributors": [ - "clifflu", - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/值": { - "modified": "2019-01-16T14:44:19.901Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/再談屬性的繼承": { - "modified": "2019-01-16T14:43:20.597Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/再談屬性的繼承/實體關係的確定": { - "modified": "2019-01-16T14:43:13.719Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/再談屬性的繼承/局域值和繼承值": { - "modified": "2019-01-16T14:43:16.085Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/再談屬性的繼承/建構子中的全域資訊": { - "modified": "2019-01-16T14:43:20.683Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/再談屬性的繼承/沒有多重繼承": { - "modified": "2019-01-16T14:43:21.630Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/函數的呼叫": { - "modified": "2019-03-24T00:00:58.959Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/函數的定義": { - "modified": "2019-01-16T14:44:26.521Z", - "contributors": [ - "teoli", - "Sheppy", - "Jaric", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/區塊語法": { - "modified": "2019-01-16T13:06:24.647Z", - "contributors": [ - "teoli", - "Sheppy", - "Jaric", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/字面表達": { - "modified": "2019-01-16T14:44:20.274Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/常數": { - "modified": "2019-01-16T14:44:19.601Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/建立新的物件": { - "modified": "2019-03-24T00:01:06.649Z", - "contributors": [ - "wbamberg", - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/循環語法": { - "modified": "2019-01-16T14:44:21.815Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/循環語法/break_語法": { - "modified": "2019-03-24T00:00:58.023Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/循環語法/continue_語法": { - "modified": "2019-03-24T00:01:00.198Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/循環語法/do...while_語法": { - "modified": "2019-03-24T00:00:59.356Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/循環語法/for_語法": { - "modified": "2019-03-24T00:01:11.869Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/循環語法/label_語法": { - "modified": "2019-03-24T00:01:01.557Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/循環語法/while_語法": { - "modified": "2019-03-24T00:01:00.950Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/新物件的建立": { - "modified": "2019-03-24T00:01:06.394Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/新物件的建立/Getter_和_Setter_的定義": { - "modified": "2019-03-24T00:01:05.950Z", - "contributors": [ - "fscholz", - "jigs12", - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/新物件的建立/使用_this_取得物件的參考": { - "modified": "2019-03-24T00:01:06.045Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/新物件的建立/屬性的刪除": { - "modified": "2019-03-24T00:01:04.888Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/新物件的建立/建構子函數的使用": { - "modified": "2019-03-24T00:01:06.293Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/新物件的建立/方法的定義": { - "modified": "2019-03-24T00:01:03.034Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/新物件的建立/物件初始化子的使用": { - "modified": "2019-03-24T00:01:06.480Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/新物件的建立/物件屬性的索引": { - "modified": "2019-03-24T00:01:04.238Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/新物件的建立/針對物件的類型定義屬性": { - "modified": "2019-03-24T00:01:04.444Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/條件語法": { - "modified": "2019-01-16T14:43:51.018Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/正規表達式模式的編寫": { - "modified": "2019-03-24T00:00:58.884Z", - "contributors": [ - "wildsky", - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/正規表達式的建立": { - "modified": "2019-03-24T00:01:00.293Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/正規表達式的運用": { - "modified": "2019-01-16T14:44:21.287Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/正規表達式的運用/使用標誌的進階搜尋": { - "modified": "2019-01-16T14:44:23.103Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/正規表達式的運用/括弧子字串的比對結果的運用": { - "modified": "2019-01-16T14:44:25.974Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/正規表達式的運用/正規表達式的範例": { - "modified": "2019-03-24T00:00:59.567Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/物件和屬性": { - "modified": "2019-01-16T14:44:03.755Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/物件的操作語法": { - "modified": "2019-03-24T00:00:59.074Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/繼承": { - "modified": "2019-03-24T00:01:09.212Z", - "contributors": [ - "jsgao0", - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/職員的例子": { - "modified": "2019-03-24T00:01:18.422Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/職員的例子/更靈活的建構子": { - "modified": "2019-01-16T14:43:17.913Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/職員的例子/物件的屬性": { - "modified": "2019-03-24T00:01:21.807Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/職員的例子/物件的屬性/屬性的加入": { - "modified": "2019-03-24T00:01:15.806Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/職員的例子/物件的屬性/屬性的繼承": { - "modified": "2019-03-24T00:01:17.728Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/職員的例子/階層的建立": { - "modified": "2019-03-24T00:01:17.848Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/表達式": { - "modified": "2019-01-16T14:44:25.015Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/註解": { - "modified": "2019-01-16T14:44:18.898Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/變數": { - "modified": "2019-01-16T14:44:20.971Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/迭代器和產生器": { - "modified": "2019-03-24T00:01:19.860Z", - "contributors": [ - "wbamberg", - "teoli", - "Wladimir_Palant", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/運算子": { - "modified": "2019-01-16T14:44:25.230Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/運算子/代入運算子": { - "modified": "2019-03-24T00:01:01.353Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/運算子/位元運算子": { - "modified": "2019-01-16T14:44:24.141Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/運算子/字串運算子": { - "modified": "2019-01-16T14:44:19.884Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/運算子/比較運算子": { - "modified": "2019-01-16T14:44:28.417Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/運算子/特殊運算子": { - "modified": "2019-01-16T14:44:24.727Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/運算子/算術運算子": { - "modified": "2019-01-16T14:44:25.132Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/運算子/邏輯運算子": { - "modified": "2019-01-16T14:44:21.016Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/閉包的運用": { - "modified": "2019-01-16T14:44:07.939Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/關於": { - "modified": "2019-01-16T14:44:22.263Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/陣列的運用": { - "modified": "2019-03-24T00:01:19.124Z", - "contributors": [ - "wbamberg", - "Jaja", - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的函數": { - "modified": "2019-01-16T14:44:03.697Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的函數/Number_和_String_函數": { - "modified": "2019-03-24T00:01:05.054Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的函數/escape_和_unescape_函數": { - "modified": "2019-03-24T00:01:07.501Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的函數/eval_函數": { - "modified": "2019-01-16T14:44:04.783Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的函數/isFinite_函數": { - "modified": "2019-03-24T00:01:03.372Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的函數/isNaN_函數": { - "modified": "2019-03-24T00:01:04.794Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的函數/parseInt_和_parseFloat_函數": { - "modified": "2019-03-24T00:01:07.340Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的核心物件": { - "modified": "2019-01-16T14:44:07.734Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的核心物件/Array_物件": { - "modified": "2019-03-24T00:01:13.553Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的核心物件/Boolean_物件": { - "modified": "2019-03-24T00:01:13.158Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的核心物件/Date_物件": { - "modified": "2019-03-24T00:01:09.665Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的核心物件/Function_物件": { - "modified": "2019-03-24T00:01:12.219Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的核心物件/Math_物件": { - "modified": "2019-03-24T00:01:08.965Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的核心物件/Number_物件": { - "modified": "2019-03-24T00:01:11.242Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的核心物件/RegExp_物件": { - "modified": "2019-03-24T00:01:13.910Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/預先定義的核心物件/String_物件": { - "modified": "2019-03-24T00:01:08.836Z", - "contributors": [ - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Reference": { - "modified": "2020-06-02T20:54:32.743Z", - "contributors": [ - "laampui", - "cwlin0416", - "jackblackevo", - "teoli", - "irvinfly", - "tjjh89017", - "Zhen.Di-Lin", - "Norbert" - ] - }, - "Web/JavaScript/Reference/Classes": { - "modified": "2020-03-12T19:42:37.772Z", - "contributors": [ - "hot50773", - "Aries0d0f", - "chloewlin", - "roycrxtw", - "akccakcctw", - "ywchiao", - "fbukevin" - ] - }, - "Web/JavaScript/Reference/Classes/constructor": { - "modified": "2020-07-23T05:05:44.137Z", - "contributors": [ - "t7yang", - "iigmir" - ] - }, - "Web/JavaScript/Reference/Classes/extends": { - "modified": "2020-10-15T22:06:07.272Z", - "contributors": [ - "Aries0d0f" - ] - }, - "Web/JavaScript/Reference/Classes/static": { - "modified": "2020-03-12T19:43:06.328Z", - "contributors": [ - "alkalineW", - "jerrychen1013", - "Robert-Rino" - ] - }, - "Web/JavaScript/Reference/Errors": { - "modified": "2020-03-12T19:44:53.537Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Errors/Bad_return_or_yield": { - "modified": "2020-03-12T19:44:54.646Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Errors/Invalid_array_length": { - "modified": "2020-03-12T19:49:01.235Z", - "contributors": [ - "gamerslouis" - ] - }, - "Web/JavaScript/Reference/Errors/Missing_curly_after_property_list": { - "modified": "2020-03-12T19:47:08.262Z", - "contributors": [ - "PCLIN1103" - ] - }, - "Web/JavaScript/Reference/Errors/No_properties": { - "modified": "2020-03-12T19:47:20.608Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Errors/Not_a_function": { - "modified": "2020-03-12T19:45:02.118Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Errors/Not_defined": { - "modified": "2020-03-12T19:44:53.089Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Errors/Redeclared_parameter": { - "modified": "2020-03-12T19:47:17.103Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Errors/Too_much_recursion": { - "modified": "2020-03-12T19:44:57.763Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Errors/Unexpected_type": { - "modified": "2019-03-23T22:20:43.997Z", - "contributors": [ - "andytwmvp", - "iigmir", - "kimi1111" - ] - }, - "Web/JavaScript/Reference/Functions": { - "modified": "2020-03-12T19:41:25.162Z", - "contributors": [ - "lynn456", - "fscholz" - ] - }, - "Web/JavaScript/Reference/Functions/Arrow_functions": { - "modified": "2020-10-15T21:36:09.562Z", - "contributors": [ - "iigmir", - "ShawnLin", - "Lazine", - "xuan0123", - "bagayollow", - "ctc53", - "kuolun", - "jackblackevo", - "freddy50806", - "Aisuzuka", - "Jaja", - "tonykuo", - "yungtah", - "Snailpool", - "wkliang", - "linjimmy168", - "foxbrush" - ] - }, - "Web/JavaScript/Reference/Functions/Default_parameters": { - "modified": "2020-10-05T03:37:47.112Z", - "contributors": [ - "realspirit2017", - "Jackson45252", - "jsgao0", - "Snailpool" - ] - }, - "Web/JavaScript/Reference/Functions/Method_definitions": { - "modified": "2020-10-15T21:55:16.559Z", - "contributors": [ - "iigmir", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Functions/arguments": { - "modified": "2020-10-15T21:14:39.550Z", - "contributors": [ - "itsems", - "jackblackevo", - "akari0624", - "fscholz", - "irvinfly", - "teoli", - "happysadman" - ] - }, - "Web/JavaScript/Reference/Functions/arguments/callee": { - "modified": "2020-03-12T19:45:29.084Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Functions/get": { - "modified": "2020-10-15T22:17:05.787Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Functions/rest_parameters": { - "modified": "2020-10-15T21:56:42.865Z", - "contributors": [ - "Kevin_Chen", - "jackblackevo", - "jsgao0" - ] - }, - "Web/JavaScript/Reference/Functions/set": { - "modified": "2020-10-15T22:17:33.994Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Global_Objects": { - "modified": "2020-03-12T19:38:39.590Z", - "contributors": [ - "tony8382", - "chialin", - "jackblackevo", - "jsgao0", - "cwlin0416", - "teoli", - "Sheppy" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array": { - "modified": "2020-10-15T21:31:26.717Z", - "contributors": [ - "hua-123", - "kyob1010", - "Aries0d0f", - "KevinHuang", - "k940545", - "jackblackevo", - "tswenja", - "kdex", - "petercpg", - "Kaiyeh", - "cwlin0416", - "oooooo", - "m80126colin", - "lizlux" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/@@iterator": { - "modified": "2020-10-15T22:02:20.291Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/Reduce": { - "modified": "2020-10-15T21:54:40.258Z", - "contributors": [ - "Ashe_Li", - "jackblackevo", - "iigmir", - "dwatow", - "yozian" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/concat": { - "modified": "2020-10-15T21:46:28.512Z", - "contributors": [ - "jackblackevo", - "tericky" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/copyWithin": { - "modified": "2020-10-15T22:01:15.329Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/entries": { - "modified": "2020-10-15T21:47:10.197Z", - "contributors": [ - "jackblackevo", - "tericky" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/every": { - "modified": "2020-10-15T21:56:41.781Z", - "contributors": [ - "jackblackevo", - "AkanishiChi", - "jsgao0" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/fill": { - "modified": "2020-10-15T21:56:41.165Z", - "contributors": [ - "jackblackevo", - "jsgao0" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/filter": { - "modified": "2020-10-15T21:38:35.707Z", - "contributors": [ - "Jenhaohsiao", - "jackblackevo", - "iigmir", - "jsgao0", - "alk03073135" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/find": { - "modified": "2020-10-15T21:42:27.701Z", - "contributors": [ - "jackblackevo", - "iigmir", - "ALiangLiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/findIndex": { - "modified": "2020-10-15T21:51:49.109Z", - "contributors": [ - "jackblackevo", - "tooto1985", - "auver", - "Snailpool" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/flat": { - "modified": "2020-10-15T22:11:38.333Z", - "contributors": [ - "SageX", - "Euphokumiko" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/forEach": { - "modified": "2020-10-15T21:46:18.574Z", - "contributors": [ - "jackblackevo", - "iigmir", - "wangqimeng", - "nt46", - "akari0624" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/from": { - "modified": "2020-10-15T21:52:49.849Z", - "contributors": [ - "qwer5656", - "jackblackevo", - "petercpg", - "tericky" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/includes": { - "modified": "2020-10-15T22:02:19.463Z", - "contributors": [ - "SiderealArt", - "sonelin09", - "xuan311", - "vaynewang", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/indexOf": { - "modified": "2020-10-15T21:56:48.783Z", - "contributors": [ - "jackblackevo", - "jsgao0" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/isArray": { - "modified": "2020-10-15T21:34:45.216Z", - "contributors": [ - "jackblackevo", - "tericky", - "m80126colin", - "JamesWen", - "onlinemad" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/join": { - "modified": "2020-10-15T21:47:08.883Z", - "contributors": [ - "jackblackevo", - "iigmir", - "JamesWen" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/keys": { - "modified": "2020-10-15T22:02:18.808Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf": { - "modified": "2020-10-15T22:02:16.799Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/length": { - "modified": "2020-10-15T21:58:21.627Z", - "contributors": [ - "tericky", - "yenchenglai0618", - "mybaseball52" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/map": { - "modified": "2020-10-15T21:53:08.025Z", - "contributors": [ - "iigmir", - "jackblackevo", - "jWorker", - "akari0624" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/of": { - "modified": "2020-10-15T22:01:03.622Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/pop": { - "modified": "2020-10-15T21:56:21.800Z", - "contributors": [ - "jackblackevo", - "yvonne6344" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/push": { - "modified": "2020-10-15T21:42:28.441Z", - "contributors": [ - "jackblackevo", - "yvonne6344", - "iigmir", - "ALiangLiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/reverse": { - "modified": "2020-10-15T21:31:21.385Z", - "contributors": [ - "jackblackevo", - "CYBAI" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/shift": { - "modified": "2020-10-15T21:50:12.873Z", - "contributors": [ - "jackblackevo", - "marktwtn" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/slice": { - "modified": "2020-10-15T22:00:48.969Z", - "contributors": [ - "rosa", - "pig3629", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/some": { - "modified": "2020-10-15T22:02:17.128Z", - "contributors": [ - "iigmir", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/sort": { - "modified": "2020-10-15T21:31:18.682Z", - "contributors": [ - "jackblackevo", - "CYBAI" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/splice": { - "modified": "2020-10-15T21:56:28.206Z", - "contributors": [ - "jackblackevo", - "jsgao0", - "Mars-Hung" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/unshift": { - "modified": "2020-10-15T21:50:29.110Z", - "contributors": [ - "jsgao0", - "jackblackevo", - "roycrxtw", - "marktwtn" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Array/values": { - "modified": "2020-10-15T22:02:17.406Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/ArrayBuffer": { - "modified": "2019-03-24T00:11:11.336Z", - "contributors": [ - "jackblackevo", - "teoli", - "Kennyluck" - ] - }, - "Web/JavaScript/Reference/Global_Objects/ArrayBuffer/prototype": { - "modified": "2019-03-23T22:31:10.924Z", - "contributors": [ - "teoli", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/AsyncFunction": { - "modified": "2020-10-15T22:18:02.118Z", - "contributors": [ - "gamerslouis" - ] - }, - "Web/JavaScript/Reference/Global_Objects/BigInt": { - "modified": "2020-10-15T22:17:57.888Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Boolean": { - "modified": "2019-03-23T22:06:45.293Z", - "contributors": [ - "jsgao0" - ] - }, - "Web/JavaScript/Reference/Global_Objects/DataView": { - "modified": "2019-03-23T22:31:20.723Z", - "contributors": [ - "edu1218", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Date": { - "modified": "2019-03-23T22:26:48.329Z", - "contributors": [ - "NoobTW", - "ddtet" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Date/UTC": { - "modified": "2019-03-23T22:26:04.734Z", - "contributors": [ - "ddtet" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Date/getDay": { - "modified": "2020-10-15T22:34:16.631Z", - "contributors": [ - "manny3" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Date/now": { - "modified": "2019-03-23T22:26:18.288Z", - "contributors": [ - "ddtet" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Date/prototype": { - "modified": "2019-03-23T22:26:36.902Z", - "contributors": [ - "ddtet" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Error": { - "modified": "2019-03-23T22:30:39.821Z", - "contributors": [ - "jsgao0", - "jackblackevo", - "josephmcasey" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Error/columnNumber": { - "modified": "2019-03-23T22:30:40.645Z", - "contributors": [ - "teoli", - "jerrychen1013" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Function": { - "modified": "2019-03-23T23:25:10.636Z", - "contributors": [ - "Calvin-Huang", - "jackblackevo", - "teoli", - "Bergi" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Function/apply": { - "modified": "2020-04-16T06:07:17.467Z", - "contributors": [ - "jacko1114", - "ayuha406645", - "Snailpool" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Function/bind": { - "modified": "2019-03-23T22:07:11.766Z", - "contributors": [ - "storyh66224", - "iigmir", - "nyngwang", - "aaaOOttOOaaa" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Function/call": { - "modified": "2019-03-23T23:25:00.404Z", - "contributors": [ - "jackblackevo", - "teoli", - "Zhen.Di-Lin" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Function/length": { - "modified": "2019-03-23T22:39:23.276Z", - "contributors": [ - "CYBAI", - "lessmind" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Function/prototype": { - "modified": "2019-03-23T22:30:13.335Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Infinity": { - "modified": "2020-10-15T21:47:39.391Z", - "contributors": [ - "iigmir", - "tooto1985", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/JSON": { - "modified": "2020-10-15T21:48:40.820Z", - "contributors": [ - "rolflo", - "iigmir", - "Ende93" - ] - }, - "Web/JavaScript/Reference/Global_Objects/JSON/parse": { - "modified": "2020-04-17T04:18:46.439Z", - "contributors": [ - "jacko1114", - "bigbitesaint", - "matthung0807", - "iigmir", - "kuolun" - ] - }, - "Web/JavaScript/Reference/Global_Objects/JSON/stringify": { - "modified": "2020-10-15T22:00:16.083Z", - "contributors": [ - "gyau97", - "SolomonKang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Map": { - "modified": "2020-10-15T21:51:34.887Z", - "contributors": [ - "othree", - "tainenko", - "jackblackevo", - "jsgao0" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Math": { - "modified": "2020-10-15T21:38:29.906Z", - "contributors": [ - "hmysjiang", - "jackblackevo", - "fscholz" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Math/abs": { - "modified": "2020-10-15T22:02:08.344Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Math/ceil": { - "modified": "2020-10-15T22:02:07.035Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Math/floor": { - "modified": "2020-10-15T22:02:06.863Z", - "contributors": [ - "ted31013", - "chochinlu", - "Hagen", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Math/max": { - "modified": "2020-10-15T22:03:35.771Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Math/pow": { - "modified": "2020-10-21T10:01:06.689Z", - "contributors": [ - "SvampK", - "iigmir" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Math/random": { - "modified": "2020-10-17T07:58:50.159Z", - "contributors": [ - "RocketSH" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Math/round": { - "modified": "2019-03-23T22:48:34.807Z", - "contributors": [ - "alk03073135" - ] - }, - "Web/JavaScript/Reference/Global_Objects/NaN": { - "modified": "2020-10-15T21:47:39.178Z", - "contributors": [ - "iigmir", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Number": { - "modified": "2019-03-23T22:28:21.747Z", - "contributors": [ - "jsgao0", - "sha1337" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Number/isFinite": { - "modified": "2020-10-15T22:03:26.099Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Number/isNaN": { - "modified": "2020-10-15T22:14:14.999Z", - "contributors": [ - "xguang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Number/prototype": { - "modified": "2020-10-15T21:56:46.161Z", - "contributors": [ - "jsgao0" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Number/toExponential": { - "modified": "2019-03-23T22:28:18.890Z", - "contributors": [ - "jsgao0", - "Shiyou" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Number/toFixed": { - "modified": "2020-11-18T05:27:56.696Z", - "contributors": [ - "Johnnychun", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object": { - "modified": "2020-08-22T05:49:39.644Z", - "contributors": [ - "+ono+", - "kuolun", - "jackblackevo", - "fscholz" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/assign": { - "modified": "2020-10-15T21:51:19.104Z", - "contributors": [ - "manny3", - "lmr3796", - "mitivic", - "BruceLi", - "septemhill", - "jsgao0" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/create": { - "modified": "2019-03-23T22:30:34.696Z", - "contributors": [ - "yuugou727", - "septemhill", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/defineProperties": { - "modified": "2019-03-23T22:18:00.161Z", - "contributors": [ - "septemhill" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/defineProperty": { - "modified": "2020-10-15T21:52:17.805Z", - "contributors": [ - "iigmir", - "PeterTing", - "btooom", - "jsgao0", - "septemhill" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/freeze": { - "modified": "2020-10-15T22:00:25.623Z", - "contributors": [ - "leowu" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf": { - "modified": "2019-03-23T22:44:35.153Z", - "contributors": [ - "Shiyou", - "alk03073135" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty": { - "modified": "2019-03-23T22:48:25.371Z", - "contributors": [ - "Shiyou", - "alk03073135" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/keys": { - "modified": "2019-03-23T22:30:46.813Z", - "contributors": [ - "yuugou727", - "roycrxtw", - "kdex", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/preventExtensions": { - "modified": "2019-03-23T22:39:57.504Z", - "contributors": [ - "ALiangLiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/proto": { - "modified": "2020-10-15T22:00:26.656Z", - "contributors": [ - "leowu" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Object/prototype": { - "modified": "2019-03-23T22:44:24.956Z", - "contributors": [ - "Shiyou", - "alk03073135" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Promise": { - "modified": "2020-10-15T21:50:59.376Z", - "contributors": [ - "iigmir", - "nyngwang", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Promise/all": { - "modified": "2020-10-15T21:51:02.408Z", - "contributors": [ - "nyngwang", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Promise/catch": { - "modified": "2020-10-15T21:51:02.070Z", - "contributors": [ - "nyngwang", - "Calvin-Huang", - "liuderchi", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Promise/finally": { - "modified": "2020-10-15T22:08:07.469Z", - "contributors": [ - "t7yang", - "l13013312333" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Promise/prototype": { - "modified": "2020-10-15T21:51:00.110Z", - "contributors": [ - "nyngwang", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Promise/race": { - "modified": "2020-10-15T21:51:03.822Z", - "contributors": [ - "james58899", - "nyngwang", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Promise/reject": { - "modified": "2020-10-15T21:56:03.979Z", - "contributors": [ - "nyngwang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Promise/resolve": { - "modified": "2020-10-15T21:56:02.943Z", - "contributors": [ - "nyngwang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Promise/then": { - "modified": "2020-10-15T21:51:00.608Z", - "contributors": [ - "nyngwang", - "jackblackevo", - "liuderchi" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Proxy": { - "modified": "2020-10-15T21:54:48.783Z", - "contributors": [ - "aChinKaiWu", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/RangeError": { - "modified": "2020-10-15T22:17:59.783Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Reflect": { - "modified": "2019-03-23T22:11:01.546Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/RegExp": { - "modified": "2020-10-15T22:28:47.846Z", - "contributors": [ - "政衛" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Set": { - "modified": "2020-10-15T22:04:11.196Z", - "contributors": [ - "manny3", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Set/add": { - "modified": "2020-10-15T22:17:57.665Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Set/clear": { - "modified": "2020-10-15T22:17:57.573Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Set/delete": { - "modified": "2020-10-15T22:17:57.330Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Set/entries": { - "modified": "2020-10-15T22:17:57.657Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Set/has": { - "modified": "2020-10-15T22:17:58.294Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/Set/values": { - "modified": "2020-10-15T22:18:02.187Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/String": { - "modified": "2020-10-15T21:28:07.530Z", - "contributors": [ - "wbamberg", - "jackblackevo", - "jsgao0", - "iigmir", - "teoli", - "fscholz" - ] - }, - "Web/JavaScript/Reference/Global_Objects/String/match": { - "modified": "2020-10-15T22:05:42.504Z", - "contributors": [ - "YF-Tung", - "joshra" - ] - }, - "Web/JavaScript/Reference/Global_Objects/String/padStart": { - "modified": "2019-03-23T22:19:32.101Z", - "contributors": [ - "teoli", - "lychee.tw" - ] - }, - "Web/JavaScript/Reference/Global_Objects/String/prototype": { - "modified": "2020-10-15T22:02:57.359Z", - "contributors": [ - "SphinxKnight", - "bine139488" - ] - }, - "Web/JavaScript/Reference/Global_Objects/String/replace": { - "modified": "2020-10-15T21:28:07.269Z", - "contributors": [ - "oooooo", - "joshra", - "imrobinized", - "iigmir", - "jackblackevo", - "teoli", - "shyangs" - ] - }, - "Web/JavaScript/Reference/Global_Objects/String/toLowerCase": { - "modified": "2020-10-15T22:21:28.664Z", - "contributors": [ - "goden.cheng" - ] - }, - "Web/JavaScript/Reference/Global_Objects/TypedArray": { - "modified": "2020-10-15T21:47:14.859Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/URIError": { - "modified": "2020-10-15T22:17:56.619Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Global_Objects/isNaN": { - "modified": "2020-10-15T21:51:29.113Z", - "contributors": [ - "bluetata", - "iigmir" - ] - }, - "Web/JavaScript/Reference/Global_Objects/null": { - "modified": "2020-03-12T19:44:24.320Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Global_Objects/parseInt": { - "modified": "2020-10-15T21:48:43.179Z", - "contributors": [ - "kcliu", - "DaiYaXu", - "iigmir", - "Shiyou" - ] - }, - "Web/JavaScript/Reference/Global_Objects/undefined": { - "modified": "2020-10-15T21:47:42.561Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Iteration_protocols": { - "modified": "2020-03-12T19:45:00.332Z", - "contributors": [ - "jackblackevo", - "nyngwang" - ] - }, - "Web/JavaScript/Reference/Lexical_grammar": { - "modified": "2020-10-15T22:00:27.351Z", - "contributors": [ - "leowu" - ] - }, - "Web/JavaScript/Reference/Operators": { - "modified": "2020-03-12T19:38:35.397Z", - "contributors": [ - "jackblackevo", - "cwlin0416", - "iigmir", - "teoli", - "Zhen.Di-Lin", - "ethertank" - ] - }, - "Web/JavaScript/Reference/Operators/Arithmetic_Operators": { - "modified": "2020-10-15T22:18:48.252Z", - "contributors": [ - "zivalee" - ] - }, - "Web/JavaScript/Reference/Operators/Bitwise_Operators": { - "modified": "2020-10-15T22:19:10.927Z", - "contributors": [ - "hmysjiang" - ] - }, - "Web/JavaScript/Reference/Operators/Comma_Operator": { - "modified": "2020-03-12T19:45:21.494Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Operators/Comparison_Operators": { - "modified": "2020-03-12T19:45:23.267Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Operators/Conditional_Operator": { - "modified": "2020-10-15T22:29:30.361Z", - "contributors": [ - "liaocCM" - ] - }, - "Web/JavaScript/Reference/Operators/Destructuring_assignment": { - "modified": "2020-10-15T21:51:08.444Z", - "contributors": [ - "DexterLeung", - "salagadoola", - "iigmir", - "jsgao0", - "jackblackevo", - "flyinglimao" - ] - }, - "Web/JavaScript/Reference/Operators/Logical_Operators": { - "modified": "2020-10-15T22:19:41.845Z", - "contributors": [ - "chunhh1012" - ] - }, - "Web/JavaScript/Reference/Operators/Object_initializer": { - "modified": "2020-03-12T19:46:20.319Z", - "contributors": [ - "cyanchu", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Operators/Operator_Precedence": { - "modified": "2020-03-12T19:45:00.937Z", - "contributors": [ - "KateWuSH", - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Operators/Optional_chaining": { - "modified": "2020-10-15T22:28:31.905Z", - "contributors": [ - "DexterLeung" - ] - }, - "Web/JavaScript/Reference/Operators/Spread_syntax": { - "modified": "2020-10-15T22:33:09.945Z", - "contributors": [ - "neko12377", - "kenchill" - ] - }, - "Web/JavaScript/Reference/Operators/async_function": { - "modified": "2020-10-15T22:12:38.986Z", - "contributors": [ - "extend1994" - ] - }, - "Web/JavaScript/Reference/Operators/await": { - "modified": "2020-03-12T19:45:41.284Z", - "contributors": [ - "kuolun", - "liuderchi", - "roycrxtw" - ] - }, - "Web/JavaScript/Reference/Operators/super": { - "modified": "2020-10-15T22:23:09.531Z", - "contributors": [ - "YunHan-Tsai" - ] - }, - "Web/JavaScript/Reference/Operators/this": { - "modified": "2020-10-15T21:48:46.137Z", - "contributors": [ - "iigmir", - "Rocker", - "chloewlin" - ] - }, - "Web/JavaScript/Reference/Operators/typeof": { - "modified": "2020-03-12T19:38:23.416Z", - "contributors": [ - "roycrxtw", - "jackblackevo", - "teoli", - "Johnny.Net" - ] - }, - "Web/JavaScript/Reference/Statements": { - "modified": "2020-10-15T21:22:18.510Z", - "contributors": [ - "simba-fs", - "Ethan.Lin", - "jackblackevo", - "stdio2017", - "cwlin0416", - "teoli", - "trevorh" - ] - }, - "Web/JavaScript/Reference/Statements/async_function": { - "modified": "2020-10-15T21:53:37.954Z", - "contributors": [ - "kevin10410", - "iigmir", - "weihanglo", - "liuderchi" - ] - }, - "Web/JavaScript/Reference/Statements/block": { - "modified": "2020-03-12T19:38:43.767Z", - "contributors": [ - "lin1987www", - "jackblackevo", - "teoli", - "irvinfly", - "tjjh89017" - ] - }, - "Web/JavaScript/Reference/Statements/break": { - "modified": "2020-10-15T21:25:32.531Z", - "contributors": [ - "jackblackevo", - "teoli", - "Littlebtc", - "tjjh89017" - ] - }, - "Web/JavaScript/Reference/Statements/const": { - "modified": "2020-10-15T21:58:04.721Z", - "contributors": [ - "iigmir", - "KevinHuang" - ] - }, - "Web/JavaScript/Reference/Statements/debugger": { - "modified": "2020-10-15T22:00:23.902Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Statements/export": { - "modified": "2020-10-15T21:54:04.868Z", - "contributors": [ - "wangchou", - "iigmir", - "DalaneGarmin", - "MOSapeizer" - ] - }, - "Web/JavaScript/Reference/Statements/for...in": { - "modified": "2020-03-12T19:39:20.179Z", - "contributors": [ - "jackblackevo", - "teoli", - "shyangs" - ] - }, - "Web/JavaScript/Reference/Statements/function*": { - "modified": "2020-10-15T21:45:50.090Z", - "contributors": [ - "iendeavor", - "jackblackevo", - "DaomingC", - "kdex", - "ALiangLiang", - "tom76kimo" - ] - }, - "Web/JavaScript/Reference/Statements/if...else": { - "modified": "2020-12-06T07:23:20.735Z", - "contributors": [ - "rei1997", - "paiyuliu", - "jackblackevo", - "willynpi" - ] - }, - "Web/JavaScript/Reference/Statements/import": { - "modified": "2020-10-15T21:53:11.297Z", - "contributors": [ - "iigmir", - "freddy50806", - "pololin", - "kweisamx", - "RichCharlie", - "DuckBreeder" - ] - }, - "Web/JavaScript/Reference/Statements/label": { - "modified": "2020-10-15T22:15:49.920Z", - "contributors": [ - "willh" - ] - }, - "Web/JavaScript/Reference/Statements/let": { - "modified": "2020-10-15T21:45:04.003Z", - "contributors": [ - "ShawnLin", - "Zhang-Junzhi", - "iigmir", - "zxa011023", - "YamiOdymel", - "ALiangLiang" - ] - }, - "Web/JavaScript/Reference/Statements/return": { - "modified": "2020-10-15T22:02:41.359Z", - "contributors": [ - "iigmir" - ] - }, - "Web/JavaScript/Reference/Statements/switch": { - "modified": "2020-10-15T22:25:04.906Z", - "contributors": [ - "iigmir", - "Lazine" - ] - }, - "Web/JavaScript/Reference/Statements/throw": { - "modified": "2020-03-12T19:45:24.946Z", - "contributors": [ - "jackblackevo" - ] - }, - "Web/JavaScript/Reference/Statements/var": { - "modified": "2020-03-12T19:38:31.590Z", - "contributors": [ - "jackblackevo", - "teoli", - "Johnny.Net" - ] - }, - "Web/JavaScript/Reference/Strict_mode": { - "modified": "2020-03-12T19:46:40.566Z", - "contributors": [ - "WellyHong", - "Aries0d0f", - "DarkNami", - "MOSapeizer" - ] - }, - "Web/JavaScript/Reference/Template_literals": { - "modified": "2020-10-15T21:53:17.228Z", - "contributors": [ - "jackblackevo", - "xsfishxs" - ] - }, - "Web/JavaScript/Shells": { - "modified": "2020-03-12T19:45:29.748Z", - "contributors": [ - "JianHuaHe" - ] - }, - "Web/JavaScript/Typed_arrays": { - "modified": "2020-03-12T19:36:15.816Z", - "contributors": [ - "ballfish", - "jackblackevo", - "roycrxtw", - "teoli", - "Kennyluck" - ] - }, - "Web/Manifest": { - "modified": "2020-11-18T03:32:37.890Z", - "contributors": [ - "SphinxKnight", - "wifr1126q", - "t7yang", - "BwayCer" - ] - }, - "Web/MathML": { - "modified": "2019-03-23T23:22:17.865Z", - "contributors": [ - "sailplaneTW" - ] - }, - "Web/MathML/Authoring": { - "modified": "2019-03-23T23:22:11.037Z", - "contributors": [ - "fred.wang", - "sailplaneTW" - ] - }, - "Web/Media": { - "modified": "2019-03-18T21:40:43.859Z", - "contributors": [ - "willynpi", - "learnfromfail" - ] - }, - "Web/Media/Formats": { - "modified": "2020-02-18T06:39:28.429Z", - "contributors": [ - "Sheppy" - ] - }, - "Web/Media/Formats/Containers": { - "modified": "2020-02-19T03:38:30.649Z", - "contributors": [ - "JamesGoler" - ] - }, - "Web/OpenSearch": { - "modified": "2019-03-23T22:00:23.747Z", - "contributors": [ - "jackblackevo", - "iigmir", - "teoli", - "Mgjbot", - "Sam268276", - "BobChao" - ] - }, - "Web/Progressive_web_apps": { - "modified": "2019-03-18T20:52:03.723Z", - "contributors": [ - "chrisdavidmills", - "iigmir" - ] - }, - "Web/Reference": { - "modified": "2019-03-23T23:29:16.937Z", - "contributors": [ - "jackblackevo", - "Somnlent", - "Sheppy" - ] - }, - "Web/Reference/API": { - "modified": "2019-03-23T23:05:52.036Z", - "contributors": [ - "jackblackevo", - "wildsky" - ] - }, - "Web/SVG": { - "modified": "2019-01-16T17:22:30.480Z", - "contributors": [ - "ethertank", - "happysadman" - ] - }, - "Web/SVG/Attribute": { - "modified": "2019-03-23T23:26:15.897Z", - "contributors": [ - "Jeremie" - ] - }, - "Web/SVG/Attribute/fill-rule": { - "modified": "2019-03-23T23:26:22.091Z", - "contributors": [ - "panallen" - ] - }, - "Web/SVG/Attribute/stroke-dashoffset": { - "modified": "2019-03-20T22:42:12.300Z", - "contributors": [ - "EnRico.Lam", - "bing-Guo" - ] - }, - "Web/SVG/Tutorial": { - "modified": "2019-03-23T23:35:01.636Z", - "contributors": [ - "Snailpool", - "sunghau", - "ethertank", - "ziyunfei", - "Dx.Yang" - ] - }, - "Web/SVG/Tutorial/Fills_and_Strokes": { - "modified": "2019-03-23T23:34:13.639Z", - "contributors": [ - "jackblackevo", - "ethertank", - "Dx.Yang" - ] - }, - "Web/SVG/Tutorial/Getting_Started": { - "modified": "2019-03-23T23:34:51.093Z", - "contributors": [ - "jackblackevo", - "Kustz", - "ethertank", - "Dx.Yang" - ] - }, - "Web/SVG/Tutorial/Gradients": { - "modified": "2019-03-23T23:34:17.990Z", - "contributors": [ - "jackblackevo", - "iigmir", - "ethertank", - "Dx.Yang" - ] - }, - "Web/SVG/Tutorial/Introduction": { - "modified": "2019-03-23T23:34:52.348Z", - "contributors": [ - "ethertank", - "Dx.Yang" - ] - }, - "Web/SVG/Tutorial/Patterns": { - "modified": "2019-03-23T23:34:09.915Z", - "contributors": [ - "jackblackevo", - "ethertank", - "Dx.Yang" - ] - }, - "Web/SVG/Tutorial/Positions": { - "modified": "2019-03-23T23:34:48.671Z", - "contributors": [ - "Kustz", - "ethertank", - "ziyunfei", - "Dx.Yang" - ] - }, - "Web/SVG/Tutorial/路径": { - "modified": "2019-05-06T13:50:22.523Z", - "contributors": [ - "Snailpool", - "ethertank", - "ziyunfei", - "Dx.Yang" - ] - }, - "Web/SVG/教學": { - "modified": "2019-01-16T14:42:54.040Z", - "contributors": [ - "ethertank", - "happysadman" - ] - }, - "Web/Security": { - "modified": "2019-09-10T16:50:03.503Z", - "contributors": [ - "SphinxKnight", - "jackblackevo" - ] - }, - "Web/Security/Insecure_passwords": { - "modified": "2019-03-20T14:57:01.510Z", - "contributors": [ - "BaseChipmunk4", - "iigmir", - "jwhitlock" - ] - }, - "Web/Security/Mixed_content": { - "modified": "2019-03-23T23:04:08.690Z", - "contributors": [ - "jackblackevo", - "iigmir", - "a780201", - "wildsky", - "Asheesh" - ] - }, - "Web/Security/Mixed_content/How_to_fix_website_with_mixed_content": { - "modified": "2019-03-23T23:04:13.940Z", - "contributors": [ - "jackblackevo", - "iigmir", - "wildsky" - ] - }, - "Web/Security/Same-origin_policy": { - "modified": "2020-09-01T23:06:58.364Z", - "contributors": [ - "JustBelieveMe", - "jackblackevo", - "MashKao", - "teoli", - "foxbrush" - ] - }, - "Web/Security/Weak_Signature_Algorithm": { - "modified": "2019-04-23T04:20:20.884Z", - "contributors": [ - "jackblackevo", - "15182254444", - "KINGKKALING", - "Sbabey", - "leVirve" - ] - }, - "Web/Tutorials": { - "modified": "2019-09-03T07:07:31.640Z", - "contributors": [ - "lalasoqTW", - "katsmin", - "mgrn", - "KevinHuang.lds", - "sailplaneTW" - ] - }, - "Web/性能": { - "modified": "2019-12-05T10:33:09.898Z", - "contributors": [ - "zhaoy88" - ] - }, - "WebAPI": { - "modified": "2019-03-23T23:28:55.141Z", - "contributors": [ - "wbamberg", - "fscholz", - "MashKao", - "sailplaneTW" - ] - }, - "WebAPI/Permissions": { - "modified": "2019-03-23T23:28:38.156Z", - "contributors": [ - "MashKao" - ] - }, - "WebAssembly": { - "modified": "2020-10-15T22:04:56.309Z", - "contributors": [ - "Aries0d0f" - ] - }, - "WebSockets": { - "modified": "2019-10-10T16:56:50.765Z", - "contributors": [ - "teoli", - "RudyLu", - "Kennyluck" - ] - }, - "WebSockets/WebSockets_reference": { - "modified": "2019-03-24T00:11:12.133Z", - "contributors": [ - "teoli", - "Kennyluck" - ] - }, - "WebSockets/WebSockets_reference/CloseEvent": { - "modified": "2019-03-24T00:11:09.722Z", - "contributors": [ - "teoli", - "Kennyluck" - ] - }, - "WebSockets/WebSockets_reference/MessageEvent": { - "modified": "2019-03-24T00:11:11.117Z", - "contributors": [ - "teoli", - "Kennyluck" - ] - }, - "WebSockets/WebSockets_reference/WebSocket": { - "modified": "2019-03-24T00:11:12.042Z", - "contributors": [ - "NoobTW", - "YamiOdymel", - "teoli", - "Kennyluck" - ] - }, - "WebSockets/Writing_WebSocket_client_applications": { - "modified": "2019-03-24T00:11:12.716Z", - "contributors": [ - "andretw", - "Shiyou", - "ziyunfei", - "Kennyluck" - ] - }, - "Web_development": { - "modified": "2019-01-16T13:10:01.650Z", - "contributors": [ - "teoli", - "Sonrisa" - ] - }, - "Web_開發": { - "modified": "2019-03-24T00:01:02.674Z", - "contributors": [ - "happysadman" - ] - }, - "Web_開發/Historical_artifacts_to_avoid": { - "modified": "2019-03-23T22:48:17.115Z", - "contributors": [ - "iigmir", - "CodinCat", - "irvinfly", - "slhuang" - ] - }, - "XHTML": { - "modified": "2019-03-24T00:01:02.785Z", - "contributors": [ - "ethertank", - "happysadman" - ] - }, - "XPCNativeWrapper": { - "modified": "2019-03-24T00:01:38.163Z", - "contributors": [ - "ethertank", - "Clydewu" - ] - }, - "zh-tw": { - "modified": "2019-01-16T13:51:15.538Z", - "contributors": [ - "CQD" - ] - }, - "參與_Mozilla_專案": { - "modified": "2019-03-24T00:01:01.475Z", - "contributors": [ - "happysadman" - ] - }, - "建立擴充套件": { - "modified": "2019-01-16T16:02:32.252Z", - "contributors": [ - "Josesun", - "Haka" - ] - } -} \ No newline at end of file diff --git a/files/zh-tw/archive/add-ons/developing_add-ons/index.html b/files/zh-tw/archive/add-ons/developing_add-ons/index.html deleted file mode 100644 index 048ba6dd7e..0000000000 --- a/files/zh-tw/archive/add-ons/developing_add-ons/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: 開發附加元件 -slug: Archive/Add-ons/Developing_add-ons -translation_of: Archive/Add-ons/Developing_add-ons ---- -

大多數的 Mozilla 所開發的軟件,主要是透過「附加元件」來擴充其工能。 「附加元件」主要分成三大類:「擴充套件(Extensions)」 、「外掛程式(Plugin-ins)」及「佈景主題(Themes)」。本文的主要目的,是去指導及提供你所需的資訊用來去製作 Firefox 、 Thunderbird ...等等的 Mozilla 的軟體上的「附加元件」,以及提交及發佈你所製作的「附加元件」的方法。

- - - - - - - - - - -
-

附加元件主題

-
-
-
- 提交附加元件至 AMO
-
- Provides helpful information for add-on developers to help them properly package and deliver their add-ons.  This includes information about addons.mozilla.org, Mozilla's add-on distribution web site.
-
- 擴充套件
-
- Extensions add new functionality to Mozilla applications such as Firefox, SeaMonkey and Thunderbird. They can add anything from a toolbar button to a completely new feature.
-
- 外掛程式
-
- Information about how to create plug-ins, which are binary components that let Mozilla based software display content they can't handle natively.
-
-
-
-
- 佈景主題
-
- Themes let users customize the appearance of the user interface presented by Mozilla-based applications.
-
- 搜尋引擎外掛
-
- Firefox supports search engine plug-ins, which enable the search box to support different search engines.
-
- Mozilla 平台
-
- Information about the Mozilla platform, including all of its APIs and technologies, as well as how to use them in your own projects.
-
-
-

 

diff --git a/files/zh-tw/archive/add-ons/index.html b/files/zh-tw/archive/add-ons/index.html deleted file mode 100644 index caac45ae4c..0000000000 --- a/files/zh-tw/archive/add-ons/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Add-ons -slug: Archive/Add-ons -translation_of: Archive/Add-ons ---- -

In progress. Archived add-ons documentation.

- -

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/archive/add-ons/supporting_search_suggestions_in_search_plugins/index.html b/files/zh-tw/archive/add-ons/supporting_search_suggestions_in_search_plugins/index.html deleted file mode 100644 index 451d3dc91c..0000000000 --- a/files/zh-tw/archive/add-ons/supporting_search_suggestions_in_search_plugins/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: 讓搜尋模組支援搜尋建議 -slug: Archive/Add-ons/Supporting_search_suggestions_in_search_plugins -tags: - - 搜尋模組 -translation_of: Archive/Add-ons/Supporting_search_suggestions_in_search_plugins ---- -

MozSearch 格式的搜尋模組可以支援搜尋建議,當使用者在搜尋欄中逐字鍵入關鍵詞時,Firefox 2 將依據搜尋模組內指定的 URL 送出查詢並取回結果。 -

取回結果之後,Firefox 將其顯示為一個下拉選單,讓使用者從中挑選搜尋引擎建議的關鍵詞。如果使用者繼續輸入關鍵詞,則會重新取回結果並更新選單。 -

Firefox 2 中內建的 Yahoo! 與 Google 搜尋模組都支援搜尋建議功能。 -

-

搜尋模組的工作

-

搜尋模組必須額外定義一個 <Url> 元素以便支援搜尋建議功能,此元素之 type 屬性需設定為 "application/x-suggestions+json"。支援搜尋建議功能的模組都會有兩個 <Url> 元素,另一個元素指定主要的 code>text/html</code> 搜尋 URL。 -

舉例來說,Yahoo! 搜尋模組的 <Url> 長得像這樣: -

-
<Url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchTerms}"/>
-
-

如果使用者在搜尋欄中輸入「fir」,則 Firefox 會將此 URL 的 {searchTerms} 代換為「fir」後送出搜尋: -

-
<Url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command=fir"/>
-
-

搜尋回來的結果將構成建議詞清單。 -

製作搜尋模組的方法可以參考製作 MozSearch 搜尋模組一文。 -

-

伺服器端的工作

-

搜尋建議功能的重點在伺服端的程式,如果你是網站設計師而想支援搜尋建議功能,則必須實做出依據搜尋字串給予進一步搜尋建議詞彙、並以 JSON 格式傳回的功能。 -

當瀏覽器想取回搜尋字串時,會對 <Url> 元素指定的 URL 送出 HTTP GET 要求;此時伺服器則需依據字串決定相關字詞為何,並以 JSON 傳回 2 到 4 個建議字詞,如下: -

-
查詢字串 -
JSON 的第一個元素是原始查詢字串,這樣 Firefox 可以得知傳回值是否與目前查閱的字詞相符。 -
-
建議字詞列表 -
建議字詞的陣列,此陣列需以「{{ mediawiki.external('」及「') }}」括起,例如 <tt>{{ mediawiki.external('\"建議詞 1\", \"建議詞 2\", \"建議詞 3\", \"建議詞 4\"') }}</tt> -
-
說明 -
此元素為選用,亦為一個陣列,分別針對每個「建議字詞列表」的建議詞設定說明,其中可以是任何搜尋引擎想提供瀏覽器顯示的資訊,例如此建議詞有多少搜尋結果等等。 -
-
Firefox 2 尚不支援「說明」功能,會忽略此傳回值。
-
查詢網址 -
此元素為選用,還是一個陣列,內容是各建議詞的替代網址。打個比方:如果除搜尋結果頁面之外還想直接提供建議詞的地圖連結,那就可以將地圖的網址列在此陣列裡。 -
-
若沒有額外指定此元素,則將依據搜尋模組 XML 中的 <Url> 元素決定查詢網址。 -
-
Firefox 2 尚不支援「查詢網址」功能,會忽略此傳回值。
-

也就是說,若搜尋詞為「fir」且不傳回說明及查詢網址,則傳回的 JSON 應該是長這樣: -

-
["fir", ["firefox", "first choice", "mozilla firefox"]]
-
-

在此範例中只涵括查詢字串及建議字詞列表兩元素,其他選用的都不列入。 -

雖然建議的字詞想放多少就可以放多少,但由於每次使用者多打一個字都會查詢一次,所以還是有所限度比較穩當。至於怎麼依據使用者的要求提出建議,就全交給你自己決定了。 -

{{ languages( { "ca": "ca/Implementaci\u00f3_de_suggeriments_en_els_connectors_de_cerca", "en": "en/Supporting_search_suggestions_in_search_plugins", "es": "es/Permitir_sugerencias_en_los_plugins_de_b\u00fasqueda", "fr": "fr/Gestion_de_suggestions_dans_les_plugins_de_recherche", "it": "it/Supportare_i_suggerimenti_nei_plugin_di_ricerca", "ja": "ja/Supporting_search_suggestions_in_search_plugins", "pl": "pl/Wsparcie_dla_podpowiedzi_wyszukiwania_w_wyszukiwarkach" } ) }} diff --git a/files/zh-tw/archive/add-ons/working_with_multiprocess_firefox/index.html b/files/zh-tw/archive/add-ons/working_with_multiprocess_firefox/index.html deleted file mode 100644 index 8b685c379e..0000000000 --- a/files/zh-tw/archive/add-ons/working_with_multiprocess_firefox/index.html +++ /dev/null @@ -1,235 +0,0 @@ ---- -title: Working with multiprocess Firefox -slug: Archive/Add-ons/Working_with_multiprocess_Firefox -translation_of: Archive/Add-ons/Working_with_multiprocess_Firefox ---- -
-

這篇文章提供給 Firefox 擴充套件開發者;文中概述了如何讓擴充套件可以執行於多行程的 Firefox.

-
-

在多行程的 Firefox 之前的版本, chrome code (including code inserted by extensions) 和 content 執行於同一作業系統行程中,所以擴充套件可以直接存取 content:

-
gBrowser.selectedBrowser.contentDocument.body.innerHTML = "replaced by chrome code";
-

然而,在多行程的 Firefox (也稱為 Electrolysis 或 E10S),套件的程式碼與 content 將執行於不同的行程中,因此不再可能直接地存取。

-

取而代之地, the extension will need to factor code that touches content into separate scripts that are called frame scripts. Frame scripts 執行在 content 行程,並可以直接存取 content. Frame scripts 藉由 message-passing API 和套件其餘的部份通訊。

-

當套件程式碼(執行於 chrome 行程中)向套件的 frame script(執行於 content 行程中) 傳訊時,必須使用非同步訊息。

-

content 行程允許向 chrome 行程傳遞同步或非同步訊息,但是,非同步通訊是較好的選擇。

-

For more details on using the message manager and content scripts, refer to the message manager guide. The rest of this article explains how to work out if you're affected or not, provides an overview of the sorts of changes that are needed, then walks through the process of porting some simple extension patterns so they work properly with multiprocess Firefox.

-

確認你是否受到相容性影響

-

As a rule:

- -

To know for sure, you need to test it, and setting that up is a two-step process:

- -

Now you'll be able to test your extension in multiprocess Firefox, with no compatibility shims. At the moment you can't actually install extensions in multiprocess Firefox, so you have to install the extension, then switch on multiprocess support. This is being tracked as bug 1055808.

-

Updating your code

-

The general approach to updating your code is:

- -

There are more details on this in the message manager documentation.

-

Backwards compatibility of the new APIs

-

With multiprocess support turned off, the e10s messaging APIs are still available and functional. They have been available in one form or another since Firefox 4; however, the original APIs are different than the current ones. Some known differences:

- -

You should test your changes not only in nightlies with multiprocess support turned on, but also in releases you intend to support with multiprocess support turned off.

-

Examples

-

This section walks through the process of porting a few different sorts of extension. The extensions are all extremely simple, and are intended to represent fundamental extension patterns that require different handling in multiprocess Firefox.

-

You can find all the source code for these examples in the e10s-example-addons GitHub repository.

-

Run a script in all pages

-
-

See the code for this example.

-
-

The first extension runs some code on every page load. The code doesn't need to interact with any other part of the extension: it just makes some predetermined modification to the page. In this case it adds a border to the document's body.

-

It does this by attaching to a XUL overlay a version of the "On page load" code snippet:

-
var myExtension = {
-    init: function() {
-        // The event can be DOMContentLoaded, pageshow, pagehide, load or unload.
-        if(gBrowser) gBrowser.addEventListener("DOMContentLoaded", this.onPageLoad, false);
-    },
-    onPageLoad: function(aEvent) {
-        var doc = aEvent.originalTarget; // doc is document that triggered the event
-        if (doc.nodeName != "#document") return; // only documents
-        // make whatever modifications you want to doc
-        doc.body.style.border = "5px solid blue";
-    }
-}
-
-window.addEventListener("load", function load(event){
-    window.removeEventListener("load", load, false); //remove listener, no longer needed
-    myExtension.init();
-},false);
-

Because this code accesses web content directly, it won't work in multiprocess Firefox.
-

-

Porting to the message manager

-

To port this example using the message manager, we can put all the meat of the add-on in a frame script:

-
// frame-script.js
-// will run in the content process
-
-addEventListener("DOMContentLoaded", function(event) {
-  var doc = event.originalTarget;
-  if (doc.nodeName != "#document") return; // only documents
-  doc.body.style.border = "5px solid red";
-});
-
-

We'll register a chrome:// URL for the frame script:

-
// chrome.manifest
-
-content    modify-all-pages    chrome/content/
-
-

The main script, that we attach to the XUL overlay, is just a stub that uses the global message manager to load the frame script into each tab:

-
// chrome script
-// will run in the chrome process
-
-var globalMM = Cc["@mozilla.org/globalmessagemanager;1"]
-  .getService(Ci.nsIMessageListenerManager);
-
-globalMM.loadFrameScript("chrome://modify-all-pages/content/frame-script.js", true);
-

-

Porting to the Add-on SDK

-

A good alternative for an extension like this is to port to the Add-on SDK. The Add-on SDK includes a module called page-mod which is designed to load scripts into web pages. The Add-on SDK calls these scripts content scripts.

-

In this case the main extension code creates a page-mod to load a content script into every page loaded by the user:

-
// main.js
-
-var pageMod = require("sdk/page-mod");
-var self = require("sdk/self");
-
-pageMod.PageMod({
-  include: "*",
-  contentScriptFile: self.data.url("modify-all-pages.js")
-});
-

The content script can modify the page directly:

-
// modify-all-pages.js - content script
-
-document.body.style.border = "5px solid green";
-

Run a script in the active tab

-
-

See the code for this example.

-
-

The example demonstrates how an extension can:

- -

The example is a restartless extension that adds a button using the CustomizableUI module. When the user clicks the button, the extension runs some code that modifies the current tab. The basic infrastructure is taken from the Australis "Hello World" extension written by Jorge Villalobos.
-
- What the code actually does is: find any <img> elements and replace their src with a link to a silly GIF randomly chosen from a list hardcoded into the extension. The silly gifs are taken from the list in the Whimsy extension.

-

The first version accesses the page directly, so it's not multiprocess compatible:

-
// bootstrap.js
-
-let Gifinate = {
-  init : function() {
-    let io =
-      Cc["@mozilla.org/network/io-service;1"].
-        getService(Ci.nsIIOService);
-
-    // the 'style' directive isn't supported in chrome.manifest for bootstrapped
-    // extensions, so this is the manual way of doing the same.
-    this._ss =
-      Cc["@mozilla.org/content/style-sheet-service;1"].
-        getService(Ci.nsIStyleSheetService);
-    this._uri = io.newURI("chrome://gifinate/skin/toolbar.css", null, null);
-    this._ss.loadAndRegisterSheet(this._uri, this._ss.USER_SHEET);
-
-    // create widget and add it to the main toolbar.
-    CustomizableUI.createWidget(
-      { id : "gifinate-button",
-        defaultArea : CustomizableUI.AREA_NAVBAR,
-        label : "Gifinate",
-        tooltiptext : "Gifinate!",
-        onCommand : function(aEvent) {
-          Gifinate.replaceImages(aEvent.target.ownerDocument.defaultView.content.document);
-        }
-      });
-  },
-
-  replaceImages : function(contentDocument) {
-      let images = contentDocument.getElementsByTagName("img");
-      for (var i = 0; i < images.length; ++i) {
-        let gif = this.gifs[Math.floor(Math.random() * this.gifs.length)];
-        images[i].src = gif;
-      }
-    },
-

-

Porting to the message manager

-

To port this example to the message manager we'll make onCommand load a frame script into the current <browser>, then listen for "request-gifs" messages from the frame script. The "request-gifs" message is expected to contain the number of GIFs we need for this page: the message listener retrieves and returns that many GIFs.

-
// bootstrap.js
-// will run in the chrome process
-
-let Gifinate = {
-  init : function() {
-    let io =
-      Cc["@mozilla.org/network/io-service;1"].
-        getService(Ci.nsIIOService);
-
-    // the 'style' directive isn't supported in chrome.manifest for bootstrapped
-    // extensions, so this is the manual way of doing the same.
-    this._ss =
-      Cc["@mozilla.org/content/style-sheet-service;1"].
-        getService(Ci.nsIStyleSheetService);
-    this._uri = io.newURI("chrome://gifinate/skin/toolbar.css", null, null);
-    this._ss.loadAndRegisterSheet(this._uri, this._ss.USER_SHEET);
-
-    // create widget and add it to the main toolbar.
-    CustomizableUI.createWidget(
-      { id : "gifinate-button",
-        defaultArea : CustomizableUI.AREA_NAVBAR,
-        label : "Gifinate Button",
-        tooltiptext : "Gifinate!",
-        onCommand : function(aEvent) {
-          Gifinate.replaceImages(aEvent.target.ownerDocument);
-        }
-      });
-  },
-
-  replaceImages : function(xulDocument) {
-    var browserMM = xulDocument.defaultView.gBrowser.selectedBrowser.messageManager;
-    browserMM.loadFrameScript("chrome://gifinate/content/frame-script.js", false);
-    browserMM.addMessageListener("request-gifs", Gifinate.getGifs);
-  },
-
-  getGifs : function(message) {
-    var gifsToReturn = new Array(message.data);
-    for (var i = 0; i < gifsToReturn.length; i++) {
-      let gif = this.gifs[Math.floor(Math.random() * this.gifs.length)];
-      gifsToReturn[i] = gif;
-    }
-    return gifsToReturn;
-  },
-
-

Again, we need to register a chrome:// URL for the frame script:

-
// chrome.manifest
-
-content gifinate frame-script.js
-

In the frame script, we get all the <img> elements and send the "request-gifs" message to the main add-on code. Because this is a frame script we can make it a synchronous message, and update the src attributes with the value it returns:

-
// frame-script.js
-// will run in the content process
-
-var images = content.document.getElementsByTagName("img");
-var response = sendSyncMessage("request-gifs", images.length);
-var gifs = response[0];
-
-for (var i = 0; i < images.length; ++i) {
-  images[i].src = gifs[i];
-}
-

The overall flow of the add-on now looks like this:
-

-

Known bugs

-

This is a list of open bugs likely to affect add-on developers migrating to multiprocess Firefox:

- diff --git a/files/zh-tw/archive/apps/advanced_topics/index.html b/files/zh-tw/archive/apps/advanced_topics/index.html deleted file mode 100644 index 1c0c5a0820..0000000000 --- a/files/zh-tw/archive/apps/advanced_topics/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: 進階主題 -slug: Archive/Apps/Advanced_topics -translation_of: Archive/Apps/Advanced_topics ---- -

這些文章提供了額外的資訊,關於更進階的開放網頁程式主題。

-
-
-

Apps 架構文件

-
-
- 應用程式的架構
-
- 大致介紹開放網頁程式計畫的設計和實作之下的架構。
-
- 在不同平台安裝 app 的細節
-
- 有關應用程式在特定裝置或系統上安裝或執行時有些微的差異;這篇文章會幫您了解這段差異。
-
- Android上的開放網路應用程式
-
- 有關開發及測試在Android上運作的開放網路應用程式的事。
-
- App runtime release notes
-
- 不同的平台上,網頁 app 執行時的 release notes。
-
-

其他文件

-
-
- 建立商店
-
- 如果您要建立自己的商店來販售及發佈開放網頁程式,這些資訊可能可以幫助您。
-
-

View All...

-
-
-
Tools for app developers
- -
Technology reference documentation
- -
Getting help from the community
-

If you still aren't sure how to do what you're trying to get done, feel free to join the conversation!

- -

Don't forget about the netiquette...

-
-
-

 

diff --git a/files/zh-tw/archive/apps/index.html b/files/zh-tw/archive/apps/index.html deleted file mode 100644 index 89e9dac3d6..0000000000 --- a/files/zh-tw/archive/apps/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Apps -slug: Archive/Apps -translation_of: Archive/Apps ---- -

In progress. This page includes archived content for Apps, including obsolete web app content, Firefox OS app-related content, etc.

- -

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/contacts/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/contacts/index.html deleted file mode 100644 index 431f85c5f6..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/contacts/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: 聯絡人資訊 -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/Contacts ---- -

聯絡人資訊 (contacts)

-

Contacts API 讓您可以取得使用者手機中所儲存的聯絡人列表、聯絡人姓名、電話、… 等資訊。
- 由於它牽涉到使用者私密資訊,目前僅開放審查通過的應用(privileged/certified)能夠使用這個 API。您的應用必須提出使用這個 API 的聲明,並且通過審查方可使用。
-
- 權限宣告:分為 "readonly", "readwrite", "readcreate" 三種級別,分別代表「只讀取」、「讀取與修改」、「讀取與新增」。您可依照應用需求作適當的權限宣告。

-
"permissions": {
-  "contacts":{ "access": "readonly" }
-}
-

1. 讀取聯絡人列表

-
    var options = {
-      sortBy: 'familyName',
-      sortOrder: 'ascending'
-    };
-    var request = navigator.mozContacts.find(options);
-    request.onsuccess = function findSuccess() {
-      var firstContact = request.result[0];
-      console.log('name' + firstContact.name);
-      console.log('tel number' + firstContact.tel[0].value);
-      console.log('update time' + new Date(firstContact.updated));
-    };
-
-    request.onerror = function findError() {
-      console.warn('Error: cannot find any contacts - ' + request.error.name);
-    };
-

2. 新增聯絡人

-
    var myContact = {
-      'name': 'Alice Wang',
-      'givenName': 'Alice',
-      'familyName': 'Wang',
-      'tel': [{'value': '0912345678'}]
-    };
-    var contact = new mozContact();
-    contact.init(myContact);
-    var request = navigator.mozContacts.save(contact);
-    request.onerror = function onerror() {
-      console.warn('Error: save contact - ' + request.error.name);
-    }; 
-

3. 修改聯絡人資訊

-
    var options = {
-      filterBy: ['tel', 'givenName', 'familyName'],
-      filterOp: 'contains',
-      filterValue: 'Alice'
-    };
-    var request = navigator.mozContacts.find(options);
-    request.onsuccess = function findSuccess() {
-      var contact = req.result[0];
-      contact.tel[0].value = '0987654321';
-      var requestUpdate = navigator.mozContacts.save(contact);
-      requestUpdate.onerror = function onerror() {
-        console.warn('Error: update contact - ' + requestUpdate.error.name);
-      };
-    }; 
-

4. 刪除聯絡人

-
    var options = {
-      filterBy: ['id'],
-      filterOp: 'equals',
-      filterValue: '0987654321'
-    };
-    var request = navigator.mozContacts.find(options);
-    request.onsuccess = function findSuccess() {
-      var contact = req.result[0];
-      var requestRemove = navigator.mozContacts.remove(contact);
-      requestRemove.onerror = function onerror() {
-        console.warn('Error: remove contact - ' + requestRemove.error.name);
-      };
-    }; 
-

 

diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/device_storage/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/device_storage/index.html deleted file mode 100644 index d8c6fd2916..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/device_storage/index.html +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: 儲存裝置資訊 -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/Device_Storage ---- -

儲存裝置資訊 (Device Storage)

-

DeviceStorage API 提供 SD 記憶卡內的資料存取介面,可讀取圖片檔、聲音檔、影片檔,與 SD 記憶卡的其他檔案,並檢視 SD 記憶卡空間的使用率。
- 由於牽涉到使用者的儲存裝置資訊,目前僅開放 Privileged/Certified App 能夠使用此 API。你的 App 必須提出「使用此 API」的聲明,並且通過審查方可使用。
-
- 權限宣告:依照檔案類型 (圖片、影片、聲音、其他) 而有不同宣告方式,這種宣告另分為「readonly」、「readwrite」、「readcreate」共 3 種級別,分別代表「唯讀」、「讀取與修改」、「讀取與創建」。你可依照 App 需求作適當的權限宣告。

-
"permissions": {
-  "device-storage:pictures": { "access": "readonly" },
-  "device-storage:music": { "access": "readcreate" },
-  "device-storage:videos": { "access": "readwrite" },
-  "device-storage:sdcard": { "access": "readonly" }
-}
-

1. 音樂檔案列表

- -
    var type = 'music';
-    var deviceStorage = navigator.getDeviceStorage(type);
-    if (!deviceStorage) {
-      console.warn('Error: cannot get DeviceStorage for ' + type);
-      return;
-    }
-    var request = deviceStorage.enumerate();
-    request.onsuccess = function(e) {
-      var file = request.result;
-      console.log('file name ' + file.name);
-      console.log('file size ' + file.size);
-      console.log('file type ' + file.type);
-      console.log('file last Modified Date ' + file.lastModifiedDate);
-      request.continue();
-    };
-    request.onerror = function() {
-      console.warn('Error: cannot list files in SD card - ' + request.error.name);
-    };
-

2. 讀取某個 SD 卡檔案

- -
    var type = 'pictures';
-    var deviceStorage = navigator.getDeviceStorage(type);
-    if (!deviceStorage) {
-      console.warn('Error: cannot get DeviceStorage for ' + type);
-      return;
-    }
-    var filename = 'downloads/DSC02798.JPG';
-    var request = deviceStorage.get(filename);
-    request.onsuccess = function(e) {
-      var file = request.result;
-      var url = URL.createObjectURL(file);
-      var myImage = document.getElementById('profilePhoto');
-      myImage.src = url;
-    };
-    request.onerror = function() {
-      console.warn('Error: get file from SD card - ' + request.error.name);
-    };
-

3. 寫入檔案到 SD 卡

- -
    var type = 'sdcard';
-    var deviceStorage = navigator.getDeviceStorage(type);
-    if (!deviceStorage) {
-      console.warn('Error: cannot get DeviceStorage for ' + type);
-      return;
-    }
-    var filename = 'test-' + Math.random().toString() + '.txt';
-    var pathname = 'test-tmp/' + filename;
-    console.log('file path: ' + pathname);
-    var blob = new Blob(['hello', 'world'], {type: 'text/plain'});
-    var request = deviceStorage.addNamed(blob, pathname);
-    request.onsuccess = function(e) {
-     // try to get the file
-      var readRequest = deviceStorage.get(pathname);
-      readRequest.onsuccess = function() {
-        var file = readRequest.result;
-        var reader = new FileReader();
-        reader.onload = function(e) {
-          console.log('file content ' + e.target.result);
-        };
-        reader.readAsText(file);
-      };
-      readRequest.onerror = function() {
-        console.warn("Error: read file failure - " + request.error.name);
-      };
-    };
-    request.onerror = function() {
-      console.warn('Error: write file failure - ' + request.error.name);
-    };
-

4. SD 卡空間使用率

- -
    var type = 'sdcard';
-    var deviceStorage = navigator.getDeviceStorage(type);
-    if (!deviceStorage) {
-      console.warn('Error: cannot get DeviceStorage for ' + type);
-      return;
-    }
-    var request = deviceStorage.stat();
-    request.onsuccess = function(e) {
-      var totalSize = e.target.result.totalBytes;
-      var freeBytes = e.target.result.freeBytes;
-      console.log('totalSize ' + totalSize + ', freeBytes ' + freeBytes);
-    };
-    request.onerror = function() {
-      console.warn('Error: cannot get stat of SD card - ' + request.error.name);
-    };
-

 

diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/geolocation/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/geolocation/index.html deleted file mode 100644 index 575d719313..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/geolocation/index.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 位置資訊 -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/Geolocation ---- -

位置資訊 (geolocation)

-

Geolocation API 讓您可以取得使用者目前所在的地理位置資訊,雖然現今它已是一個 Web 開放標準的 API,但在 Firefox OS 中您必須做權限宣告才可使用。
- 但當您使用這個 API 企圖存取使用者位置時,系統會出現一個視窗詢問使用者是否願意透露位置訊息給您的應用,並且提供一個默認選項記住使用者的選擇。
-
- 權限宣告:需要

-
"permissions": {
-  "geolocation": {}
-}
-

範例:

-
navigator.geolocation.getCurrentPosition(function(position) {
-  console.log('latitude ' + position.coords.latitude);
-  console.log('longitude ' + position.coords.longitude);
-}, function() {
-  console.warn('Error: cannot fetch location');
-});
-
diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/index.html deleted file mode 100644 index d258c076d5..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/index.html +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: 第三方應用開發者指南 -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide ---- -

基本章節

-

快速入門

-

API 說明

- -

其他技術細節

- -

除錯與預覽

- -

測試

- -

應用上架

- -

進階章節

-

樣式參考與範本

- -

調校技巧

- -

Gaia 系統應用 (System App) 細節

- -

其他 Open Web 技術

- diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/web_activity/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/web_activity/index.html deleted file mode 100644 index 8b9e1e52ad..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/web_activity/index.html +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: Web Activity -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/Web_Activity ---- -

Web Activity

-

許多手機上常見的功能例如:選取聯絡人、撥打電話、照相是您的 App 會需要用到的功能。您可以不必重新發明輪子,而利用「Web Activity」的技術呼叫其他的 App 來完成任務。Web Activity 可以實作兩個 App 間的切換,例如從「相機」切換到「圖片集」,或者是「簡訊」使用「聯絡人」選取一個簡訊發送對象。
-
- 在您的 App 中只需要描述所需的操作,系統會幫您檢查手機中有哪些 App 提供這些操作。以下是一個具體的例子。這是在「相機」中的一段程式碼,用來切換到別的 App 瀏覽相片。

-
  var act = new MozActivity({
-    name: 'browse',
-    data: {
-      type: 'photos'
-    }
-  });
-  act.onerror = function(e) {
-    if (act.error.name === 'NO_PROVIDER') {
-      console.warn('Error: no activity provider');
-    }
-    else {
-      console.warn('Error: unknown activity - ' + act.error.name);
-    }
-  };
-

在這段程式碼中,「相機」新增了一個 MozActivity 物件並在參數物件中聲明該 activity 是「瀏覽(browse)」的動作,瀏覽的資料是「相片(photos)」。請注意它並非直接指定要切換到「圖片集」 ,而是由系統決定哪個 App 提供這樣的行為,若有多個 App 同時提供一樣的行為時,系統會產生一個選單讓使用者選取。
- 參數物件的 'data' 欄位可以提供額外所需的資料內容,讓承接 activity 任務的 App 決定是否根據資料內容做其他處理。
-
- 讓我們來看看提供 Web Activity 的 App 該如何聲明它的 activity 及相關設定。

-
"activities": {
-  "browse": {
-    "filters": {
-      "type": "photos"
-     },
-    "disposition": "window"
-  }
-}
-


- 像「圖片集」這樣的 App 可以在它的 manifest.webapp 檔案中聲明它提供瀏覽相片的 activity,如上所示。它提供一個「瀏覽(browse)」動作的 activity,瀏覽的資料是「相片(photos)」作為篩選條件。這樣的 activity 聲明宣告,便能與上面的 MozActivity 呼叫匹配,成為能承接這個 activity 的對象之一。若手機中只有這一個 App 有這樣的 activity 宣告,那系統預設就會將這個 App 開啓,但若有多個 App 都能夠執行這個任務,系統會產生一個選單讓使用者選取。

-

"disposition": "window"

-

依照不同 App 的需求,目前在 Firefox OS 中有兩種形式的 Web Activity ,一種為「視窗切換」(window disposition) 、一種為「畫面滑入」(inline disposition)。前者視覺上是 App 之間的切換,後者則是承接 activity 的 App 會由下方滑入,覆蓋在目前 App 之上。除了視覺上的效果不同之外,「畫面滑入」的 Web Activity 在 activity 處理結束畫面關閉之後(例如選擇了一張圖片),會回到原本的 App ,而「視窗切換」的 Web Activity 則需要使用者自己手動回到主畫面 (homescreen) 或者 App 列表,才能夠切換回原本的 App 。提供 Web Activity 的 App 可以自行決定提供哪種形式讓其他 App 呼叫。
-
- 除了在 manifest.webapp 宣告 Web Activity 之外,程式碼中當然也要有具體的實作。如下所示是「圖片集」 App 的實作程式碼:

-
  navigator.mozSetMessageHandler('activity', function activityHandler(a) {
-    var activityName = a.source.name;
-    if ( activityName === 'browse') {
-      // If this was a cold start, then the db needs to be initialized.
-      if (!photodb)
-        initDB(true);  // Initialize both the photo and video databases
-      // Always switch to the list of thumbnails.
-      setView(thumbnailListView);
-    }
-  });
-
-

當有 MozActivity 的呼叫發生時,會以系統訊息的方式通知將要被開啓的 App 。因此這個 App 必須要註冊 'activity' 的系統訊息,提供對應的回呼函示 (callback function),明白表示當 MozActivity 的呼叫發生時, App 被開啓後將如何處理這個 activity。這邊「圖片集」 App 執行初始化圖庫、以縮圖方式列出圖庫內的相片。
- 「圖片集」 App 在 manifest.webapp 的聲明中使用 window disposition 的方式處理 activity,表示使用者並不會在完成什麼動作之後回到「相機」 App 。「圖片集」 App 就如同是被使用者手動在主畫面(homescreen)點選開啟一般,由使用者自行決定何時離開。

-

"disposition": "inline"

-

我們來看另一種形式的  Web Activity。同樣以「圖片集」 App 為例,它可以提供一個  Web Activity 供其他 App 挑選照片。挑選照片的 actvity 必須要把被挑選到的相片名稱、路徑…等等的資訊傳回給呼叫方(caller),並且在挑選動作完成後回到呼叫方的 App 。這個情況下,使用 inline disposition 的形式來實作。
- manifest.webapp 的宣告是這樣的:

-
"activities": {
-  "pick": {
-    "filters": {
-      "type": ["image/jpeg", "image/png"]
-    },
-    "disposition": "inline",
-    "returnValue": true,
-    "href": "/index.html#pick"
-  }
-}
-


- 它提供一個「挑選(pick)」動作的 activity,挑選的資料形態以一個陣列作為篩選條件,提供挑選 "image/jpeg" 或 "image/png" 圖檔,並且會回傳挑選的值。
- 由於 inline disposition 的 Web Activity 是以單一畫面滑入的形式被開啓,不同於 window disposition 是整個 App 被開啓,這裡我們可以多指派一個聲明表示要處理這個  Web Activity 的頁面位置 ("href": "/index.html#pick")。
-
- 這個頁面會有具體的程式碼實作如下:

-
  navigator.mozSetMessageHandler('activity', function activityHandler(activityRequest) {
-    var activityName = activityRequest.source.name;
-    if (activityName === 'pick') {
-      var pickType = activityRequest.source.data.type;
-      var width = activityRequest.source.data.width;
-      var height = activityRequest.source.data.height;
-      var blob = startPick(pickType, width, height);
-      if (blob) {
-        activityRequest.postResult({type: pickType, blob: blob});
-      } else {
-        activityRequest.postError('pick cancelled');
-      }
-    }
-  });
-


- 當有 MozActivity 的呼叫發生時,「圖片集」 App 收到 'activity' 的系統訊息,回呼函示 (callback function)會被運行,它可以讀取請求此 activity 的 App 所提供的數據,例如所需的圖片類型、寬度、高度… 等,作為陳列圖片清單的參考。當使用者成功選取了一張圖片,呼叫 activityRequest.postResult 傳回挑選結果。這個結果是個物件,讓呼叫 MozActivity 的 App 能夠知道圖片相關的資訊。
-
- 在「設定」 App 中希望能讓使用者選取一張圖片做為桌布,只需要呼叫 activity 來完成。

-
  var activityRequest = new MozActivity({
-     name: 'pick',
-     data: {
-        type: 'image/jpeg',
-        width: 320,
-        height: 480
-      }
-  });
-  activityRequest.onsuccess = function onPickSuccess() {
-    if (!activityRequest.result.blob)
-      return;
-
-    var reader = new FileReader();
-    reader.readAsDataURL(activityRequest.result.blob);
-    reader.onload = function() {
-       navigator.mozSettings.createLock().set({
-          'wallpaper.image': reader.result
-       });
-       displayImgae(reader.result);
-    };
-  };
-  activityRequest.onerror = function onPickError() {
-     console.warn('pick failed!');
-  };
-
-

在這段程式碼中,「設定」呼叫了一個 MozActivity 並在參數物件中聲明該 activity 是「挑選(pick)」的動作,挑選的是「image/jpeg」檔案,限定寬度與高度為 320 x 480。同樣的,「設定」 App 不知道實際上哪個 App 會被呼叫,它只在意當挑選動作完成時,它的 onsuccess 回呼函示會被執行,取得 blob 內容,並且畫面焦點將回到它身上,讓它可以顯示選取的圖片。系統將決定哪個 App 提供這樣的行為,若有多個 App 同時提供一樣的行為時,系統會產生一個選單讓使用者選取。
-  

diff --git "a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/\345\260\201\345\214\205\345\274\217_(packaged)_app/index.html" "b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/\345\260\201\345\214\205\345\274\217_(packaged)_app/index.html" deleted file mode 100644 index 80a905ab88..0000000000 --- "a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/\345\260\201\345\214\205\345\274\217_(packaged)_app/index.html" +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: 封包式 (Packaged) App -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/封包式_(Packaged)_App ---- -
-

原文出處:https://marketplace.firefox.com/developers/docs/packaged

-
-

封包式 (Packaged) App 屬於 Open Web App,即以 ZIP 壓縮檔納入其 HTML、CSS、JavaScript、app manifest 等所有資源;取代「將資源置於 Web 伺服器之上」的方式。封包式 App 的 ZIP 壓縮檔另將 app manifest 置於其根目錄之下,且此 manifest 檔案必須命名為 manifest.webapp。

-
-

注意:截至 2013 年 1 月為止,Firefox Marketplace 上所提供的封包式 App 限定為 Firefox OS App。

-
-

 

-

封包式 App 之用途

-

若 App 會存取裝置上的 Sensitive API,則最好能透過封包式 App 而達到安全性的需求。App 均必須經過上架商城 (如 Firefox OS Marketplace) 認證方可販售。這些商城將審核 App,確認其是否可行,再以其自有金鑰完成加密簽核。再審核過安全性、隱私性、功能性等的可能問題之後,可為 App 的使用者更多添一份保障。

-

 

-

封包式 App 的類型

-

封包式 App 可分為 3 類:

-

Privileged app

-

Privileged App 是由 Firefox OS Marketplace 以特殊程序核准之後發出。如果任一 App 要存取裝置上的特定 Sensitive API,則可為使用者提供更高的安全性。此種 App 即等同 iOS 或 Android 平台上的 Native App,並具備下列特性:

- -
"default-src *; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'"
- -

Certified app

-

Certified App 將用於重要的系統功能,如智慧型手機上預設的撥號鍵盤,或系統設定用 App;當然亦可用於 Firefox OS 手機上的重要功能。Certified App 並不會用於第三方 App,所以大多數的 App 開發人員可略過此類 App 不管。除了所有的裝置許可均為隱式許可 (Implicit permission,意即不需要外部的使用者許可) 之外,Certified App 與 Privileged App 大部分均屬於相似的封包式 App。而 Certified App 必須取得 OEM 裝置或電信服務供應商裝置的許可,才能讓此隱式 App 使用重要 API。下列即為 Certified App 的 CSP (與 Privileged App 的 CSP 略有不同):

-
"default-src *; script-src 'self'; object-src 'none'; style-src 'self'"
-

若與 Certified App 相較,Privileged App 則針對 inline CSP 的影響而稍微放寬了限制。進一步了解其原因,可參閱預設 CSPBug 768029

-

Plain packaged app

-

當然也可讓一般 App 封裝為 ZIP 壓縮檔。在 Marketplace 簽署之後,並不會執行如 Privileged/Certified App 所需的特殊授權程序。且 Plain Packaged App 並不會使用特定的 Sensitive Web API;同時也不屬於 Privileged/Certified App 所用 CSP 管轄所及。

-

 

-

與托管式 (Hosted) App 的差異

-

封包式 App 的功能,其實與一般網站型態的 Open Web App (即所謂托管式 Hosted App) 功能相同。但封包式 App 的差異在於:

- -
app://550e8400-e29b-41d4-a716-446655440000/index.html
- -

與一般的托管式 App 相同,封包式 App 仍可存取 Web 伺服器上的資料庫。

-

 

-

使用 Sensitive Web API

-

現在有許多惡意 Web API,因此應謹慎存取 Web API。針對 App 所要存取的所有 Sensitive API,你應該在 manifest 檔案permissions 欄位中新增輸入項。

-

一般托管式 App 亦可存取某些 Sensitive API,但其他 API 就限定封包式 (Privileged 或 Certified) App 才可存取。可參閱 App 許可找到相關需求的表格。

-

 

-

封包式 App Firefox Marketplace

-

與托管式 App 相較,Firefox Marketplace 處理封包式 App 的方式較為不同。一旦提交自己的封包式 App 之後,其 ZIP 壓縮檔即儲存於 Marketplace 的伺服器上,且 Marketplace 隨即根據該 ZIP 壓縮檔中的 manifest 檔案,產生新的 manifest 檔案並命名為「mini-manifest」。只要使用者想安裝此 App,就會將 mini-manifest 檔案傳送至 installPackage() 函式以安裝該 App。此 mini-manifest 檔案僅用於安裝與更新作業,與 App 的執行作業無關。

-

 

-

測試封包式 App 的安裝作業

-

透過 Firefox OS 模擬器 (Firefox OS Simulator),即可輕鬆安裝封包式 App。目前 Firefox OS 模擬器亦針對各個平台而提供 WindowsOSXLinux 等不同版本。

-

安裝模擬器時,將於 Firefox 的「網頁開發者 (Web Developer)」功能表中新增「Firefox OS Simulator」項目。在開啟附加元件之後,即可透過「Add Directory」而指定本端 webapp.manifest 檔案的位置。模擬器另可將該 App 封包 (即壓縮該資料夾),再透過剛封包完畢的 App 開啟模擬器。

-

針對 Linux 與 Windows 的使用者,還需要其他步驟才能設定 Android Debug Bridge (adb),以溝通實際裝置。請參閱步驟 3:設定系統以偵測自己的裝置

-

在實際裝置上,可點選 Settings > Device Information > More Information > Developer > Remote Debugging,進而啟動遠端除錯功能。

-

任何時間點均可連上受支援的裝置。一旦連上裝置,模擬器即可偵測並顯示所接上的裝置。而在 App 列表的旁邊,可看到「push」的新按鈕。按下「push」即可將剛封包完畢的 App 傳送至裝置上。

-

 

-

更新封包式 App

-

若要進一步了解更新作業,請參閱更新 App

-

 

diff --git "a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/\346\211\230\347\256\241\346\233\264\346\226\260\344\275\234\346\245\255_(hosting_updates)_/index.html" "b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/\346\211\230\347\256\241\346\233\264\346\226\260\344\275\234\346\245\255_(hosting_updates)_/index.html" deleted file mode 100644 index ea5b41073b..0000000000 --- "a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/\346\211\230\347\256\241\346\233\264\346\226\260\344\275\234\346\245\255_(hosting_updates)_/index.html" +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: 托管更新作業 (Hosting Updates) -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/托管更新作業_(Hosting_Updates)_ ---- -
-

本文節錄自 B2G/Updating

-
-

托管更新作業 (Hosting Updates)

-

其實亦可解釋為:用戶端針對更新檔案所進行的輪詢作業。

-

B2G 用戶端針對更新所執行的輪詢 (Poll),即針對 update manifest 檔案進行提取 (Fetching) 與剖析 (Parsing)。此檔案即稱為「update.xml」。

-

B2G 用戶端均已完成「輪詢特定伺服器上的更新」的設定,亦將查詢伺服器上特別架構而成的路徑。而我們建議透過 HTTPS 協定 (當然 HTTP 亦支援),讓用戶端查詢伺服器。若現有用戶端更改了輪詢程式碼,則只要將一筆更新傳送至此用戶端,即可針對「用戶端所輪詢過的路徑與伺服器」進行變更。

-

在下列範例中,我們假設將更新作業托管 (Hosting) 給 updates.b2g.com 伺服器。

-

則由用戶端所輪詢的 URL,主要可用下列參數呈現:

- - - - - - - - - - - - - - - - - - - -
-

PRODUCT_MODEL

-
-

裝置型號的名稱。此為 B2G 屬性資料庫中的 ro.product.model 數值。

-
-

CHANNEL

-
-

更新「頻道」,有助於測試作業。舉例來說,我們可設定伺服器托管「nightly」、「beta」、「release」等頻道。

-
-

VERSION

-
-

此為用戶端的軟體版本,此以「18.0.2」為例。

-
-

BUILD_ID

-
-

專屬 ID,如針對特定軟體版本 (Build) 所設的時間戳記。

-
-

當然另有許多數值,可為查詢作業建構出更新用的 URL。

-

B2G 用戶端隨後將整合「本身已設定的更新主機」的數值,搭配上述的相關數值,進而建構出 URL,以於執行期間執行輪詢作業。

-

此 URL 範例可為:

-
https://updates.b2g.com/release/unagi1/18.0/20121203123456/update.xml
-
-

 

-

針對用戶端的請求,若伺服器回傳「404 Not Found」,即代表目前並無可用的更新;若回傳「200」與 manifest 檔案,則代表可能有更新。該 manifest 檔案將描述可用的新版本,亦即用戶端目前應該更新的版本。此 manifest 檔案範例為:

-
<?xml version="1.0"?>
-<updates>
-  <update type="major" appVersion="19.0" version="19.0" extensionVersion="19.0" buildID="20121210123456"
-          licenseURL="http://www.mozilla.com/test/sample-eula.html"
-          detailsURL="http://www.mozilla.com/test/sample-details.html">
-    <patch type="partial" URL="https://updates.b2g.com/release/unagi1/18.0/20121203123456/update.mar"
-           hashFunction="SHA512" hashValue="5111e033875752b7d9b32b4795152dea5ef954cb8a9d4a602dd19a923b464c43521287dcb5781faf3af76e6dc5e8a3dd9c13edea18c1f2c8f3bd89e17d103d6f"
-           size="41901319"/>
-  </update>
-</updates>
-
-

而 manifest 檔案中的欄位則描述了:

- -

當然,使用者或用戶端裝置可能會拒絕更新作業。

-

透過這些機制,伺服器將可托管更新封裝,以利舊版用戶端的更新作業。或可僅托管「線性更新歷史紀錄 (Linear update history)」,讓用戶端必須透過單一路徑完成升級。

-

針對「版本 (Build) 伺服器」和「更新主機」之間的互動細節,仍與作業環境息息相關。本文尚不足以詳細解說完畢。

-

 

diff --git a/files/zh-tw/archive/b2g_os/add-ons/index.html b/files/zh-tw/archive/b2g_os/add-ons/index.html deleted file mode 100644 index 13f42518cd..0000000000 --- a/files/zh-tw/archive/b2g_os/add-ons/index.html +++ /dev/null @@ -1,282 +0,0 @@ ---- -title: Firefox OS 附加元件 -slug: Archive/B2G_OS/Add-ons -translation_of: Archive/B2G_OS/Add-ons ---- -
-

重要: 僅 Firefox OS 2.5+ 支援附加元件功能。

-
- -

「附加元件」的概念在 Web 瀏覽器的世界中眾人皆知,而我們也將這個概念帶進 Firefox OS。Firefox OS 的附加元件可以僅僅作用於單一 App 上,也可以指定作用於多個、甚至所有 App 上。本文帶您一步步撰寫自己的 Firefox OS 附加元件,同時提供一些秘訣及其他應該了解的資訊。

- -
-

附註:本文僅重點概略翻譯。

-
- -
-

附註:Firefox OS 附加元件採用 WebExtensions 擴充模式。此模式大部份源自於 Chrome/Blink 擴充套件機制,讓附加元件在開發時能擁有許多互通性與功能上的優勢。詳情可見持續編寫中的 WebExtensions 文件集

-
- -

開發附加元件

- -

Firefox OS 附加元件其實也是個內含 JavaScript / CSS / 其他必備檔案的 App,但不是拿來獨立運作,而是在描述檔中增加特別的說明來定義要在哪些 App 中使用這個附加元件。When apps are launched on a Firefox OS device that has an add-on installed, the add-on is injected into any app that matches the pattern specifed in the filter.

- -

Firefox OS add-ons use the same syntax and structure for their code as the new school of Firefox add-ons developed using the WebExtensions API, which is itself based on the Chrome extensions model.

- -

簡單範例

- -

以下我們以一個簡單的例子說明 Firefox OS 附加元件的程式基礎。這個附加元件會在 system app 放上一塊看板,使用者可以點擊關閉。

- -

firefox os screenshot showing add-on banner

- -

這個附加元件很簡單,但用來作為入門倒是相當足夠了。你可以在 GitHub 上下載範例程式,而後用 WebIDE 裝到你的 Firefox OS 裝置上(參考 {{anch("Testing your add-on using WebIDE")}} 一節)。往後你也可以透過 Firefox Marketplace 來發表自己的附加元件。

- -

Be aware that Firefox OS add-ons can do a lot more than what we've got listed here. The WebExtensions documentation will have more information added as time goes on.

- -

解析 Firefox OS add-on

- -

In this section we'll walkthrough the contents of the sample add-on repo, explaining each piece of content. 目錄結構看起來像這樣:

- - - -

manifest.json

- -

你應該發現了:在這個範例附加元件目錄中,有兩種類似的描述檔。第一個「manifest.json」的結構類似 Chrome 擴充套件,與 CSS、JavaScript 及其他檔案一起放在 {{anch("extensions.zip")}} 當中。It can contain a large variety of instructions (see Chrome Manifest File Format), but for now we're just going to concentrate on a simple subset:

- -
{
-  "manifest_version": 1,
-  "name": "Add-on banner",
-  "description": "Firefox OS add-on example",
-  "version": "1.0",
-  "author": "Chris Mills",
-  "content_scripts": [{
-    "matches": ["app://system.gaiamobile.org/index.html"],
-    "css": ["css/style.css"],
-    "js": ["js/index.js"]
-  }],
-  "icons": {
-    "128": "/icons/128.png"
-  }
-}
- -

Most of these fields are pretty self-explanatory, but we'll cover the last few.

- -

首先以 content_scripts 指定要植入 app 的檔案 — 你可以看到這邊以 cssjs 兩欄分別指定 CSS 樣式檔及 JavaScript 程式檔。matches 欄位則是用以指定該把檔案放入哪些 app 裡,這個欄位的內容形式很多元(參考 Chrome Match Patterns),但我們先簡單指定為 app://system.gaiamobile.org/index.html,讓附加元件僅影響 system app。若想影響所有 app,可以將此欄位寫為 app://*/*

- -
-

Note: You can reference multiple scripts and stylesheets by simply including multiple items in the arrays, for example "css": ["css/style.css", "css/more.css"].

-
- -
-

Note: Firefox OS does not currently support the Chrome <all_urls> keyword.

-
- -

At the bottom of the manifest we've included the icons field; see the next section for more info on this.

- -

update.webapp

- -

update.webapp 則是 Firefox OS 式的描述檔,基本上就是跟打包 app 時用的描述檔格式相同。(參考 Self-publishing packaged apps。)

- -

Our update.webapp file looks like so:

- -
{
-  "name" : "Add-on banner",
-  "description": "Firefox OS add-on example",
-  "developer": { "name": "Chris Mills" },
-  "package_path": "extension.zip",
-  "icons": {
-    "128": "/icons/128.png"
-  }
-}
- -

Again, most of this is fairly self-explanatory.

- -

這邊最重要的欄位該是 package_path,用以指定內含附加元件程式的包裝檔位置。

- -

You'll notice that the icons field is included here, the same as it is in {{anch("manifest.json")}} — update.webapp is the only place you need to have the icons information at the moment, but we'd recommend you include it in both places for now, just in case things change. The icons field points to the add-on icon so it can be used inside the Gaia Settings app, and the Firefox Marketplace when it starts to host add-ons.

- -

指定圖示

- -

你必須在描述檔中至少指定一個圖示,否則描述檔無效。詳情可參考 Manifest 參考文件:圖示 一節。

- -

CSS

- -

There is nothing special about the CSS included in the example. The only thing to bear in mind is that you should make sure your add-on classnames and selectors do not conflict with any of the existing CSS in the app(s) it is applied to.

- -

For example, we wrapped our example banner in a {{htmlelement("div")}} with class fxos-banner. But you could even consider using some kind of unique code for your classname.

- -

JavaScript

- -

Again, the JavaScript file that powers the add-on doesn't have any special functionality inside it (see the JavaScript source on Github.) It is injected into the apps it is applied to along with any CSS specified in the {{anch("manifest.json")}} file.

- -
-

Note: Add-on code is injected every time an app is launched and the match specified in manifest.json pattern matches that app. It is also injected whenever add-ons are enabled. When an add-on is injected into an app because the app is launching, all add-on files are injected into the app before anything in the app is initialized, including the DOM. It is up to the add-on developer to handle the different launch cases cases (immediate injection vs. injection on launch); there is more info on this below.

-
- -

Other main things to note are covered below.

- -

The window object

- -

Add-ons only share a proxied version of the content window. As a result, anything that is written to the window object from an add-on is unavailable to the app code. However, anything on the window object that is set by app code is available to add-ons. Similarly, the DOM is accessible as usual.

- -

Injecting code at the correct time

- -

You must be careful to properly handle cases where an add-on is injected into an app after the app has been loaded. Such a scenario can occur when an app is already running and an add-on that targets it is enabled.

- -

in such a case, a window.onload handler won't work because the DOMContentLoaded event has already occured.

- -

There's no good solution to this problem right now. In the interim, we recommend to check whether or not the DOM has been loaded before setting a DOMContentLoaded callback. This pattern is used in the demo:

- -
// If injecting into an app that was already running at the time
-// the app was enabled, simply initialize it.
-if (document.documentElement) {
-  initialize();
-}
-
-// Otherwise, we need to wait for the DOM to be ready before
-// starting initialization since add-ons are usually (always?)
-// injected *before* `document.documentElement` is defined.
-else {
-  window.addEventListener('DOMContentLoaded', initialize);
-}
-
-function initialize() {
-  // ...
-}
- -

避免重複植入

- -

為避免附加元件的程式碼多次重複植入到同一 App 中,您必須檢查附加元件是否曾經植入過,例如這樣

- -

you should check whether your add-on is already present, like this:

- -
function initialize() {
-  if (document.querySelector('.fxos-banner')) {
-    // Already injected, abort.
-    return;
-  } else {
-    var body = document.querySelector('body');
-    var fxosBanner = document.createElement('div');
-    fxosBanner.classList.add('fxos-banner');
-    var bannerText = document.createElement('p');
-    var closeBtn = document.createElement('button');
-
-    fxosBanner.appendChild(bannerText);
-    fxosBanner.appendChild(closeBtn);
-    body.appendChild(fxosBanner);
-
-    closeBtn.textContent = 'X';
-    bannerText.textContent = 'Wow, you have an extension installed!';
-
-    closeBtn.onclick = function() {
-      fxosBanner.parentNode.removeChild(fxosBanner);
-    }
-  }
-}
- -

So here we are using if (document.querySelector('.fxos-banner')) to check whether the example banner already exists. If so, then we return out of the function. If not, then the querySelector() method returns null, and we run the code block that creates the banner.

- -

App management functions in add-ons

- -

All Apps and Mgmt functions work on add-ons just like they do on apps. Be aware however that the latter are only available to add-ons when they are injected into a certified app that has the webapps-manager permission specified in the manifest.

- -

In addition to these functions, an onenabledstatechange callback is exposed for add-ons being enabled and disabled. This event is fired for all add-ons, so you will have to check which add-on was enabled/disabled before performing initialization or cleanup.

- -
navigator.mozApps.mgmt.onenabledstatechange = function(event) {
-  var app = event.application;
-  if (app.manifestURL === 'https://origin.of.manifest/manifest.webapp') {
-    var wasEnabled = app.enabled;
-    // do something with this information
-  }
-};
- -

extension.zip

- -
-

Note: The extension.zip file has been left in the demo repo mainly for illustrative purposes, so it is clear how the system works. You actually don't need to include the zip in your directory, as WebIDE will generate it for you when you install the add-on. The Firefox Marketplace is likely to do the same when it starts to list add-ons.

-
- -

The extension.zip archive contains the code for the extension, and is referenced in the {{anch("update.webapp")}} package_path field — This is how Gecko finds the code to be installed. Archived inside you'll find:

- - - -

So the manifest.json file sits inside the archive, and serves to reference the files to be injected and specify which apps to affect.

- -

Testing your add-on using WebIDE

- -

Mozilla's WebIDE tool is available in Firefox desktop by default. To use it for installing add-ons on your phone, follow the steps listed below:

- -
    -
  1. Make sure you have Firefox 43 or above installed (this was Nightly at the time of writing), as add-ons are not supported in WebIDE below this version.
  2. -
  3. Open your browser and open the WebIDE tool (press the WebIDE button, or choose Tools > Web Developer > WebIDE from the menu.)
  4. -
  5. Make sure your phone has remote debugging enabled (Settings App > Developer > Set the "Debugging via USB " selection to "ADB and DevTools".)
  6. -
  7. Connect your phone to your computer via a USB cable. Make sure you don't have other phones connected at the same time.
  8. -
  9. In the WebIDE UI, press the Select Runtime option, and select your phone, which should be listed under USB Devices.
  10. -
  11. At this point, your phone should be showing an Allow USB debugging connection? prompt. Choose Allow.
  12. -
  13. Select the Open App option, then choose Open Packaged App...
  14. -
  15. In the resulting file chooser, navigate to the directory that contains your update.webapp manifest file, and press Open.
  16. -
  17. Providing there are no warnings or errors reported, you can install your add-on on the device using the "Play" button in the center (Install and Run.)
  18. -
  19. To see the add-on in action, enable it by choosing Settings app > Add-ons > Add-on example > toggle the checkbox at the top.
  20. -
- -

Add-on settings

- -

You can control the add-ons on your phone by going to Settings app > Add-ons; in here you'll find a list of your installed add-ons, and you can tap each entry to see more information about each add-on.

- -

firefox os screenshot showing a list of installed add-ons in the settings appinformation screen for an individual addon, with a list of apps this add-on affects, and controls to disable and delete the add-on

- -

Enabling/disabling and deleting add-ons

- -

By default, add-ons will be enabled after installation when they are installed form the Firefox Marketplace. When installed via WebIDE however they will be disabled by default.

- -

You can manually enable/disable add-ons via the checkbox at the top of each individual add-on's page (found under Settings app > Add-ons), or programmatically using the navigator.mozApps.mgmt.setEnabled() function (see this setEnabled() usage example on Github.)

- -

You can delete an add-on entirely by tapping the Delete button found on individual app pages.

- -

Apps affected by add-ons

- -

You'll also notice that in the page for each individual add-on there is a section that lists which apps are affected by that add-on. Currently this doesn't seem to work (it always lists This add-on does not affect any installed apps.) This should be fixed soon (see {{Bug(1196386)}} for progress.)

- -

權限

- -

附加元件的權限繼承自其所植入的 App,在描述檔中想多要一點權限是行不通的,也無法以此方式增加其植入對象的權限。

diff --git a/files/zh-tw/archive/b2g_os/api/fmradio/index.html b/files/zh-tw/archive/b2g_os/api/fmradio/index.html deleted file mode 100644 index ec662a0029..0000000000 --- a/files/zh-tw/archive/b2g_os/api/fmradio/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: WebFM -slug: Archive/B2G_OS/API/FMRadio -translation_of: Archive/B2G_OS/API/FMRadio ---- -

WebFM API 可存取裝置上的 FM 收音機功能。此介面可開啟/關閉 FM 收音機,亦可搜尋各個電台。

-

進入點 (Entry point)

-
if (navigator.mozFMRadio)
-  navigator.mozFMRadio.enable();
-
-

API

-
interface FM : EventTarget {
-   readonly attribute boolean enabled;
-   readonly attribute boolean antennaAvailable;
-   readonly attribute double frequency;
-   readonly attribute double frequencyUpperBound;
-   readonly attribute double frequencyLowerBound;
-   readonly attribute double channelWidth;
-
-   attribute Function onantennaavailablechange;
-   attribute Function onfrequencychange;
-   attribute Function onenabled;
-   attribute Function ondisabled;
-
-   DOMRequest enable(double frequency);
-   DOMRequest disable();
-   DOMRequest setFrequency(double frequency);
-   DOMRequest seekUp();
-   DOMRequest seekDown();
-   DOMRequest cancelSeek();
-}
-

屬性 (Attribute)

-
-
- enabled
-
- 表示目前是否開啟收音機
-
- antennaAvailable
-
- 表示是否已插上天線並可使用天線
-
- frequency
-
- 目前的收音機頻率
-
- frequencyUpperBound
-
- 以 seek 函式搜尋收音機電台的最高頻率
-
- frequencyLowerBound
-
- 以 seek 函式搜尋收音機電台的最低頻率
-
- channelWidth
-
- 頻率範圍內的頻寬,以「MHz」為單位。常用數值為 0.05、0.1 (預設)、0.2 其中之一。
-
- 指定了某一頻率之後,就會四捨五入到 channelWidth 所指定的最接近頻率。舉例來說,若 100 Mz 為有效頻率,且 channelWidth 為 0.2,則 100.2 與 99.8 將成為有效頻率。但若是 100.15 將四捨五入為 100.2。
-
-

函式 (Method)

-
-
- enable(frequency)
-
- 開啟收音機並轉為指定頻率。若沒有參數 (Argument) 就呼叫此函式,將隨即丟出錯誤。作業成功或錯誤均將回傳 DOMRequest。
-
- disable()
-
- 關閉收音機。若回傳成功的 DOMRequest,則代表已正確關閉收音機。
-
- setFrenquecy(frequency)
-
- 非同步變更收音機的頻率。此數值必須位於 frequencyLowerBoundfrequencyUpperBound 之間。若嘗試設定此範圍之外,將導致錯誤。
-
- 若回傳成功的 DOMRequest,則代表已正確變更頻率。
-
- seekUp()
-
- 要求收音機尋找新的頻率 (一般搜尋較目前頻率更高的頻率)。若成功搜尋到新的頻率,將隨即啟動 frequencychange 事件。若回傳成功的 DOMRequest,則代表已開始搜尋作業。一旦達到最高頻率,將回到較低頻率開始搜尋。
-
- seekDown()
-
- 與上方函式的功能相同,但將搜尋較目前頻率更低的頻率。一旦達到最低頻率,將回到較高頻率開始搜尋。
-
- cancelSeek()
-
- 取消目前的搜尋作業。若回傳成功的 DOMRequest,則代表已取消搜尋作業。
-
-

事件 (Event)

-
-
- enabled
-
- 開啟收音機時觸發此事件
-
- disabled
-
- 關閉收音機時觸發此事件
-
- antennaavailablechange
-
- 插上/拔除天線時觸發此事件
-
- frequencychange
-
- 只要變更收音機頻率,均將觸發此事件
-
-

另請參閱

-

Gaia radio app

diff --git a/files/zh-tw/archive/b2g_os/api/index.html b/files/zh-tw/archive/b2g_os/api/index.html deleted file mode 100644 index 706080ff54..0000000000 --- a/files/zh-tw/archive/b2g_os/api/index.html +++ /dev/null @@ -1,156 +0,0 @@ ---- -title: B2G OS APIs -slug: Archive/B2G_OS/API -tags: - - API - - B2G API - - NeedsTranslation - - TopicStub - - b2g os api's -translation_of: Archive/B2G_OS/API ---- -

List of B2G OS APIs 

- -

-A -B -C -D - - -F - - -H - - - - - - - - -M -N - - -P - - - - -S -T -U - - -W - - - - - - - -

diff --git a/files/zh-tw/archive/b2g_os/apps/index.html b/files/zh-tw/archive/b2g_os/apps/index.html deleted file mode 100644 index 7c848f3df1..0000000000 --- a/files/zh-tw/archive/b2g_os/apps/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: 製作 Firefox OS 的 apps -slug: Archive/B2G_OS/Apps -translation_of: Web/Apps/Fundamentals ---- -

Firefox OS 裝置的應用程式其實只是開啟網頁上的Web應用;它們完全由各種開放的Web技術所組成,如 JavaScript, HTML, 和 CSS。雖然我們寫給 apps 的主要文件幾乎涵蓋了您所需要知道的所有事情,這裡列了一些特別著重於開發及測試 Firefox OS的文件。

-
-
-

文件及入門教材

-
-
- 寫一個 Firefox OS 的 Web app
-
- 一份教您製作您的第一個 Firefox OS web 應用程式的入門指南。
-
- 撇步及技巧
-
- 一份我們開發者建議您的撇步及技巧集(像是對於問題的替代方案)。
-
-

全部文章...

-
-
-

尋求社群協助

-

您在 app 相關問題上需要幫助、且無法在文件中找到解法嗎?

-
    -
  • 在 layout 論壇中請教,, 其中涵蓋 CSS 和 HTML: {{ DiscussionList("dev-tech-css", "mozilla.dev.tech.layout") }} -
      -
    • 在 Mozilla IRC channel 裡面提出你的問題: #openwebapps
    • -
    -
  • -
-

請遵守網路禮節...

-

工具

- -

View All...

- - -
-
-

 

diff --git a/files/zh-tw/archive/b2g_os/apps/writing_a_web_app_for_b2g/index.html b/files/zh-tw/archive/b2g_os/apps/writing_a_web_app_for_b2g/index.html deleted file mode 100644 index 4e612e8a87..0000000000 --- a/files/zh-tw/archive/b2g_os/apps/writing_a_web_app_for_b2g/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: 寫一個 Firefox OS 的 Web app -slug: Archive/B2G_OS/Apps/Writing_a_web_app_for_B2G -translation_of: Web/Apps/Fundamentals/Quickstart ---- -

B2G apps 只是用 HTML、CSS、和 Javascript 寫的 Web apps。在網頁上發佈 Web apps 就跟發佈一般的網站一樣。為了讓網站可以像 Web app 一樣可以被安裝在行動裝置上,你只需要加上一個 manifest 以及掛上一個安裝按鈕,如以下說明。

-

建議您從下面的文章著手:

- -

當然,您也可以無拘無束地 沉浸在 Open Web Apps 的深處

-

安裝 Web app

-

在網頁上發佈 app 和 manifest 之後,接著要讓 Gecko 知道這個訊息。像是在安裝時,Gecko 查詢 manifest 並將必須的項目加入到 home 的畫面,等等。

-

安裝 app 需要呼叫 navigator.mozApps.install() API。這裡有個安裝按鈕的範例,當您將 app 置於自己管理的位置時,這個範例可以讓您將按鈕嵌入於您自己的網頁:

-
<script>
-var manifest_url = "http://my.webapp.com/manifest.json";
-</script>
-
-<button onclick="navigator.mozApps.install(manifest_url); return false;">
-  Install this awesome app on your homescreen!
-</button>
-
-

注意:這個安裝按鈕也可以被置於像是 Mozilla Marketplace 的 app market,然而一般而言,在您自己的主要頁面上面也放一個「安裝 web app」的按鈕是非常貼心的。

-

現在請用 B2G 瀏覽器 app 瀏覽您的網站,並且點選安裝按鈕吧。

diff --git a/files/zh-tw/archive/b2g_os/architecture/index.html b/files/zh-tw/archive/b2g_os/architecture/index.html deleted file mode 100644 index a0a649e4f9..0000000000 --- a/files/zh-tw/archive/b2g_os/architecture/index.html +++ /dev/null @@ -1,717 +0,0 @@ ---- -title: Firefox OS 架構 -slug: Archive/B2G_OS/Architecture -translation_of: Archive/B2G_OS/Architecture ---- -
-

本文件是 Firefox OS 平台架構的初步概要介紹,將會簡單地向您介紹 Firefox OS 的重要概念,並解釋元件間如何互動。

-
- -
-

注意:Firefox OS 仍算是開發中的產品。本文說明的架構仍非最後確定的架構,隨時可能修改。

-
- -

Firefox OS 術語

- -

在閱讀 Firefox OS 技術文件之前,建議先了解以下的詞彙:

- -
-
B2G
-
Boot to Gecko 的縮寫。
-
Boot to Gecko
-
Firefox OS 作業系統的工程代號。此代號常常用以代表 Firefox OS。因為在本專案還未定下正式名稱之前,此代號已經用了很長的一段時間,因此常常用以代表 Firefox OS。
-
Firefox OS
-
Firefox OS 即是將 Mozilla (及其 OEM 夥伴) 的品牌與服務,套用至 Boot to Gecko 的基礎之上開發而得的最終產品。
-
Gaia
-
Firefox OS 平台的使用者介面 (UI)。 在啟動 Firefox OS 之後,都是透過 Gaia 層產出螢幕上的任何東西。Gaia 建構出鎖定畫面、主畫面,以及大家預期智慧型手機所應提供的其他標準 App。Gaia 完全使用 HTML、CSS、JavaScript 實作而成。透過實作在 Gecko 層的開放 Web API,與其底層的作業系統溝通。第三方 App 均可安裝於 Gaia 層。
-
Gecko
-
Firefox OS App 的執行環境 (Runtime),也就是本層可支援所有的開放標準:HTML、CSS、JavaScript。本層另必須確保這些 API 可正確運作於 Gecko 支援的所有 OS。意即 Gecko 另包含了網路連線堆疊、圖形堆疊、配置引擎、JavaScript 虛擬機器、移植層。
-
Gonk
-
Gonk 是 Firefox OS 平台的底層作業系統,是由 Linux 核心 (以 Android Open Source Project 為架構),與使用者空間的硬體抽象層 (Hardware abstraction layer,HAL) 所組成。核心以及許多使用者空間的函式庫,均來自常見的開放源碼專案,如 Linux、libusb、bluez 等。HAL 的某些部分是與 AOSP 共享,如 GPS 或相機。你可將 Gonk 當成是簡單的 Linux 分支版本。Gonk 又是 Gecko 的移植目標;意即有一套 Gecko 可在 Gonk 上執行,就像是 Gecko 也有 Mac OS X、Windows、Android 等版本。因為 Firefox OS 可完整控制 Gonk,所以某些不能開放給其他 OS 用的介面,還是可開發給 Gecko 使用。舉例來說,Gecko 可直接存取 Gonk 的完整電話功能堆疊,並於 Gonk 上顯示緩衝區 (Frame buffer),但是其他 OS 不能進行類似的存取。
-
Jank
-
此一詞彙常見於行動 App 領域,指在 APP 中執行了緩慢或沒有效率的程式碼,進而阻礙了 UI 更新並發商系統延遲或無回應的情形。Gaia 開發者使用不同的最佳化方法,要儘力避免此狀況發生。
-
- -

整體架構示意圖

- -

下圖比較了專利平台與 Firefox OS 之間的架構。

- -

on the left is a native mobile architecture stack, on the right is the Firefox OS architecture. they are similarm except that the native stack is all proprietary device functionality, and the Firefox OS stack is all done with open source and web technologies.

- -

Firefox OS 即減去了 OS 與 App 層之間的原生 API 層。這種統合式的設計可減輕平台負擔並簡化安全機制,卻又不致犧牲效能,也不會影響智慧型手機的使用體驗。

- -
    -
  1. Gaia 作為裝置的核心 Web App 與 UI 層,並全以 HTML5、CSS、JavaScript 撰寫而成,並有許多 API 可供 UI 程式碼存取手機硬體與 Gecko 功能。
  2. -
  3. Gecko 即為 Firefox OS 的 Web 引擎與表現層 (Presentation layer),作為 Web 內容與底層裝置的之間介面,進而將硬體接上 HTML。Gecko 亦提供 HTML5 剖析 (Parsing) 與繪圖引擎,並透過程式設計的方式,以安全的 Web API 存取硬體功能、更新作業,以及其他核心服務。
  4. -
  5. Gonk 是 Firefox OS 堆疊中的核心層級元件,作為 Gecko 與底層硬體之間的介面。Gonk 可控制底層硬體,並將硬體功能告知 Gecko 中建構的 Web API。Gonk 可視為「黑盒子」,暗自進行所有複雜又零碎的背景作業,以於硬體層制定請求,進而控制行動裝置。
  6. -
  7. 行動裝置,就是執行 Firefox OS 的行動電話硬體。OEM 廠商則負責提供行動裝置。
  8. -
- -

特殊 Firefox OS 架構

- -

Firefox OS Architecture

- -

Firefox OS 開機流程

- -

本段將說明 Firefox OS 的開機流程,包含整個流程所牽涉的部份,以及相關部分在系統裡的位置。流程順序大致如下:最先從核心空間裡的開機載入器 (Bootloader) 開始,到原生程式碼中開始程序,進入 B2G 再到使用者空間的 Gecko,最後到 Gecko 裡的系統 App、視窗管理器、主畫面 App。而其他 App 也同樣依照上述程序執行。

- -

- -

開機程序

- -

在首次啟動 Firefox OS 裝置時,就會於主要的開機載入器 (bootloader) 中開始作業。自此,就如同一般作業系統程序,更高一階的開機相關載入器會載入執行,然後往上更高一階的載入器又會被接續執行,如此下去形成一串開機載入流程鏈,直到最後程序就會將執行權交到 Linux 核心。

- -

關於開機程序有幾點需要注意:

- - - -

Linux 核心

- -

Gonk 使用 Linux 核心的版本,與 Android 開放源碼專案 (Android Open Source Project,AOSP) 所衍生使用的版本非常相似,但是並未沿用幾項 AOSP 所進行的修改。除外,雖然 Lunix 基本上已經相當穩定,但仍有些製造商會自行修改。

- -

Linux 的啟動程序已經可在網路上找到相當詳盡的文件說明,所以在此不再贅述。

- -

Linux 核心會啟動一些基本的程序 (Process)。在執行 init.rc 中定義的程序後,會再執行 init.b2g.rc 以啟動基本核心程序,如 b2g (Firefox OS 基礎程序,內含 Gecko) 以及 rild (通話功能的相關程序,各晶片組多有不同),請見下方所述細節。和大部分的 Unix 作業系統一樣,最後會啟動使用者空間 (Userspace) 程序。

- -

在啟動 init 程序之後,Linux 核心就會處理由使用者空間傳來的系統呼叫,並中斷來自於硬體裝置的類似呼叫。許多硬體功能均透過 sysfs 揭露給使用者空間,以下便是 Gecko 讀取電池狀態的程式碼片段

- -
FILE *capacityFile = fopen("/sys/class/power_supply/battery/capacity", "r");
-double capacity = dom::battery::kDefaultLevel * 100;
-if (capacityFile) {
-  fscanf(capacityFile, "%lf", &capacity);
-  fclose(capacityFile);
-}
- -

更多有關 init 程序

- -

Gonk 中的 init 程序,將處理必要的檔案系統並產生系統服務,之後就如同程序管理一般繼續待命,並將編譯指令碼 (也就是 init*.rc 檔案);指令碼內的指令則說明在啟動不同服務時所應進行的作業。

- -

init 程序必須處理一個相當關鍵的作業,即啟動 b2g 程序;這也是 Firefox OS 的核心。

- -

以下為 init.rc 中用以啟動 b2g 的程式碼:

- -
service b2g /system/bin/b2g.sh
-    class main
-    onrestart restart media
- -
-

注意:Firefox OS 與 Android 的 init.rc 之間的差異,將各款裝置而有所不同。有時候只是附加 init.b2g.rc,但有時修改的幅度甚大。

-
- -

使用者空間 (Userspace) 的程序架構

- -

現在讓我們來看看高階一點的部分,到底Firefox OS的各個元件之間是如何運作互動的。下圖所描述的是Firefox OS的主要使用者空間程序。

- -

接著可進一步了解 Firefox OS 不同元件是如何運作互動。下圖呈現 Firefox OS 的主要使用者空間程序。

- -

Userspace diagram

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -
-

注意:由於 Firefox OS 尚處於開發階段,所以此示意圖可能隨時修改而非完全正確。

-
- -

b2g 程序是主要的系統程序,能以高權限存取大部分的硬體;b2g 可溝通數據機、畫出顯示緩衝區 (Framebuffer),並與 GPS 或相機等硬體溝通。在系統內部,b2g 則執行 Gecko 層 (即以 libxul.so 所實作)。另可參考 Gecko 以了解 Gecko 層的運作方式,以及 b2g 與 Gecko 層溝通的方法。

- -

b2g

- -

b2g 程序會生成許多低權限的內容程序 (Content process),並透過這些程序來載入 Web 的 App 與內容。這些程序會再透過訊息傳遞系統「IPDL」溝通 Gecko 伺服器。

- -

b2g 程序所執行的 libxul,即參照 b2g/app/b2g.js 取得預設偏好設定。透過偏好設定,程序將開啟上述的 HTML 檔案「b2g/chrome/content/shell.html」,即於 omni.ja 檔案中編譯而得。而 shell.html 則包含了 b2g/chrome/content/shell.js 檔案,將觸發 Gaia 的「system」這個 App。

- -

rild

- -

rild 為銜接數據機處理器的介面,也是用以建構無線介面層 (Radio Interface Layer,RIL) 的常駐程式 (Daemon)。往往是由硬體製造商所撰寫的專屬程式碼,以溝通自家的數據機硬體。rild 可讓用戶端程式碼連接 rild 本身綁定的 Unix-domain socket。可經由以下類似的 init 指令碼啟動之:

- -
service ril-daemon /system/bin/rild
-    socket rild stream 660 root radio
- -

rilproxy

- -

在 Firefox OS 中,rild 用戶端即屬於 rilproxy 程序,作為 rildb2g 之間不具功能的傳送代理dumb forwarding proxy。為何需要此代理伺服器,就必須從實作細節來說明了。但簡單來說,proxy 確實有其存在的必要。可到 GitHub 上找到 rilproxy 原始碼

- -

mediaserver

- -

mediaserver 程序用以控制音訊與視訊的播放作業。Gecko 透過 Android 的遠端程序呼叫 (Remote Procedure Call,RPC) 和其溝通。某些可由 Gecko 撥放的媒體檔案 (如 OGG Vorbis 音訊、OGG Theora 視訊、WebM 視訊等),均是由 Gecko 解碼後直接傳送給 mediaserver 程序。其他的媒體檔案則是交由 libstagefright 解碼。libstagefright 可存取特定編碼與硬體編碼器 (Hardware encoder)。

- -
-

注意:mediaserver 程序為 Firefox OS 的「暫時性」元件,主要是協助早期的開發作業。預計最快在 Firefox OS 2.0 階段就會移除。

-
- -

netd

- -

netd 程序可用來設定網路介面。

- -

wpa_supplicant

- -

wpa_supplicant 程序為標準 UNIX 樣式常駐程式,可處理 WiFi 存取點的連線作業。

- -

dbus-daemon

- -

dbus-daemon 用以建構 D-Bus 訊息匯流系統,可供 Firefox OS 進行藍牙通訊作業。

- -

Gecko

- -

如前所述,Gecko 即由 Web 標準 (HTMLCSSJavaScript) 建構而成,並用以打造 Firefox OS 上所顯示的一切,另可控制手機硬體。Web App 則透過安全且受控制的 Web API (同樣以 Gecko 所建構而得) 來將 HTML5 連上硬體。Web API 可透過程式設計的方式,存取底層行動裝置硬體 (如電池或振動) 的功能,或取得儲存的資料 (如行事曆或聯絡資訊)。Web 內容亦可透過content invokes the accessible Web APIs within HTML5.

- -

App 是由相關 HTML5 網頁內容所組成。如果要撰寫 Web App 並於 Firefox OS 行動裝置上執行,則開發者也只要組合、封包、發佈此網頁內容即可。而在執行期間,即交由瀏覽器轉譯、編譯、換至此網頁內容。可參閱應用程式中心 (App Center) 進一步了解。

- -
-

注意:如果要搜尋 Gecko 的 Codebase,則可前往 http://dxr.mozilla.org,功能比較炫、參照功能不錯,但 Repo 較有限。亦可使用傳統的 http://mxr.mozilla.org,內含較多的 Mozilla 專案。

-
- -

Gecko 架構圖

- -

- - - -

和 Firefox OS 相關的 Gecko 檔案

- -

b2g/

- -

b2g 資料夾主要包含 Firefox OS 相關功能。

- -
b2g/chrome/content
- -

內含於系統 App 上運行的 Javascript 檔。

- -
b2g/chrome/content/shell.html
- -

Gaia 的進入點。如前所述,shell.html 會拉進 shell.js 與 settings.js。用於系統 App 的 HTML。

- -
<script type="application/javascript;version=1.8" src="chrome://browser/content/settings.js"> </script>
-<script type="application/javascript;version=1.8" src="chrome://browser/content/shell.js"> </script>
- -

settings.js 裡面是系統預設的設定參數。

- -
b2g/chrome/content/shell.js
- -

shell.js 是載入 Gaia「system」App 的第一個指令碼。

- -

shell.js 將匯入所有必要的模組、註冊關鍵的監聽器、定義 sendCustomEvent 與 sendChromeEvent 以溝通 Gaia、提供 webapp 安裝輔助程式:indexedDB 配額、遠端除錯器、鍵盤助手、螢幕截圖工具。

- -

不過 shell.js 最重要的功能,則是啟動 Gaia 的「system」App,然後將整體系統相關的管理作業交給該「system」App。

- -
let systemAppFrame =
-  document.createElementNS('http://www.w3.org/1999/xhtml', 'html:iframe');
-    ...
-  container.appendChild(systemAppFrame);
- -
b2g/app/b2g.js
- -

此指令碼包含預先定義的設定,就像是瀏覽器的 about:config,以及 Gaia 的 pref.js。這些設定值另可透過「設定 (Settings)」App 變更,也可用 Gaia 建置指令碼中的 Gaia’s user.js 覆寫之。

- -

/dom/{API}

- -

新實作的 API (post-b2g) 會位於 dom/ 資料夾。舊 API 位於 dom/base,例如navigator.cpp

- -
/dom/apps
- -

將載入 .jsm。而 .js API 實作即如 webapp.js 安裝、getSelf 等。

- -
dom/apps/PermissionsTable.jsm
- -

所有的存取權限都定義在 PermissionsTable.jsm 之中。

- -

/dom/webidl

- -

WebIDL是用以定義 Web API 的語言,請參閱 WebIDL_bindings 了解所支援的屬性。

- -

/hal/gonk

- -

此目錄包含 gonk 銜接層 (Port layer) 的相關檔案。

- -

所產生的檔案

- -
module/libpref/src/init/all.js
- -

內有全部的設定檔。

- -
/system/b2g/ omni.ja and omni.js
- -

內有裝置內資源所適用的樣式。

- -

處理輸入事件

- -

Gecko 內絕大多數的行動,都是由使用者的行動所觸發,可用輸入事件為代表 (如按下按鈕、觸碰裝置的螢幕等)。這些事件必須透過 nsIAppShellGonk implementation (為 Gecko 介面之一,作為 Gecko App 的主要進入點),進入到Gecko。也就是說,輸入裝置驅動程式將呼叫 nsAppShell 物件 (代表 Gecko 子系統) 上的函式,來將事件發送到使用者介面。

- -

例如:

- -
void GeckoInputDispatcher::notifyKey(nsecs_t eventTime,
-                                     int32_t deviceId,
-                                     int32_t source,
-                                     uint32_t policyFlags,
-                                     int32_t action,
-                                     int32_t flags,
-                                     int32_t keyCode,
-                                     int32_t scanCode,
-                                     int32_t metaState,
-                                     nsecs_t downTime) {
-  UserInputData data;
-  data.timeMs = nanosecsToMillisecs(eventTime);
-  data.type = UserInputData::KEY_DATA;
-  data.action = action;
-  data.flags = flags;
-  data.metaState = metaState;
-  data.key.keyCode = keyCode;
-  data.key.scanCode = scanCode;
-  {
-    MutexAutoLock lock(mQueueLock);
-    mEventQueue.push(data);
-  }
-  gAppShell->NotifyNativeEvent();
-}
- -

這些事件來自於Linux標準input_event系統. Firefox OS在其上添加了一層簡單的抽象層,提供了一些像是事件過濾等不錯的功能。產生事件的程式碼在widget/gonk/libui/EventHub.cpp裡的EventHub::getEvents()方法。

- -

Gecko接收到事件後,這些事件會透過nsAppShell發送到DOM:

- -
static nsEventStatus sendKeyEventWithMsg(uint32_t keyCode,
-                                         uint32_t msg,
-                                         uint64_t timeMs,
-                                         uint32_t flags) {
-    nsKeyEvent event(true, msg, NULL);
-    event.keyCode = keyCode;
-    event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_MOBILE;
-    event.time = timeMs;
-    event.flags |= flags;
-    return nsWindow::DispatchInputEvent(event);
-}
-
- -

之後,事件有可能被Gecko處理掉或是當作DOM事件發送到網頁應用程式做進一步處裡。

- -

影像繪圖

- -

在最底層,Gecko利用 OpenGL ES 2.0 向包有硬體影格緩衝區(frame buffers)的GL context物件繪圖,這是由Gonk所實作的nsWindow完成:

- -
gNativeWindow = new android::FramebufferNativeWindow();
-sGLContext = GLContextProvider::CreateForWindow(this);
- -

FramebufferNativeWindow類別(class)是直接從Android而來,請見FramebufferNativeWindow.cpp;使用了gralloc API存取繪圖驅動,好配對影格緩衝裝置的緩衝到記憶體之中。

- -

Gecko透過圖層(Layers)系統合成螢幕上的影像,大體而言如下:

- -
    -
  1. Gecko將不同部分的記憶體分頁(pages)畫入記憶體緩衝,有時後這些緩衝存在系統記憶體,有時候因為Gecko會直接畫入視訊記憶體(video memory),所以這些緩衝也可能會是配對在Gecko定址空間的材質(textures) ,以上的工作主要是由BasicThebesLayer::PaintThebes()方法完成。
  2. -
  3. Gecko利用OpenGL命令將這些材質合成起來,合成工作由ThebesLayerOGL::RenderTo()方法執行。
  4. -
- -

因為有關Gecko如何處理影像繪圖的作法已經超出本文範圍,所以本文不再做進一步討論了。

- -

硬體抽象層(Hardware Abstraction Layer, HAL)

- -

Gecko HAL是Gecko接口層之一,它使用高階層Gecko能取用的C++ API存取跨平台間的底層系統介面,這些API以每個平台為基礎實作在Gecko HAL之內。Gecko的Javacsript程式碼並不能看到這個HAL層。

- -

HAL如何運作

- -

讓我們先來看看Vibration API。這個Gecko HAL API被定義在hal/Hal.h,基本上你可以看到如下函式(為了說明需要,經過函式簽名(function signature)簡化):

- -
void Vibrate(const nsTArray<uint32> &pattern);
- -

Gecko呼叫這個函式來根據某個特定型態開啟震動(另外有一個對應的函式用來關閉震動)。Gonk對這個函式的實作在hal/gonk/GonkHal.cpp:

- -
void Vibrate(const nsTArray<uint32_t> &pattern) {
-  EnsureVibratorThreadInitialized();
-  sVibratorRunnable->Vibrate(pattern);
-}
-
- -

下面以VibratorRunnable::Run()實作的程式碼發送震動開啟請求到另一個執行緒,其中主要的迴圈部分如下:

- -
while (!mShuttingDown) {
-  if (mIndex < mPattern.Length()) {
-    uint32_t duration = mPattern[mIndex];
-    if (mIndex % 2 == 0) {
-      vibrator_on(duration);
-    }
-    mIndex++;
-    mMonitor.Wait(PR_MillisecondsToInterval(duration));
-  }
-  else {
-    mMonitor.Wait();
-  }
-}
-
- -

vibrator_on()便是打開震動馬達的Gonk HAL API,這個函式透過sysfs向內部核心驅動程式送出訊息,寫入值到核心物件之中。

- -

HAL API退回替代(Fallback)實作

- -

Gecko HAL API 跨平台支援。當為沒有震動馬達的平台(如桌上型電腦)建置Gecko,則另一個HAL退回替代API會被使用,這個替代API實作於hal/fallback/FallbackVibration.cpp:

- -
void Vibrate(const nsTArray<uint32_t> &pattern) {
-}
- -

沙箱(Sandbox)實作

- -

因為大多數的網頁內容都是在低權限的內容程序運行,所以我們無法確保這些程序有權限去,例如,打開震動馬達,除此之外,為了避免出現程序爭相啟動震動的狀況出現,採用中央控制的作法較為理想。在Gecko HAL,透過sandbox作法可以達到中央控制的目標;其實sandbox也就是一個由內容程序發出到Gecko"伺服器"的代理請求,這個代理請求式透過IPDL送出。

- -

以震動為例,這是由hal/sandbox/SandboxHal.cpp所實作的Vibrate()完成:

- -
void Vibrate(const nsTArray<uint32_t>& pattern, const WindowIdentifier &id) {
-  AutoInfallibleTArray<uint32_t, 8> p(pattern);
-
-  WindowIdentifier newID(id);
-  newID.AppendProcessID();
-  Hal()->SendVibrate(p, newID.AsArray(), GetTabChildFrom(newID.GetWindow()));
-}
- -

這會發送一個 PHal 介面定義的訊息,亦即IPDL的hal/sandbox/PHal.ipdl內所描述的。其中呼叫的函式大致如下:

- -
Vibrate(uint32_t[] pattern);
- -

訊息的接收端是HalParent::RecvVibrate()函式,這個函式定義在hal/sandbox/SandboxHal.cpp裡面,大致如下:

- -
virtual bool RecvVibrate(const InfallibleTArray<unsigned int>& pattern,
-            const InfallibleTArray<uint64_t> &id,
-            PBrowserParent *browserParent) MOZ_OVERRIDE {
-
-  hal::Vibrate(pattern, newID);
-  return true;
-}
- -

本段範例雖然有省略一些相關性不高的部分,不過確實的說明訊息傳遞是如何由Gecko到Gonk,再到Gonk HAL實作Vibrate(),最後到震動馬達驅動程式。

- -

DOM APIs

- -

DOM介面是網頁根本上和Gecko溝通的方法,如果想知道更多這方面的細節,請參考關於DOM。 DOM介面是用IDL定義的,其中包括了外部函式介面(foreign function interface, FFI)以及介於javascript和C++的物件模型(object model, OM) 。

- -

像是vibration API便是透過IDL讓網頁內容使用,這部分程式碼定義在nsIDOMNavigator.idl:

- -
[implicit_jscontext] void mozVibrate(in jsval aPattern);
- -

mozVibrate(冠有廠商前綴的函式,這個函式背後的震動規格尚未定案)接受jsval型態的參數,也就是Javascript的值。IDL編譯器xpidl,會產生C++的介面,這個介面會由Navigator.cpp內的Navigator類別實作之。

- -
NS_IMETHODIMP Navigator::MozVibrate(const jsval& aPattern, JSContext* cx) {
-  // ...
-  hal::Vibrate(pattern);
-  return NS_OK;
-}
- -

這個函式最關鍵的部分在於呼叫 hal::Vibreate() 將控制權由DOM移交給Gecko HAL,自此我們便會如前所述地進入HAL層,最後到達驅動程式。在上層的 DOM 並不在意現在是在哪個平台上執行(Gonk, WIndows, Mac OS X等等),DOM 也不在意現在是內容程序的程式碼在跑或是Gecko伺服器的在跑,所有的一切都交由底層系統處理。

- -

vibration API相對單純,適合用於說明,而SMS API 便是比較複雜的API,它用到自己的"遠端"層將內容程序和伺服器連接起來。

- -

無線介面層(Radio Interface Layer, RIL)

- -

The userspace process architecture段落已經提過RIL,這邊我們將更進一步檢視各個元件是如何互動運作。

- -

和RIL有關的元件有:

- -
-
rild
-
和特定數據機韌體溝通的背景程序(daemon)。
-
rilproxy
-
rild和Gecko b2g程序之間訊息傳遞的代理背景程序(daemon)。rilproxy的存在解決了無法和rild直接溝通的問題,因為rild只可以在radio群組內溝通。
-
b2g
-
實作Gecko的程序,又稱為chrome process。其中和RIL相關的部分有dom/system/gonk/ril_worker.js(這是一個worker執行緒,會透過rilproxy和rild溝通,並且實作了無線狀態機(radio state machine))以及nsIRadioInterfaceLayer介面(是主執行緒的XPCOM服務,主要是作為ril_worker.js和Gecko各元件,包括Gecko內容程序,之間的訊息傳遞)。
-
Gecko's content process
-
nsIRILContentHelper介面會提供XPCOM服務,有了這個服務,Gecko內容程序會使用到的DOM API,例如TelephonySMS API,便能夠和Chrome程序的無線介面溝通。
-
- -

範例: Example: Communicating from rild to the DOM

- -

讓我們來看看一段例子,看一下系統底層是如何和DOM程式碼溝通。當數據機接收到來電時,它會透過專屬機制通知rild,rild接著按照ril.h內定義的"open"協定發送訊息到rild客戶端,以來電通話為例,RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 訊息會被rild發送至rilporxy。

- -

實作在rilproxy.c的rilproxy會透過以下程式碼,和rild建立連線:

- -
ret = read(rilproxy_rw, data, 1024);
-
-if(ret > 0) {
-  writeToSocket(rild_rw, data, ret);
-}
- -

一旦從rild那裏取回訊息後,訊息便會經由連接rilproxy和Gecko的socket傳給Gecko,Gecko是藉由IPC thread接收訊息:

- -
int ret = read(fd, mIncoming->Data, 1024);
-// ... handle errors ...
-mIncoming->mSize = ret;
-sConsumer->MessageReceived(mIncoming.forget());
-
- -

訊息的接收端是SystemWorkerManager,然後訊息又會被重新打包發送到{source("dom/system/gonk/ril_worker.js", "ril_worker.js")}}執行緒,這個ril_worker.js實做了RIL狀態機(RIL state machine); 這其中的過程是透過 RILReceiver::MessageReceived()函式完成:

- -
virtual void MessageReceived(RilRawData *aMessage) {
-  nsRefPtr<DispatchRILEvent> dre(new DispatchRILEvent(aMessage));
-  mDispatcher->PostTask(dre);
-}
- -

訊息傳遞到ril_worker.js執行緒後,onRILMessage()函數接著會被呼叫。其中呼叫方法是利用Javascript API函式JS_CallFunctionName():

- -
return JS_CallFunctionName(aCx, obj, "onRILMessage", NS_ARRAY_LENGTH(argv),
-                           argv, argv);
- -

onRILMessage()定義在dom/system/gonk/ril_worker.js中;然後訊息會被切割成包裹,之後每一個包裹會被送給適當的處理函式:

- -
handleParcel: function handleParcel(request_type, length) {
-  let method = this[request_type];
-  if (typeof method == "function") {
-    if (DEBUG) debug("Handling parcel as " + method.name);
-    method.call(this, length);
-  }
-}
-
- -

ril_worker.js對每一個請求類型有實作一個同名的處理函式,所以程式碼能夠簡單地取得請求類型名稱,然後再比對是否有對應的函式存在,如果有便呼叫對應函式起來處理。

- -

RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED為例,下面的處理函式會被呼叫:

- -
RIL[UNSOLICITED_RESPONSE_CALL_STATE_CHANGED] = function UNSOLICITED_RESPONSE_CALL_STATE_CHANGED() {
-  this.getCurrentCalls();
-};
- -

當收到訊息通知後,通話狀態也跟著改變,所以狀態機接著呼叫getCurrentCall()取得目前通話狀態:

- -
getCurrentCalls: function getCurrentCalls() {
-  Buf.simpleRequest(REQUEST_GET_CURRENT_CALLS);
-}
- -

這樣會回傳一個請求給rild,要求目前所有進行中通話的狀態。這個請求會沿著RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 訊息之前所行進過的路走,只不過方向相反(從 ril_worker.jsSystemWorkerManager 、到 Ril.cpp、再到rilproxy,最後是 rild socket)。 rild 然後會回應請求,再回到ril_worker.js的REQUEST_GET_CURRENT_CALLS訊息處理器,整個過程是雙向溝通。

- -

通話狀態然後會被處理,和之前的狀態比較,如果狀態有變更,ril_worker.js 會再通知在主執行緒上的nsIRadioInterfaceLayer服務:

- -
_handleChangedCallState: function _handleChangedCallState(changedCall) {
-  let message = {type: "callStateChange",
-                 call: changedCall};
-  this.sendDOMMessage(message);
-}
- -

nsIRadioInterfaceLayer實作在dom/system/gonk/RadioInterfaceLayer.js,而訊息是透過onmessage()收到:

- -
 onmessage: function onmessage(event) {
-   let message = event.data;
-   debug("Received message from worker: " + JSON.stringify(message));
-   switch (message.type) {
-     case "callStateChange":
-       // This one will handle its own notifications.
-       this.handleCallStateChange(message.call);
-       break;
-   ...
-
- -

之後訊息會透過父程序訊息管理器(Parent Process Message Manager, PPMM)送到內容程序:

- -
handleCallStateChange: function handleCallStateChange(call) {
-  [some internal state updating]
-  ppmm.sendAsyncMessage("RIL:CallStateChanged", call);
-}
- -

內容程序透過nsIRILContentHelper 服務的receiveMessage()從子程序訊息管理器(Child Process Message Manager, CPMM)那裡接受訊息:

- -
receiveMessage: function receiveMessage(msg) {
-  let request;
-  debug("Received message '" + msg.name + "': " + JSON.stringify(msg.json));
-  switch (msg.name) {
-    case "RIL:CallStateChanged":
-      this._deliverTelephonyCallback("callStateChanged",
-                                     [msg.json.callIndex, msg.json.state,
-                                     msg.json.number, msg.json.isActive]);
-      break;
- -

接著,每一個電話callback物件的nsIRILTelephonyCallback.callStateChanged()方法會被呼叫;每一個有存取window.navigator.mozTelephony API的網頁應用程式會註冊這樣一個callback物件,這個callback物件會發送事件到網頁應用程式,如現階段通話物件狀態改變或有新通話來電事件。

- -
NS_IMETHODIMP Telephony::CallStateChanged(PRUint32 aCallIndex, PRUint16 aCallState,
-                                          const nsAString& aNumber, bool aIsActive) {
-  [...]
-
-  if (modifiedCall) {
-    // Change state.
-    modifiedCall->ChangeState(aCallState);
-
-    // See if this should replace our current active call.
-    if (aIsActive) {
-      mActiveCall = modifiedCall;
-    }
-
-    return NS_OK;
-  }
-
-  nsRefPtr<TelephonyCall> call =
-          TelephonyCall::Create(this, aNumber, aCallState, aCallIndex);
-  nsRefPtr<CallEvent> event = CallEvent::Create(call);
-  nsresult rv = event->Dispatch(ToIDOMEventTarget(), NS_LITERAL_STRING("incoming"));
-  NS_ENSURE_SUCCESS(rv, rv);
-  return NS_OK;
-}
- -

應用程式收到事件後可以跟著進行更新使用者介面等等:

- -
handleEvent: function fm_handleEvent(evt) {
-  switch (evt.call.state) {
-    case 'connected':
-      this.connected();
-      break;
-    case 'disconnected':
-      this.disconnected();
-      break;
-    default:
-      break;
-  }
-}
- -

更進一步的範例請見撥號應用程式的handleEvent()

- -

3G data

- -

有一個 RIL 訊息會向電信服務(cellular service)發起數據請求(data call),這會啟動數據機的數據傳輸狀態。數據請求會開啟 Linux 核心的Point-to-Point Protocol (PPP) 介面裝置,這個裝置能夠透過使用者介面設定。

- -

相關DOM APIs

- -

以下是和 RIL 溝通相關的DOM APIs:

- - - -

WiFi

- -

Firefox OS 的 WiFi 後端使用 wpa_supplicant 處裡大部份工作。所以說WiFi 後端的主要工作是管理請求者(supplicant),還有輔助一些任務,例如載入 WiFi 驅動程式和開關網路介面;從根本上來看,WiFi 後端就是一個狀態機(state machine),而其狀態會跟隨請求者狀態。

- -
-

Note: 許多 WiFi 有關的有趣東西都和 wpa_supplicant 程序可能的狀態變更息息相關。

-
- -

WiFi 元件的實作可以分成兩份檔案:

- -
-
dom/wifi/DOMWifiManager.js
-
實作網頁內容所看到的API;定義在 nsIWifi.idl.
-
dom/wifi/WifiWorker.js
-
實作狀態機和驅動請求者的程式碼。
-
- -

這兩份檔案利用訊息管理員(message manager) 溝通。 後端聆聽請求訊息,比如說"連接",然後回應訊息當請求行動完成後;DOM 端聆聽回應以及狀態改變和資訊更新的訊息。

- -
-

Note: 任何同步 DOM API 都會藉由快取資料來實作,同步訊息會盡量避免。

-
- -

WifiWorker.js

- -

這份檔案實作了 WiFi 介面背後的主要邏輯,由 SystemWorkerManager 喚起,然後運行在 chrome 程序裡(對多執行緒版本來說)。 WifiWorker.js 可以切成兩塊: 一個巨大無名函式與 WifiWorker;無名函式會產出 WifiManager,為本地提供 API,包含和請求者連線以及可取得的掃描結果等事件通知,它會回應請求的資訊,控管和請求者連線的細節,遵照 API 使用客戶的指示行動。

- -

WifiManager 和 DOM 中間是 WifiWorker 物件。WifiWorker 根據事件行動並且轉傳事件給 DOM,反過來,它也會收到 DOM 傳過來的請求,並且對請求者(supplicant)採取適當的動作,WifiWorker 也會維護請求者的狀態資訊和下不步行動的資訊。

- -

DOMWifiManager.js

- -

實作 DOM API,負責在呼叫方和 WiFi worker 之間傳遞訊息。

- -
-

Note: 為了避免和 chrome 程序之間同步訊息,WiFi Manager 需要根據收到的事件快取狀態。

-
- -

有一個同步訊息,那就是當 DOM API 初始化時為了取得請求者(supplicant)當下的狀態。

- -

DHCP

- -

DHCP 和 DNS 由標準 Linux DHCP 客戶端,dhcpcd,負責。當網路連線中斷後,因為無法運作,Firefox OS 會終止 dhcpcd,直到又重新連上網路,dhcpcd 會被再重啟。dhcpcd 也負責設定預設路徑(route)。

- -

Network Manager

- -

Network Manager 負責設定 3G 數據和 WiFi 元件的網路介面。

- -

程序與執行緒

- -

Firefox OS 採用 POSIX threads 實現所有應用程式的執行緒,這包括了應用成程式主執行緒、Web Worker 和輔助執行緒。Nice值決定了程序和執行緒的執行優先順序,然後再依賴 Linux 核心排程器先後執行;根據程序不同的狀態會有不同的Nice值。目前有7種Nice層級:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
程序執行優先順序
優先順序Nice用於
MASTER0主 b2g process
FOREGROUND_HIGH0持有 CPU wakelock 的程式
FOREGROUND1前景(foreground)程式
FOREGROUND_KEYBOARD1鍵盤程式
BACKGROUND_PERCEIVABLE7音樂播放背景(background)程式
BACKGROUND_HOMESCREEN18主畫面程式
BACKGROUND18其他背景程式
- -

有些層級的 Nice 值雖然一樣,不過記憶體不足時的終止行為不一樣。所有的優先順序可以在建置時調整,相關的程式碼請見b2g/app/b2g.js

- -

一個程序(process)之內,主執行緒繼承了該程序的 Nice 值,而 Web Worker 執行緒所得到的 Nice 值為主執行緒的加一點,所以優先權較低,這麼做是為了避免耗費 CPU 資源的worker 拖慢的主執行續的運作。程序優先順趣會因為事件發生而變化,比如說當一個程式由前景轉到背景時、一個新的程式啟動、現存程式取得 CPU wakelock,一旦程序的執行優先權變動,旗下所屬的執行緒的執行優先權也會跟著變動。

- -
-

Note: cgroups 目前沒有在資源管理用上,因為在某些裝置和核心上並不可靠。

-
- -

 

diff --git a/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/gaia_ui_tests_run_tests/index.html b/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/gaia_ui_tests_run_tests/index.html deleted file mode 100644 index 3924fbf5a6..0000000000 --- a/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/gaia_ui_tests_run_tests/index.html +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: Gaia UI Tests Run Tests -slug: Archive/B2G_OS/Automated_testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests -translation_of: Archive/B2G_OS/Automated_testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests ---- -
-

這個頁面尚未完成。請有志一同的夥伴幫忙補充。
- 有任何意見都可以寄到 gaia-ui-automation@mozilla.org。

-
-

Running Tests

-

    Basically, we can run gaia-ui-tests on a device with marionette server, emulators, and desktop B2G. However, please notice again that you should choose the right branch of gaia-ui-tests describing your B2G the best as we talked on previous section.

-

Testing on Devices

-

    First of all, connect your device through USB to computer, and then forward the package from the phone to computer port:

-
adb forward tcp:2828 tcp:2828
-
-

    You might get weird error, such as "no permission", from the command above. In that case, you could try to do the commands below:

-
adb kill-server
-sudo adb devices
-adb forward tcp:2828 tcp:2828
-
-

    It's almost all done before you start to run your tests! Before you start to run the test, read through this warning in order to start gaia-ui-tests correctly.
-     Now, you can send this command to execute all gaiatests:

-
gaiatest <gaia_ui_tests folder>/tests/ --address=localhost:2828 --type=b2g-xfail <your manifest file location>
-
-

    Or, if you want to run solely one file, just do:

-
gaiatest <file> --address=localhost:2828 --type=b2g-xfail <your manifest file location>
-
-

    After the test, you will see all the result on pass/fail. And, for each individual test, it might have more information that you can go through. Here are some common examples you might be able to see:

- - - - - - - - - - - - - - - - - - - - - - - -
Error Message Corresponding Actions
error: [Errno 111] Connection refusedreissue adb forward command
Element ... not visible before timeoutmake sure the element would display on the app you test
TimeoutException: Condition timed outmake sure the condition on the app is the same as your expectations
broken pipmostly bad marionette server issue
-

 

-

Testing on Emulator

-

Automatically launched emulator

-
-

TODO

-
-

Mannually launched emulator

-
-

TODO

-
-

Testing on Desktop B2G

-

    After you downloaded the Gaia UI test from GitHub, you also can use desktop build to run the tests. The Firefox OS desktop client, also called the B2G desktop client,  lets you run Gaia and Web apps in a Gecko-based environment somewhat  similar to an actual device. It doesn't emulate device hardware, so it's  not adequate for testing device APIs, and isn't a replacement for  testing on actual hardware. However, it does have a several APIs enabled  that aren't available on Firefox such as the Contacts and Settings  APIs. It can therefore be useful during the development of your  application, or while working on the Gaia user interface itself.

-

    You can download the latest build of the desktop client from this location, but make sure you download the appropriate file for your operating system.

- -
-

Note 1: Unfortunately, due to Bug 832469 the nightly desktop builds do not currently work on Windows, so you will need either Mac or Linux to continue :

-

Note 2: If you do not have the required operating systems installed on your machine, a virtual machine is fine as well.

-
-

    Once downloaded, you will need to extract the contents to a local folder. For the purposes of the rest of this guide, I’ll refer to this location as $B2G_HOME.
- Add the following line to your gaia/profile/user.js file,

-
user_pref('marionette.force-local', true)
-

which on :

- -

    Because we’re running against the desktop client we must filter out all tests that are unsuitable. To run the tests, use the following command:

-
gaiatest --address=localhost:2828 --type=b2g-antenna-bluetooth-carrier-camera-sdcard-wifi-xfail <your manifest file location>
-
-

Test Variables

-

    There is one warning previously mentioned here. Please do read the warning before you setup your json test variables file.

-

    We use the --testvars option to pass in local variables, particularly those that cannot be checked into the repository. For example in gaia-ui-tests these variables can be your private login credentials, phone number or details of your WiFi connection.

-

    To use it, copy testvars_template.json to a different filename but add it into .gitignore so you don't check it into your repository.

-

    When running your tests add the argument: --testvars=(filename).json

-

Variables

-

this_phone_number (string) The phone number of the SIM card in your device. Prefix the number with '+' and your international dialing code.

-

remote_phone_number (string) A phone number that your device can call during the tests (try not to be a nuisance!). Prefix the number with '+' and your international dialing code.

-

wifi.ssid (string) This is the SSID/name of your WiFi connection. Currently this supports WPA/WEP/etc. You can add WiFi networks by doing the following (remember to replace "KeyManagement" and "wep" with the value your network supports) :

-

"wifi": { "ssid": "MyNetwork", "keyManagement": "WEP", "wep": "MyPassword" }

-

WPA-PSK: "wifi": { "ssid": "MyNetwork", "keyManagement": "WPA-PSK", "psk": "MyPassword" }

-

Marketplace: "marketplace": { "username": "MyUsername", "password": "MyPassword" }

-
-

Due to Bug 775499, WiFi connections via WPA-EAP are not capable at this time.

-
-

 

-

Test Parameters

-

    As you see in the last command we gave out on previous sections, there are many test variables for you to know. You can do this to get more information:

-
gaiatest --help
-

 

-

Test Data Prerequisites

-

Occasionally a test will need data on the hardware that cannot be set during the test setUp. The following tests need data set up before they can be run successfully:

-

test_ftu Requires a single record/contact saved onto the SIM card to test the SIM contact import

-

 

-

Go to "Writing Tests" section

-

 

diff --git a/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/index.html b/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/index.html deleted file mode 100644 index 2c11cea761..0000000000 --- a/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Gaia UI Tests Guidelines -slug: Archive/B2G_OS/Automated_testing/gaia-ui-tests -translation_of: Archive/B2G_OS/Automated_testing/gaia-ui-tests ---- -
-

Gaia-ui-tests 是 Mozilla 的一套用於自動測試 Gaia UI 的架構。所有的測試都是以 Python 撰寫,佐以少數的 Javascript 來與 Firefox OS 的 API 溝通。此一系列的教學文章將會描述如何設定環境、撰寫及執行測試。

-
-

Gaia-ui-tests uses Gaiatest, a Python package based around Marionette. Gaiatest is designed to wrap HTML locators, Marionette calls and API calls together for interoperble communication and functionality. Marionette is based on the W3C standard developed for the Selenium WebDriver a programming interface for browser automation. If you have used WebDriver and page/app objects before then you will find using Marionette and gaiatest easy.

-

Getting started with Gaia UI tests

-

For those keen to get started with automated testing on Gaia/Firefox OS we have a tutorial series that will help you go from nothing to writing your own tests. Once you've completed this tutorial you'll have enough knowledge of testing, Firefox OS and Marionette to get started as a Mozilla tests contributor. It is highly recommended that you complete this tutorial if you wish to become a contributor.

-
-
- Part 1: Getting started with Marionette and Firefox OS
-
- This article covers installing the tools you need to get started with running tests, such as B2G Desktop, Python and Marionette.
-
- Part 2: Basic interactions with Firefox OS using Marionette
-
- An overview of the basic commands you will use to manipulate Firefox OS via Marionette.
-
- Part 3: Upgrading our code into a reusable test
-
- Moving on, in this article we will assemble some basic commands into a simple test inside a Python file so they can all be run as a single entity.
-
- Part 4: Re-using commands to set up Firefox OS
-
- Here we look at moving some of the commands into Python methods to promote code reuse.
-
- Part 5: Introducing a test runner
-
- A test runner is a central feature of any good test suite, allowing you to run multiple tests and report and aggregate results. In this article we will explore the basics of Python's unittest runner.
-
- Part 6: Using tuples, and Marionette's By class
-
- This time around we explain how to further reduce duplication of code, by storing repeated locators in tuples and simplifying the syntax with Marionette's By class.
-
- Part 7: Writing your own tests
-
- Now the basics and behind you, and it is time to start to writing your own tests! Here we give you some tool recommendations to make the work easier, and suggest some tests to try your hand at writing.
-
- Part 8: Using a base class
-
- In its current state, our test file contains all the test runner code. This is ok for now, but as soon as you start to run many test files it will mean a lot of duplication. Here we solve this problem by abstracting the test runner code into a separate Python class.
-
- Part 9: Reducing duplication with app objects
-
- As a final improvement to the code's maintainability, in this article we explore abstracting code that handles interaction with specific Firefox OS apps out into Python app objects.
-
-

Advanced topics

-

One you've got the basics of writing and running tests under your belt, you way want to move on to some more involved or advanced work, such as running the full gaia-ui-tests tests suite, or logging power draw as the result of a test.

-
-
- Running the gaia-ui-tests
-
- Guides to running the gaia-ui-tests suite against real Firefox OS devices and B2G Desktop in a variety of configurations.
-
- Gathering Power Draw
-
- How to use gaiatest to log power draw while a test is running.
-
-

See also

-

Gaia-ui-tests main repository

-

Questions/Comments/Concerns

-

This project is at a fairly early stage, and your feedback would be greatly appreciated:

- diff --git a/files/zh-tw/archive/b2g_os/automated_testing/index.html b/files/zh-tw/archive/b2g_os/automated_testing/index.html deleted file mode 100644 index 66f4eb520d..0000000000 --- a/files/zh-tw/archive/b2g_os/automated_testing/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: 測試 Boot to Gecko -slug: Archive/B2G_OS/Automated_testing -translation_of: Archive/B2G_OS/Automated_testing ---- -

因為 Boot to Gecko 還在開發中,不久的將來即將有對新硬體的支援,因此如何做測試就是很重要的事情。這個頁面提供了從多種方面測試 Boot to Gecko 的文章及資訊。

- - - - - - - -
-

Unit testing

- -
-
-

Miscellaneous testing topics

-
-
- Debugging OpenGL
-
- How to debug OpenGL code on Boot to Gecko.
-
- Feature support chart
-
- A chart of what features are supported by the different builds of Boot to Gecko.
-
-

Marionette for Boot to Gecko

- -

Gaia Unit Tests

- -

Marionette Tutorials

- -

Writing Tests For Marionette

- -

View All...

-
-

Getting help from the community

-

If you're working with Boot to Gecko, or developing applications you'd like to run on Boot to Gecko based devices, there are community resources to help you!

- -
    -
  • Ask your question on the Mozilla IRC channel: #b2g
  • -
-

Don't forget about the netiquette...

-
- - -
-

 

diff --git a/files/zh-tw/archive/b2g_os/building/index.html b/files/zh-tw/archive/b2g_os/building/index.html deleted file mode 100644 index 9e5c54202c..0000000000 --- a/files/zh-tw/archive/b2g_os/building/index.html +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: 建置 Boot to Gecko -slug: Archive/B2G_OS/Building -translation_of: Archive/B2G_OS/Building ---- -
-
-

當您已經建立好編譯的系統、第一次成功地抓了程式碼以及設定好程式碼,您就可以編譯 Boot to Gecko。

-

更新程式碼

-

如果您不是第一次編譯B2G,您需要在編譯之前先抓取最新的程式碼。您可以執行以下指令來更新B2G工具及相依套件:

-
git pull
-./repo sync
-
-

您可以藉由指定名稱來更新某部分的倉儲:

-
./repo sync gaia
-
-

repo指令也有其他您可能會有興趣的選項可用;您可執行 repo help 指令來獲取有用的資訊。

-

編譯

-
-

注意:在編譯前,您可以設置一個 .userconfig 檔案來訂製這次編譯。使用 .userconfig 檔案來客製 有更多詳細資訊。

-
-

執行 build.sh 就可以開始編譯 Boot to Gecko:

-
cd B2G
-./build.sh
-
-

是時候該再喝杯咖啡,或小睡一下了(尤其是第一次編譯)。

-

專程編譯某些模組

-

如果您只想要編譯某個模組,例如 Gecko,您可以指定名稱:

-
./build.sh gecko
-
-

您也可以用這個指令來取得您編譯的模組的列表:

-
./build.sh modules
-
-

設定要使用的處理器數目

-

B2G 的編譯 scripts 預設使用系統的 cores 數量加二作為平行工作的數量。您可以再執行 build.sh 的時候指定 -j 參數來改變這個預設值。如果您想要把編譯工作丟到背景、並且減輕 CPU 負載來做其他事情的話,這對您就很方便。當您面臨到編譯問題時,如果您一次就只執行一個編譯工作的話、設定處理器數目也可以讓您更容易讀取編譯的錯誤輸出,真的很方便。

-

舉例來說,設定同時只會有兩個工作來編譯:

-
./build.sh -j2
-
-

對於此對常見的使用案例就是防止不要平行編譯。這會讓編譯的輸出更加容易閱讀,更容易釐清編譯的問題。執行下面指令:

-
./build.sh -j1
-
-

多語系編譯

-

建立多語系的編譯版本:

-

Gaia

-
    -
  1. 決定要用哪個 Gaia 語系檔。這邊我們用 locales/languages_dev.jsonlocales/languages_all.json 當做我們 Gaia 的語系檔。
  2. -
  3. Clone the appropriate locales
  4. -
  5. http://hg.mozilla.org/gaia-l10n 複製適當的語系到目錄下;這裡我們放於 gaia-l10n/ 下。接著您會需要將列於語系檔之內的美個語系的倉儲(repo)都複製下來。
  6. -
  7. 您需要將上面步驟二目錄的絕對路徑設定在 LOCALE_BASEDIR 環境變數中。也要把步驟一中檔案的絕對路徑設定在 LOCALES_FILE 環境變數中。
  8. -
-

如例:

-
export LOCALE_BASEDIR=$PWD/gaia-l10n
-export LOCALES_FILE=$PWD/gecko/gaia/shared/resources/languages-dev.json
-
-

Gecko

-
    -
  1. 決定要用哪個 Gecko 語系檔。這邊我們用 b2g/locales/all-locales 當做我們的 Gecko 語系檔。
  2. -
  3. 複製適當的語系到目錄下;像是 gecko-l10n/ 。 - -
  4. -
  5. 複製 compare-locales.
  6. -
  7. -

    將步驟二目錄的絕對路徑設定在 L10NBASEDIR 環境變數中。將步驟一中的語系以空白分隔方式設定在 MOZ_CHROME_MULTILOCALE 環境變數中。

    -
  8. -
  9. -

    compare-locales/scripts 目錄加入到 PATH 變數、 compare-locales/lib 加入到 PYTHONPATH 變數中.

    - 如例: -
    export L10NBASEDIR=$PWD/gecko-l10n
    -export MOZ_CHROME_MULTILOCALE="ja zh-TW"
    -export PATH="$PATH:$PWD/compare-locales/scripts"
    -export PYTHONPATH="$PWD/compare-locales/lib"
    -
    -

    當您完成這些設定之後,就可以執行 build.sh 了。

    -

    看起來您也可以用 .userconfig 來做這些事情。

    -

    當我們整理好之後,可能會修改這些指令。

    -
  10. -
-

已知的錯誤

- -

當您的 gcc 版本太新的時候會出現這個錯誤。請安裝 gcc/g++/g++-multilib 4.6.x 版本.

-

設置您的編譯環境 有更多資訊。

-
-

社群上的提醒: 用 4.7.x 加上修改一些 B2G 程式碼可能可以 (gcc 會告訴你要改哪些地方) 但是這邊就沒人能幫你了!但是不改就不會碰到這些問題。

-
- -

如果看到這個訊息,通常是代表記憶體不夠。在執行 ./build.sh 之前請確認有足夠的記憶體,如果您的系統記憶體有4G的話,應該可以跑的很順利。

- -

有時候(尤其是在作業系統或是編譯工具更新後)您在編譯系統執行編譯後測試時,會碰到一些靈異現象就像下面這樣:

-
Generating permissions.sqlite...
-test -d profile || mkdir -p profile
-run-js-command  permissions
-WARNING: permission unknown:offline-app
-WARNING: permission unknown:indexedDB-unlimited
-build/permissions.js:122: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPermissionManager.add]
-make[1]: *** [permissions] Error 3
-make: *** [gaia/profile.tar.gz] Error 2
-

這種情況下試著刪除 gaia/xulrunner-sdk 目錄然後再重新抓程式碼:

-
rm -r gaia/xulrunner-sdk
-
-

這樣會刪掉由編譯系統自動抓取、預先編譯的 XULRunner;在下一次編譯的時候,XULRunner 會再被自動抓取一份。

-

接著的步驟

-

在編譯後,下個步驟就取決於您編譯的 Boot to Gecko 是給模擬器還是給實體手機;細節請參考下列文章:

- diff --git a/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/firefox_os_build_process_summary/index.html b/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/firefox_os_build_process_summary/index.html deleted file mode 100644 index 0dc0cd18b7..0000000000 --- a/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/firefox_os_build_process_summary/index.html +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Firefox OS 建置程序摘要 -slug: >- - Archive/B2G_OS/Building_and_installing_Firefox_OS/Firefox_OS_build_process_summary -translation_of: Archive/B2G_OS/Building_and_installing_B2G_OS/B2G_OS_build_process_summary ---- -
-

建置和安裝Firefox OS需要大量的時間,網路頻寬和電腦計算能力。不幸的是,一路上事情很容易出問題,所以此頁面列出了建置的目標和步驟,希望可以在用戶建置的過程中幫上忙至於每一步驟的細節,會在其他文件討論

-
-
-

注:Firefox OS建置過程會提及到“B2G”或“Boot2Gecko”。“Boot2Gecko”是Firefox OS專案的原始代號名稱。

-
-

建置目標:4個“映像”檔

-

建置的目標是建立4個可以被複製到Firefox OS設備的映像檔。

- - - - - - - - - - - - - - - - - - - -
boot.imgLinux核心和根檔案系統映像檔(root filesystem image),後者提供一套可用的基本Unix工具。
system.imgFirefox的操作系統核心,包括部分Gonk,Gecko的接口,可執行b2g檔。
userdata.img -

使用者的Gecko profile以及Gaia網頁應用程式。

-
recovery.imgLinux核心和根檔案系統映像檔,另外還有簡單的工具,好讓使用戶能夠從問題中修復
-

一旦四個映像檔產生好後,它們可以被轉移到一個裝置。

-

Firefox OS是建立在Android開源專案上(Android Open Source Project, AOSP)。AOSP的ADBfastboot工具提供了十分好用的方法來存取和操作設備。值得一提的是adb reboot-bootloader命令可以讓已經連接上的裝置重開機,並且暫停至bootloader早期階段,在這個早期階段中可以下fastboot flash $partition $image命令,把映像檔複製到裝置之上

-

開機映像檔(The Boot image)

-

boot.img(開機映像檔)包含Linux核心和初始根磁碟分區,boot.img提供核心軟體工具和初始化腳本。為了效率考量,初始根磁碟分區會被複製到記憶體之中,因此被稱為“ramdisk”。boot.img將被複製到設備上的“啟動”(boot)分區,而在裝置的檔案系統運作時,ramdisk的內容是可以在根目錄底下看見,比如說下adb shell指令

-

boot.img還在根目錄下的default.prop建立了root用戶的權限

-

另外也可以通過檔案檢查,分割檔案到核心和ramdisk映像檔,修改從ramdisk映像抓出來的內容,並重新組裝ramdisk映像檔,然後重新建置boot.img,這樣來修改現存的開機映像檔 。例如請參考Alcatel One Touch Fire Hacking (Mini)指南。

-

可以在安裝開機映像檔前測試開機映像檔。首先讓裝置開機後暫停於bootloader,然後下fastboot boot /some/path/to/boot.img命令來開機進入尚未安裝的boot.img。

-

系統映像

-

系統映像檔(system.img)是Firefox OS的核心:

- -
-

關於平台架構的更多資訊,請見Firefox OS平台指南。

-
-

system.img會被複製到system分區,而在檔案系統運作時會在/system/目錄底下。

-
-

:system.img提供了許多裝置會用到的二進位大型物件(BLOB),特別是RIL(Radio Interface Layer)的blob控制了設備上的蜂巢式行動網路(cellular radio network)。

-
-

用戶資料映像檔

-

用戶資料應像檔(userdata.img)提供了運行中載入的各種Gaia應用程式。

-

userdata.img會被複製到裝置的userdata分區,然後檔案系統運作時會在/data/目錄底下。值得一提的是/data/b2g/目錄含有使用者的Gecko profile,而/data/local/webapps/目錄則含有使用者實際可以用的網頁應用程式

-

復原映像檔

-

復原映像檔(recovery.img)包含了和boot.img相同的核心和類似的ramdisk。然而,recovery.img採用不同的初始化腳本,所以使用者會被導引到另一個介面,這個介面會有可以透過裝置實體按鍵來操作的復原指令。

-

recovery.img會被複製到recovery分區,檔案系統運作時並不會掛載復原映像檔。

-

構建過程:準備,設定,建置,安裝

-

建置和安裝Firefox OS的整個過程包括四個步驟:

- - - - - - - - - - - - - - - - - - - -
準備取得建置需要的程式和檔案,如正確的編譯器和函式庫。
配置下載原始碼,並創建.configure檔定義環境變數,例如路徑等。
建置 -

建置使用者的Gaia個人檔案和Gaia網頁應用程式。

-
安裝在設備上安裝檔案。
-

 

-

準備

-

一開始需要準備好建置需要的程式和檔案,如正確的編譯器和函式庫

-

這個步驟可以通過手動執行或使用腳本來完成。詳情將在建置Firefox OS的先決條件頁面討論

-
-

:在UNIX和類UNIX的機器,我們可以利用which指令,搭配需要的程式名稱當作變數,來檢查這些需要的工具是否存在。

-
-

設定

-

接著我們需要複製一份Firefox OS(B2G)的原始碼,通常可以透過git從B2G專案那裡複製一份,另外我們也需要產生一份.config檔,這個檔案會定義建置用的變數。

-

設定會執行config.sh腳本。詳情請見準備進行首次B2G建置頁面。

-

configure腳本需要一個參數,指定建置的裝置種類。建置名稱是和CPU架構而非裝置相關的代碼名稱,目前可取得的代碼名稱請見這裡

-

設定步驟也將使用Android開源專案的repo工具,來下載(或更新)建置的原始碼到/repo/project目錄下。這個步驟會下載大量的檔案並且花費不少時間。

-

建置

-

建置步驟實際上將編譯所有的原始碼,並且生成的映像檔。

-

建置會執行build.sh腳本。詳情請見建置Firefox OS頁面。

-

基本上建置十分單調,這個步驟就是從AOSP工具、到Linux核心、到Gaia網頁應用程式把一切都建置起來,而且有時候很不好判斷是那一個環節出錯導致建置失敗。

-

我們可以只建置全部的某一部份,例如執行建置腳本時只帶入gecko參數,就會只建置Gecko系統,相同地,只帶入gaia參數,就只會建置Gaia。這些分別建置的部份可以分別地被安裝到裝置上。

-

另外,也可以建置之前所討論的映像檔,例如建置系統映像檔可以這樣建置./build.sh out/platform/$target/system.img,其中$target參數和設定步驟中所提供的參數相同。

-

安裝

-

安裝的步驟會將新編譯的程式碼放置到設備上。這個步驟會執行flash.sh腳本。

-

如果只要安裝那些在建置步驟中分別被建置的部份,我們可以通過在執行falsh.sh時多帶入一個參數,例如./falsj.sh gaia就只會安裝Gaia網頁應用程式。

diff --git a/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/index.html b/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/index.html deleted file mode 100644 index f01f67100c..0000000000 --- a/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: 建置並安裝 Firefox OS -slug: Archive/B2G_OS/Building_and_installing_Firefox_OS -translation_of: Archive/B2G_OS/Building_and_installing_B2G_OS ---- -

由於 Firefox OS 現正積極開發中,而且仍處於預先發佈的階段。如果要確保自己安裝的是最新版本,最好能自己動手建置並安裝。透過此頁面所整理的文章,你可在模擬器或相容裝置上建置並安裝 Firefox OS,或於 Firefox 瀏覽器上安裝 Gaia 使用者介面。

-

- - - - - - - -
-

取得並建置 Firefox OS

-
-
- Firefox OS 必備建置條件
-
- 首次建置 Firefox OS 時的必要步驟。
-
- 準備首次建置 Firefox OS
-
- 在建置 Firefox OS 之前,必須先複製 Firefox OS 的 Repo 並完成細部設定。本篇文章將解釋相關細節。
-
- 建置 Firefox OS
-
- 建置 Firefox OS 的方法。
-
- 匯入 Firefox OS
-
- 將 Firefox OS 匯入新裝置的相關資訊。
-
-

全部文章...

-
-

安裝 Firefox OS 及/或 Gaia

-
-
- 選擇 Gaia 或 Firefox OS 的執行方式
-
- 可於 Firefox 中執行 Gaia;亦可於行動裝置或桌面版模擬器中執行 Firefox OS。本篇指南將協助你根據自己需要,找出最適合的方式。
-
- 在 Firefox 中執行 Gaia
-
- 於 Firefox 桌面版瀏覽器中執行 Gaia。
-
- 使用 Firefox OS 桌面用戶端
-
- 執行並使用 Firefox OS 桌面用戶端;即是在桌面版應用程式中模擬 Gaia 環境。相較於 Firefox 中執行 Gaia,此種方式雖然更精確,但仍不如模擬器所達的精確度。
-
- 使用 Firefox OS 模擬器
-
- 本指南將說名 Firefox OS 模擬器的建置與使用方式,及使用何種模擬器的適當時機。
-
- 於行動裝置上安裝 Firefox OS
-
- 在實際的行動裝置上安裝 Firefox OS。
-
- 在 SGS2 上的 Firefox OS 與 Android 雙重開機
-
- 於 Samsung Galaxy S2 上建立 Firefox OS/Android 雙重開機環境的方法。
-
-
-

 

diff --git a/files/zh-tw/archive/b2g_os/choosing_how_to_run_gaia_or_b2g/index.html b/files/zh-tw/archive/b2g_os/choosing_how_to_run_gaia_or_b2g/index.html deleted file mode 100644 index 20566a839b..0000000000 --- a/files/zh-tw/archive/b2g_os/choosing_how_to_run_gaia_or_b2g/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: 選擇如何運作 Gaia 或 B2G -slug: Archive/B2G_OS/Choosing_how_to_run_Gaia_or_B2G -translation_of: Archive/B2G_OS/Choosing_how_to_run_Gaia_or_B2G ---- -

根據各別的需求,當您以 Boot to GEcko 或是 Gaia 使用者介面時、您會思考各種選項及組合。您可以挑出接著列出的這些選項;每個選項都需要考慮其優缺點,有些會比其他的更具延展性。

-

在 Firefox 中運作 Gaia

-

如果您很清楚您在做什麼的話,您可以複製 Gaia 的 repository 並且 在 Firefox 15 或以上版本中運作 Gaia.

-

優點

- -

缺點

- -

為什麼要在 Firefox 中運作 Gaia

-

有兩個很重要的理由會讓您不在行動裝置或模擬器、而是在 Firefox 上運作 Gaia;容易開始著手開發和運作、也可以使用 Firefox 中優秀的開發者工具。如同要了解 Gaia 的 hackers 一般,開發者一開始測試 apps 的 UI 和基本功能的時候會享受到這極大的好處。

-
- Note: 在開始配送 app 之前,您絕對會需要在實體的行動裝置上做測試。
-

在桌面環境中運作 B2G (模擬器)

-

可以自己建置一個 Boot to Gecko 模擬器,並且在上面運作 Gaia。這個軟體雖然是以 Firefox 為基礎,但和行動裝置上的 Boot to Gecko 的行為非常類似。現在 Mozilla 提供 nightly 版本的模擬器給開發者,且這項工作在 bug 744008 裡持續追蹤著。如果您熟悉建置 Firefox code-base 或是 C++ 專案的話,您可以 依循這些步驟 自己建置這個應用程式。

-

優點

- -

缺點

- -

為什麼要運作 B2G 模擬器

-

這是一個不錯且折衷的測試和開發解決方案。對於將您的 app 或是其他程式碼放在近似行動裝置的環境中、卻不用再每次測試時都燒進手機而言,是一個不錯的方案。

-
- Note: 在開始配送 app 之前,您絕對會需要在實體的行動裝置上做測試。
-

在行動裝置上運作 B2G

-

對於測試 B2G 或 Gaia 環境、或是您的 web app 而言,最徹底的方式是建置並將 Boot to Gecko 安裝在實體的行動裝置上。同時這也是最複雜的處理程序。

-

優點

- -

缺點

- -

為什麼要在行動裝置上運作 B2G

-

對於在 B2G 或 Gaia 上測試任何程式或網頁專案而言,這毫無疑問地是最精準的方式。經由在實際的行動裝置硬體上執行,您可以確認您的專案表現及顯示都相當良好,並且都可以正確地使用所有的行動裝置 APIs。另外,在您開始配送任何程式之前,您應該一定要在實體行動裝置上測試;沒這樣做的話,一定會不幸地發生一些難以預測的影響。

diff --git a/files/zh-tw/archive/b2g_os/debugging/index.html b/files/zh-tw/archive/b2g_os/debugging/index.html deleted file mode 100644 index 1084a2f201..0000000000 --- a/files/zh-tw/archive/b2g_os/debugging/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: 在 Boot to Gecko 上除錯 -slug: Archive/B2G_OS/Debugging -translation_of: Archive/B2G_OS/Debugging ---- -

基本上,在 B2G 有兩種除錯的方法。開發者可以在電腦上藉由 Firefox 15 以上的版本來 執行 Gaia (以及很多相容於 B2G 的 web apps )來進行高階的除錯。這樣會讓開發者可以利用 Firefox 裡面優秀的 開發工具 開發工具來幫忙除錯,就像是在抓 web app 的 bug 一樣。

-

開發者也可以在 gdb 除錯器的控制之下,使用自己的行動裝置來執行 B2G。

-

使用 Firefox 除錯 Gaia 和 web apps

-

<快馬加鞭中,請耐心等待>

-

使用 gdb 除錯 B2G

-

用 gdb 來對 Boot to Gecko 除錯很簡單。只要用 run-gdb.sh 這個 script 指令,就會重新啟動 B2G 並在 gdb 的控制之下執行:

-
./run-gdb.sh
-
-

如果 B2G 已經在執行了,而現在只想要 attach,就要執行下面這個 script 指令:

-
./run-gdb.sh attach
-
-

OOP

-

首先,用「MOZ_DEBUG_CHILD_PROCESS=1 ./run-gdb.sh」啟動 b2g,接著當啟動 OOP app 的時候,會顯示 plugin-container 的 PID。使用<./run-gdb.sh attach PID>啟動第二個 gdb instance。

-

必須在很短的時間之內啟動除錯器的第二個 instance,且在啟動的短時間之內,就要按 c 繼續。

-

更多...

-

我們需要在這裡添加更多內容。

diff --git a/files/zh-tw/archive/b2g_os/firefox_os_build_prerequisites/index.html b/files/zh-tw/archive/b2g_os/firefox_os_build_prerequisites/index.html deleted file mode 100644 index dd2fd2efb5..0000000000 --- a/files/zh-tw/archive/b2g_os/firefox_os_build_prerequisites/index.html +++ /dev/null @@ -1,606 +0,0 @@ ---- -title: Firefox OS build prerequisites -slug: Archive/B2G_OS/Firefox_OS_build_prerequisites -translation_of: Archive/B2G_OS/B2G_OS_build_prerequisites ---- -
-

在您開始取得程式碼並建立您的Firefox OS作業系統以前,需要一個設定正確的編譯環境,請參考build system這個頁面,裡面有詳細的說明。這裡簡單的提一下,您可以在64位元的Linux以及OS X上面作編譯。

-
- -
-

: 若您計畫編譯一個Firefox OS並裝載在一隻手機上,請確認該手機在編譯動作開始時"並未"跟您的電腦連接,正確的連結時機會在詳細步驟中說明。

-
- -

支援的裝置或模擬器

- -

您需要一個目標來裝載您建立的Firefox OS,他可以是一個真實的裝置或是一個模擬器。我們支援數種裝置但一個裝製常常有多種的版本,這樣的情況我們只支援特定的版本。另外不同的裝置我們的支援程度也稍有不同。

- -
-

註:Mozilla的B2G source code是一個B2G的參考實現,而手機製造商是可以自由的為他們的手機做出patch以及修改的。舉例來說,您在市場上購買的Alcatel One Touch這隻手機裡面的B2G就是一個製造商的版本。這樣B2G版本的差異安裝在上面的應用程式是沒有差異的,不過在平台這一層是有一些差別的。由於Nexus 4的版本是直接由Mozilla維護的,因此跟其他第三級支援裝置比較起來我們各版本的Gecko應該更能直接在Nexus 4上直接無問題的使用。

-
- -

第一級支援裝置

- -

第一級支援裝置是一些主要開發用的裝置,因此一般來說能得最快的新功能與新的bug fixes。

- -
-
Keon
-
Keon 即為 Geeksphone Keon 裝置, 也是最初的開發機種中的一個。 請注意這個裝置上的Forefox OS是由 Geeksphone提供.
-
Inari
-
Inari 是另外一個測試裝置. 在您建立Firefox OS給ZTE Open的裝置時請使用這個configuration (configuration的細節後面會提到)。注意: 較新版本的Firefox版本可能會無法在ZTE Open手機的default boot partition中開機成功。
-
Flame
-
Flame 是 Mozilla 最新的 Firefox OS 標準參考開發裝置,除了Flame這隻手機以外,在您建立給 ZTE Open C 這個裝置的Firefox OS時請也在configuration 中選用Flame(configuration 的細節後面會提到)。 兩隻手機都用一樣的設定原因是他們都是基於 Android jellybean。
-
模擬器 (ARM 與 x86)
-
有兩種模擬器,一種是模擬ARM code,另外一種直接用x86 code執行所有的功能. 更多相關資訊請參考Learn more about installing and using the emulators.
-
請注意基本上您應該不要使用 x86 模擬器 — 這個模擬器安裝不易而且支援的程度不是很理想。
-
桌面 client 程式
-
您也可以建立一個桌面版本的Firefox OS; 這個版本是讓 Gecko 跑在一個 XULRunner 程式裡面讓您可以使用 Gaia 提供的使用者界面.
-
Flatfish
-
Flatfist 是第一隻 Firefox OS 平板版本,雖然某些功能像是Web Telephony 沒有辦法使用。在編譯 Flatfish 時,會需要一些額外的設定
-
- -

另外雖然可能很顯而易見,還是提一下您在建立 桌面 client 程式 或任意一個 模擬器 時是不需要手機的。

- -

第二級支援裝置

- -

一般來說,Firefox的功能在第二級支援裝置上都是可用的,這一些裝置被許多開發者使用(特別是應用程式開發者),因此並不需要太過即時的得到Firefox OS上新的改變。

- -
-
Samsung Nexus S
-
已知的 Nexus S 支援型號為 GT-I9020A 以及 GT-I9023,其他的型號可能可以支援
-
Samsung Nexus S 4G
-
SPH-D720 這個型號被當作第二級的支援裝置
-
- -

第三級支援裝置

- -

給這一些裝置的Firefox OS是可以被建立的,不過工程師並不會時常用這一些裝置做開發,因此穩定度與功能上面會明顯的比前兩級的支援裝置要不足。

- -
-
Samsung Galaxy S2
-
只有i9100這個型號是被正式支援的。(i9100P 應該也可以支援因為差異只在 NFC 晶片)
-
Samsung Galaxy Nexus
-
現在看起來所有的型號都可以支援
-
Nexus 4
-
有一些在 IRC 上的使用者測試並成功過。 如果機器本身是 Android 4.4 也許需要降回 4.3 (Android images available from Google)
-
Nexus 5
-
一些在 IRC 上的使用者測試並成功過。
-
Tara
-
Tara 是另一之測試裝置. Tara 的 manifest 只在 master branch. 取得 Tara 的 script 為 "BRANCH=master ./config.sh tara"。
-
Unagi
-
Unagi 用來當作中低階智慧型手機的測試與開發裝置。很多 Firefox OS的開發者使用 Unagi 作開發。
-
Pandaboard
-
Pandaboard 是一片基於 OMAP 4 架構的開發板,作為在各種不同行動平台的開發使用。
-
- -
重要: 只有基於 Android 4 (aka Ice Cream Sandwich) 以上的裝置才被支援。若您手上的裝置是上面提到的其中之一但 Android 的版本比較舊,請務必在做任何動作前先將它升級。
- -
-

: 第二級與第三級支援裝置沒有硬體的 Home 按鈕,不過會有一個軟體的 Home 按鈕

- -

所有第一級支援裝置都有一個硬體的 Home 按鈕,這個按鈕可以讓使用者直接回到 Home screen。現在市面上大多數基於 ICS 的 Android 裝置使用在螢幕上的觸碰按鍵。我們現在提供一個虛擬的 Home 按鈕給這一些缺少硬體按鍵的裝置。若您發現這個虛擬的 Home 按鈕沒出現,請打開 Setting 程式,然後到 Developer settings 並選取 Enable software home button

- -

在 Firefox OS 1.4 版有另外一個 developer option 叫做 "Home gesture enabled"; 開啟這的選項表示虛擬的 Home 按鈕將消失,取而代之的是一個由螢幕下方向上滑動的手勢。

-
- -

使用 GNU/Linux 的需求

- -
-

重要: 即使您沒有要編譯自己的 Boot 2 Gecko,而只有要使用到 Gaia's make system,  您仍需要正確版本的 PythonNode.js

-
- -

在 Linux 建立 Firefox OS, 您需要:

- - - -

這其實比最低需求要高不過常常在建立 Firefox OS 的過程出現問題只是因為資源不太夠。一個常見的例子為 "arm-linux-androideabi-g++: Internal error: Killed (program cc1plus)".

- -

下面列出個工具也必須被安裝:

- - - -

64 位元安裝需求

- -

這個部份列出了一些在不同的Linux發行版本中你必須執行的指令, 以利於安裝所有的需求來建構 Firefox OS.

- -

Ubuntu 12.04 / Linux Mint 13 / Debian 6

- -

在終端機中執行下列指令:

- -
sudo apt-get update
-sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libasound-dev libgconf2-dev libgl1-mesa-dev libx11-dev lzop make zip
- -

如果您將建構 "Flame" reference device 或是 Nexus 5, 請在終端機執行以下指令:

- -
sudo apt-get install libxml2-utils 
- -

您可以透過這個ppa來安裝 jdk。

- -

And see the above comments about emulator build issues!

- -

Ubuntu 12.10 / Debian 7

- -

在終端機中執行下列指令:

- -
sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make zip
- -

In addition to the emulator build issues discussed above, the compiler will default to gcc-4.7, which will fail to build with an error along the following lines:

- -

"KeyedVector.h:193:31: error: indexOfKey was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation"

- -

To fix this, you will need to specify GCC 4.6 as the default host compiler after having retrieved the B2G sources: Read Changing the default host compiler to find out how to do it.

- -

In a fresh Ubuntu 12.10 install, you'll get an error about unmet dependencies for ia32-libs. The following commands fix it:

- -
sudo dpkg --add-architecture i386
-sudo apt-get update
-sudo apt-get install ia32-libs
- -

Ubuntu 13.04

- -

Run the following command in Terminal:

- -
sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip
- -

In addition to the emulator build issues discussed above, the compiler will default to gcc-4.7, which will fail to build with an error along the following lines:

- -

"KeyedVector.h:193:31: error: indexOfKey was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation"

- -

To fix this, you will need to specify GCC 4.6 as the default host compiler after having retrieved the B2G sources: Read Changing the default host compiler to find out how to do it.

- -

Ubuntu 13.10

- -

With Ubuntu 13.10, multi-arch packages are now the main way to support multiple architectures (e.g. 32-bit on a 64-bit install).  You must tell your Ubuntu system that you want to support 32-bit packages as well:
-  

- -
sudo dpkg --add-architecture i386
-sudo apt-get update
- -

Once you've completed that, then you can install the necessary packages:

- -
sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git lib32ncurses5-dev lib32z1-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip libxml2-utils
-
-sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 1
-
-sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 2
-
-sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 1
-
-sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 2
-
-sudo update-alternatives --set gcc "/usr/bin/gcc-4.6"
-
-sudo update-alternatives --set g++ "/usr/bin/g++-4.6" 
- -

Ubuntu 14.04

- -

Follow the instructions given for Ubuntu 13.10.

- -

Fedora 17/18/19/20

- -

Run the following command in Terminal:

- -
sudo yum install autoconf213 bison bzip2 ccache curl flex gawk gcc-c++ git glibc-devel glibc-static libstdc++-static libX11-devel make mesa-libGL-devel ncurses-devel patch zlib-devel ncurses-devel.i686 readline-devel.i686 zlib-devel.i686 libX11-devel.i686 mesa-libGL-devel.i686 glibc-devel.i686 libstdc++.i686 libXrandr.i686 zip perl-Digest-SHA wget
- -

In addition to the above you will need GCC 4.6.x in order to compile the project:

- - - -

Download the right version for your Fedora installation, then install it to /opt, with the following command on Fedora 17/18:

- -
curl -O http://people.mozilla.org/~gsvelto/gcc-4.6.4-fc18.tar.xz
-sudo tar -x -a -C /opt -f gcc-4.6.4-fc18.tar.xz
-
- -

And with the following command for Fedora 19/20:

- -
curl -O http://people.mozilla.org/~gsvelto/gcc-4.6.4-fc19.tar.xz
-sudo tar -x -a -C /opt -f gcc-4.6.4-fc19.tar.xz
-
- -

You will need to specify GCC 4.6.x as the default host compiler after having retrieved the B2G sources: Read Changing the default host compiler to find out how to do it.

- -

If build fails with the compiler complaining about not finding libmpc.so.2, install the package compat-libmpc

- -

Arch Linux

- -

Run the following command in Terminal:

- -
sudo pacman -S --needed alsa-lib autoconf2.13 bison ccache curl firefox flex gcc-multilib git gperf libnotify libxt libx11 mesa multilib-devel wget wireless_tools yasm zip lib32-mesa lib32-mesa-libgl lib32-ncurses lib32-readline lib32-zlib
- -

To install the lib32-* packages you need to have the multilib repository enabled.

- -

B2G can only be compiled with gcc4.6.4, and because Arch Linux always has bleeding edge software you will need to install gcc46-multilib from AUR. Note that you will have to edit the PKGBUILD and add staticlibs to the options array, or gcc will be unable to compile B2G and give you a cannot find -lgcc error when compiling. You will also need to add the following to your .userconfig file:

- -
export CC=gcc-4.6.4
-export CXX=g++-4.6.4
- -

By default, Arch Linux uses Python3. You'll have to force it to use the old python2. You can do that by linking the python2 executable to python but this is discouraged and considered error-prone. This will also break python 3 if it is installed on your system. A better way is to use virtualenv/virtualenvwrapper:

- -
sudo pacman -S python-virtualenvwrapper
-source /usr/bin/virtualenvwrapper.sh
-mkvirtualenv -p `which python2` firefoxos
-workon firefoxos
-
- -

Android will complain that you need make 3.81 or make 3.82 instead of 4.0. You can download make 3.81 from AUR.  This will install the make-3.81 binary on your path, you need to create a symlink named make to a location earlier in the PATH variable for the build to use the correct version.

- -
mkdir -p ~/bin
-ln -s `which make-3.81` ~/bin/make
-export PATH=~/bin:$PATH
-
- -

Android also needs the Java6 SDK and Arch only has Java7.  Unfortunately the aur build is broken, but you can still download the Java 6 SDK and install it manually.  You will then need to put it in your path.

- -
cp ~/Downloads/jdk-6u45-linux-x64.bin /opt
-su
-cd /opt
-chmod +x jdk-6u45-linux-x64.bin
-./jdk-6u45-linux-x64.bin
-exit
-ln -s /opt/jdk1.6.0_45/bin/java ~/bin/java
-
-
- -

Gentoo Linux

- -
Installing ccache
- -

You will need to install ccache, a tool for caching partial builds.

- -
# emerge -av ccache
-
- -

Because ccache is known to frequently cause support issues, Gentoo encourages you to use it explicitly and sparingly.

- -

To enable the required use of ccache, on the subsequent step of this guide where the ./build.sh script is called, Gentoo users should instead run the command with an explicitly extended path, ie.

- -
PATH=/usr/lib64/ccache/bin:$PATH ./build.sh
-
- -
Generating Partition Images
- -

If you are building B2G for actual physical hardware, then you may at some point also wish to generate some partition images for upload to your device. (For example, to restore backed up files to the device via the fastboot utility)

- -

The filesystem image format used in this case is YAFFS2 (Yet Another Filesystem 2). Gentoo has support for the very latest (ie. git HEAD) yaffs2-utils userland package in portage. (Note: You will also need kernel patches if you want to mount YAFFS2 images, but this is not really required since you can deconstruct and rebuild them instead.)

- -
# emerge --autounmask-write yaffs2-utils; etc-update; emerge -av yaffs2-utils
- -

In order to generate such an image, simply change to the parent directory of the partition filesystem tree you wish to package, and issue a command like this:

- -
mkyaffs2image system/ system.img
- -

使用 Mac OS X 的需求

- -

要在Mac OS X 上建構 Firefox OS, 您必須遵循一些步驟, 以下將會詳細說明. 我們也會提出一些您可能在特殊情況下會遇到的錯誤, 以及他們的解決方法.

- -
-

Note: Configuring and Building B2G for Keon WON'T WORK on a Mac. You'll need to use Linux to build B2G for this device.

-
- -

版本相容性

- -

XCode 4.2 以下的版本與 Mac OS X 10.9 (a.k.a. "Mavericks") 並不相容, 所以您可能會很驚訝地發現Firefox OS會建構錯誤. 基本上您無法在 Mac OS X 10.9 以上的版本建構 ICS emulator, 並且 flatfish 在XCode 5.x系列會無法建構.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mac OS X 10.9.x 的版本相容性
 emulator (ICS)flatfish (JB-4.2)emulator-jb (JB-4.3)emulator-kk (KitKat-4.4)
XCode 4.3.3XXXX
XCode 4.4.1XO[1]OO
XCode 4.5.2XO[1]OO
XCode 4.6.3XO[1]OO
XCode 5.0.2XXOO
XCode 5.1.1XXOO
- -
    -
  1. 您必須將設定環境變數 BUILD_MAC_SDK_EXPERIMENTAL=1 並將其 export  以建構 flatfish.
  2. -
- -

安裝 XCode Command Line Utilities

- -

您必須安裝 Xcode's Command Line Utilities. 您可以只下載 Command Line Utilities, 只需要在 Apple's developer downloads page 挑選您的 OS X 版本, 然而如果您想要完整的 Xcode suite, 你可以在 Mac App Store 安裝他們

- -

Xcode 4.3.1 (OS X 10.7 "Lion") 以及其他較新的版本如 4.4.1+ (也就是 Mac OS X 10.8 "Mountain Lion"), 並不會自動包含我們所需的 Command Line Utilities. 當您安裝 Xcode 時, 請確認進入 Preferences, then the Downloads panel, and install the Command Line Utilities. 另外, 請確認您至少有 20 GB 的硬碟空間.

- -

Screenshot of Xcode Downloads Command Line Tools

- -
-

Note: The Firefox OS 模擬器 需要 Core 2 Duo processor 或較新的處理器; 也就是, 一個相容於Mac OS X 10.7 "Lion"的作業系統. 您的作業系統不一定要是OS X Lion, 您只需要與其相容. 也就是您當然可以建構Firefox OS 在較舊版本的Mac 上.

-
- -
-

Note: XCode 4.2.x or older is not compatible with Mac OS X 10.9 or above, and XCode 4.3.x has no platform SDK for 10.8. Please install a newer version. If you're also working on flatfish, please make sure any of XCode 4.4, 4.5, and 4.6 is available.

-
- -

Run Firefox OS Mac Bootstrap

- -

Next, open a terminal and run the following command:

- -
curl -fsSL https://raw.github.com/mozilla-b2g/B2G/master/scripts/bootstrap-mac.sh | bash
- -

This will pull and run a bootstrap script that makes sure you have all the prerequisites met to build the emulator. It will also prompt you for permission to install anything you're missing, and provide warnings and suggested fixes to problems. The script will check for and install the following items:

- - - -

Xcode wrangling

- -

If you have already upgraded to Xcode 4.4+ and get the message that Xcode is outdated, check the Xcode path with:

- -
xcode-select -print-path
- -

If it still points to /Developer you can update the path with:

- -
sudo xcode-select -switch /Applications/Xcode.app
- -

Making the Mac OS X 10.6 SDK available

- -

You also need to have the Mac OS X 10.6 SDK available. The SDK needs to be available at

- -
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
- -

If it cannot be found there you will need to extract and copy it from Xcode 4.3. To do this:

- -
    -
  1. Download the XCode 4.3 .dmg file from the Apple Developer portal (you'll need an Apple Developer account).
  2. -
  3. Download the utility Pacifist and use it to extract the 10.6 SDK from the XCode 4.3 .dmg file. Click on the "Extract Package" button, find the SDK by searching for 10.6 in the search box, then Ctrl + click on the MacOSX10.6.sdk directory and Extract it to a suitable location.
  4. -
  5. Add a symlink from the 10.6 SDK location to the /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ directory. For example, if you put the 10.6 SDK on your desktop, the comment would be
  6. -
- -
ln -s /Users/<yourusername>/Desktop/MacOSX10.6.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
- -
-

Note: This is not necessary for Mac OS X 10.9 or above, because 10.6 SDK is for ICS and ICS doesn't supports Mac OS X 10.9.

-
- -

Be aware of Mac file system case sensitivity

- -

By default, Mac OS X ships with a case-insensitive file system.  This is problematic because the Linux kernel has a number of files with the same name, but different case.  For example, see the header files xt_CONNMARK.h and xt_connmark.h.  This results in a number of files appearing to be modified in /kernel after a fresh ./config.sh.

- -

In many cases you can run the build just fine; for some platforms, however, you may encounter the following error:

- -
ERROR: You have uncommited changes in kernel
-You may force overwriting these changes
-with |source build/envsetup.sh force|
-
-ERROR: Patching of kernel/ failed.
- -

Please see bug 867259 for more discussion and possible fixes for this problem.

- -

Alternatively, it will always be safest to build on a case sensitive file system.  The easiest way to do this is to create a separate, mountable disk image with case-sensitivity enabled.  You can do this using Apple's Disk Utility application or from the command line:

- -
hdiutil create -volname 'firefoxos' -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/firefoxos.sparseimage
- -

Mount the drive with:

- -
open ~/firefoxos.sparseimage
- -

Change into the mounted drive with:

- -
cd /Volumes/firefoxos/
- -

You can then check out the code and compile from this location without worrying about case-sensitivity problems.

- -

Mountain Lion homebrew gotcha

- -
-
If you are on Mountain Lion and you receive an error during the installation of the dependencies via homebrew, such as:
-
- -
-
clang: error: unable to execute command: Segmentation fault: 11
-... try reinstalling the dependency manually adding the --use-gcc flag, for example: - -
brew install mpfr --use-gcc
-
- -

Follow Samsung Galaxy S2 extra steps

- -

If you plan to build for the Samsung Galaxy S2, you will also need to install heimdall. See {{ anch("Installing heimdall") }} for details. This is not done for you by the bootstrap script!

- -
Note: If you have installed the Samsung Kies tool, which is used to manage the contents of many Samsung phones, you will have to remove it before you can flash Firefox OS onto your device. You can use the standard application removal process on Windows; on Mac, the Kies install disk image has a utility to fully remove Kies from your system. Flashing will not work if you have Kies installed. If you forget to remove Kies, the build system will detect it and remind you to uninstall it. Note also that the uninstall tool does not correctly remove the folder ~/Library/Application Support/.FUS, and leaves a reference to a utility there in your user startup items list. You will want to remove these manually.
- -

Fix libmpc dependency if broken

- -

gcc 4.6 was built with libmpc 0.9; if you then use homebrew to update packages, libmpc gets updated to version 1.0, but homebrew doesn't rebuild gcc 4.6 after the library version changes. So you need to create a symlink to make things work again, like this:

- -
cd /usr/local/lib/
-ln -s libmpc.3.dylib libmpc.2.dylib
- -

Optional: Install HAX

- -

Intel provides a special driver that lets the B2G emulator run its code natively on your Mac instead of being emulated, when you're using the x86 emulator. If you wish to use this, you can download and install it. It's not required, but it can improve emulation performance and stability.  

- -

Before you install HAX you will need to install the Android SDK.

- -

Install adb

- -

The build process needs to pull binary blobs from the Android installation on the phone before building B2G (unless you're building the emulator, of course).  For this, you will need adb, the Android Debug Bridge. Our Installing ADB article explains how to get adb installed.

- -
-

Note for future when you start to use adb: adb needs the phone's lock screen to be unlocked in order to see your phone (at least in later versions of Firefox OS). You'll probably want to disable the lock screen (we'll get to how later in the build instructions).

-
- -

Install heimdall

- -

Heimdall is a utility for flashing the Samsung Galaxy S2. It's used by the Boot to Gecko flash utility to replace the contents of the phone with Firefox OS, as well as to flash updated versions of B2G and Gaia onto the device. You'll need it if you want to install Firefox OS on a Galaxy S2; it is not needed for any other device. For other devices, we build and use the fastboot utility instead.

- -
Note: Again, it's important to note that this is only required for installing Firefox OS on the Samsung Galaxy S2.
- -

There are two ways to install heimdall:

- - - -

Configure ccache

- -

The B2G build process uses ccache. The default cache size for ccache is 1GB, but the B2G build easily saturates this; around 3GB is recommended. You can configure your cache by running the following command inside terminal:

- -
$ ccache --max-size 3GB
- -

For Linux: configure the udev rule for your phone

- -
-

Note: This section is specific to Linux; Mac OS X has the necessary device permissions set up already.

-
- -

Next, you need to confingure the udev rule for your phone,

- -

You can get the USB vendor ID by running lsusb with your phone plugged in, but typically it's Google 18d1, Samsung 04e8, ZTE 19d2, Geeksphone/Qualcomm 05c6. Add this line in your /etc/udev/rules.d/android.rules file (replacing XXXX with the ID for your device):

- -

相容的

- -
SUBSYSTEM=="usb", ATTR{idVendor}=="XXXX", MODE="0666", GROUP="plugdev"
- -

Take ZTE for example, the content in android.rules will be

- -
SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev"
- -
-

If the file doesn't exist, create it. The rules.d directory is usually read only by default, so you may have to use chmod to make the directory writeable, or the file, or both.

-
- -

Once you've saved the file, and closed it,  make the file readable:

- -
sudo chmod a+r /etc/udev/rules.d/android.rules
-
- -

Now that the udev rules have been updated, restart the udev daemon.

- -

Ubuntu

- -
sudo service udev restart
- -

Fedora 20

- -
sudo systemctl restart systemd-udevd.service
- -

Finally, unplug and the USB cable but don't replug it in because we need to enable remote debugging on the phone first.

- -

Enable remote debugging

- -

Before you plug your phone back into your USB port, put it USB developer mode. This allows you to debug and flash the phone. To enable developer mode, on your phone enable Remote Debugging in Developer settings (this was called Developer mode on older versions.) Once the option is checked, remote debugging is enabled, and you are ready to go.

- -

At this point, connect your phone to your computer via a USB cable (if you created the udev rule before, this will trigger udev to detect the phone and create the device node with the right permissions). Now you can check if you can list your device via the adb devices command (remember that adb can only see your phone when the lock screen is unlocked). If everything has worked ok, you should see an output similar to this (the following is for a Geeksphone Keon):

- -
$ adb devices
-List of devices attached
-full_keon       device
- -

If the device did not list as expect, check the file name and the script are all correct (see previous section), then restart the computer and retype the command again. Note also that if your device uses fastboot, the bootloader may identify itself with a different vendor ID than the one you see when the device boots normally.

- -

Backup the phone system partition

- -
-

Note: You have to do this before you build your device if you do not have an existing system backup, because some libraries will be referenced in build time. These library might be proprietary so we can't provide in our code base.

-
- -

It is recommended that you back up the entire Android system partition on your phone.

- -

You can use this copy of the binary blobs for Android in case you later delete your B2G tree. To do this, run:

- -
adb pull /system <backup target dir>/system
-
- -

 Depending on the phone, you may also need to pull the /data and/or /vendor directories:

- -
adb pull /data <backup target dir>/data
-adb pull /vendor <backup target dir>/vendor
-
- -

If the pull commands fail with an "insufficient permission" message, try the following:

- - - -

On to the next step

- -

At this point, you should be ready to fetch the Firefox OS code!

diff --git a/files/zh-tw/archive/b2g_os/index.html b/files/zh-tw/archive/b2g_os/index.html deleted file mode 100644 index 7c258aaeea..0000000000 --- a/files/zh-tw/archive/b2g_os/index.html +++ /dev/null @@ -1,222 +0,0 @@ ---- -title: B2G OS -slug: Archive/B2G_OS -translation_of: Archive/B2G_OS ---- -
-

由 Mozilla 所開發的 Firefox OS 全新行動作業系統,即是以 Linux 與 Firefox 的核心 (Gecko 引擎) 為其架構。

-
- -
-

開放源碼的 Firefox OS 不受任何專利技術的限制,同樣能讓 App 開發者享受 Web 的功能與靈活度,打造出絕佳的消費性 App。

- -

對 Web 開發者而言,首要應先理解「整個使用者介面就是 Web App」,且該 Web App 又能顯示並啟動其他的 Web App。不論是專為 Firefox OS 撰寫的 App,或是對使用者介面所進行的任何修正,都能算是以 HTML、CSS、JavaScript 所建構的 Web App,且亦能存取行動裝置的硬體和服務。

- -

從產品的角度來看,Firefox OS 即是 Mozilla 與其 OEM 夥伴,在 Boot to Gecko (B2G) 技術上所套用的品牌及支援服務。B2G 為作業系統在工程設計時所用的代號,即透過 Mozilla 與其廣大 Mozilla/開放源碼社群的貢獻者所開發。

-
- -
-

開發 Firefox OS

- -

專屬的 App

- -

此為我們的 App 中心,內含資訊可協助開發者撰寫 Open Web App,並安裝於 Firefox OS 之上。

-
- -
-
-

平台指南

- -

平台開發者可了解 Firefox OS 平台的各個元件如何搭配及運作。

- - -
- -
-

建構與安裝

- -

說明應如何於模擬器、相容裝置、桌機版模擬器上建構\安裝 Firefox OS。

- - -
- -
-

開發者手機

- -

關於特定開發者手機的調整、更新、復原、購買等資訊。

- - -
-
- -
-
-

Firefox OS 書籍

- -

有許多已出版與編寫中的書籍,涵蓋了 Firefox OS 多樣的開發面相。可參閱 Firefox OS 書籍

-
- - -
- -
-

注意:我們將透過〈Firefox OS 說明文件狀態〉頁面,持續更新 Firefox OS 相關文件。如果你也想貢獻 Firefox OS 說明文件,請參閱此頁面並看看有哪些需要調整的內容!

-
- - - -
    -
  1. 介紹
  2. -
  3. 平台指南 -
      -
    1. 平台指南概述
    2. -
    3. 架構概述
    4. -
    5. App 架構
    6. -
    7. Gonk
    8. -
    9. Gecko
    10. -
    11. Gaia
    12. -
    13. Gaia App 指南
    14. -
    15. 安全性 -
        -
      1. Firefox OS 安全模型
      2. -
      3. 系統安全
      4. -
      5. Firefox OS 中的 App 安全
      6. -
      7. 安全的安裝\更新 App
      8. -
      -
    16. -
    17. Firefox OS 記憶體耗盡時的管理
    18. -
    19. 支援功能表
    20. -
    21. 設定清單
    22. -
    -
  4. -
  5. 建構並安裝 -
      -
    1. 建構與安裝概述
    2. -
    3. Firefox OS 建構程序摘要
    4. -
    5. 必要建構條件
    6. -
    7. 準備第一次編譯
    8. -
    9. 建構 Firefox OS
    10. -
    11. 於 OSX 上為「Flame」建構適用的 Firefox OS
    12. -
    13. 選擇 Gaia 或 Firefox OS 的執行方式
    14. -
    15. 建構 B2G 桌機用戶端
    16. -
    17. 使用 Firefox OS 模擬器
    18. -
    19. 於行動裝置上安裝 Firefox OS
    20. -
    21. 建構並套用 Firefox OS 更新封包
    22. -
    23. 執行環境 (Runtime) 工具
    24. -
    -
  6. -
  7. 開發 Firefox OS -
      -
    1. Firefox OS 開發概述
    2. -
    3. 提報 Firefox OS 的錯誤
    4. -
    5. 修改主機端的檔案
    6. -
    7. 以 .userconfig 檔案進行自訂
    8. -
    9. 自訂 b2g.sh 指令碼
    10. -
    11. 移植 Firefox OS
    12. -
    -
  8. -
  9. 開發 Gaia -
      -
    1. Gaia 開發概述
    2. -
    3. 執行 Gaia 的 Codebase
    4. -
    5. 了解 Gaia 的 Codebase
    6. -
    7. 更改 Gaia 程式碼
    8. -
    9. 測試更改過的 Gaia 程式碼
    10. -
    11. 提交 Gaia 修正檔
    12. -
    13. Gaia 版本系統入門
    14. -
    15. 自訂「建構時間」App
    16. -
    17. 市場自訂指南
    18. -
    19. 自訂 Firefox OS App 中的鍵盤
    20. -
    21. 本地化 Firefox OS
    22. -
    23. 本地化最佳實例
    24. -
    25. 「make」選擇參考
    26. -
    27. Gaia 工具參考
    28. -
    -
  10. -
  11. Firefox OS 手機指南 -
      -
    1. Firefox OS 手機指南概述
    2. -
    3. 手機與相關裝置的規格
    4. -
    5. Geeksphone
    6. -
    7. ZTE OPEN
    8. -
    9. ZTE OPEN C
    10. -
    11. Flame
    12. -
    13. 一般裝置功能
    14. -
    15. 疑難排解
    16. -
    17. 開放參考裝置的最佳實例
    18. -
    -
  12. -
  13. Firefox OS 版本說明 -
      -
    1. Firefox OS 版本說明概述
    2. -
    3. Firefox OS 2.1 for developers
    4. -
    5. Firefox OS 2.0 for developers
    6. -
    7. Firefox OS 1.4 for developers
    8. -
    9. Firefox OS 1.3 for developers
    10. -
    11. Firefox OS 1.2 for developers
    12. -
    13. Firefox OS 1.1 for developers
    14. -
    15. Firefox OS 1.0.1 for developers
    16. -
    -
  14. -
  15. 自動化測試 -
      -
    1. Firefox OS 自動化測試概述
    2. -
    3. 於 Firefox OS 執行測試作業:開發者指南
    4. -
    5. Gaia UI 測試
    6. -
    7. Gaia 整合測試
    8. -
    9. Gaia 單元測試
    10. -
    11. Gaia 效能測試
    12. -
    13. Mochitests
    14. -
    15. Reftests
    16. -
    17. WebAPI 測試
    18. -
    19. xpcshell 測試
    20. -
    21. 耐久測試
    22. -
    23. MTBF 測試
    24. -
    25. Marionette
    26. -
    27. Treeherder
    28. -
    29. Jenkins
    30. -
    -
  16. -
  17. 除錯 -
      -
    1. Firefox OS 除錯概述
    2. -
    3. Firefox OS 的開發者設定
    4. -
    5. 將 Firefox OS 裝置連上桌機
    6. -
    7. 以 Firefox 開發者工具設定 Firefox OS 的除錯作業
    8. -
    9. 裝置上的 console 記錄
    10. -
    11. 安裝並使用 ADB
    12. -
    13. 螢幕截圖
    14. -
    15. 使用 WebIDE
    16. -
    17. 使用「應用程式管理員 (App Manager)」
    18. -
    19. Firefox OS 當機回報
    20. -
    21. Firefox OS 記憶體耗盡的除錯
    22. -
    23. Firefox OS 安全性測試與除錯
    24. -
    25. 使用 gdb 為 B2G 除錯
    26. -
    27. 使用 Valgrind 為 B2G 除錯
    28. -
    -
  18. -
diff --git a/files/zh-tw/archive/b2g_os/installing_boot_to_gecko_on_a_mobile_device/index.html b/files/zh-tw/archive/b2g_os/installing_boot_to_gecko_on_a_mobile_device/index.html deleted file mode 100644 index 7605d27e06..0000000000 --- a/files/zh-tw/archive/b2g_os/installing_boot_to_gecko_on_a_mobile_device/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: 將 Boot to Gecko 安裝於行動裝置 -slug: Archive/B2G_OS/Installing_Boot_to_Gecko_on_a_mobile_device -translation_of: Archive/B2G_OS/Installing_on_a_mobile_device ---- -

如果您編譯給行動裝置的 Boot to Gecko 之後,您就將他安裝在行動裝置上。這篇文章會引導您進行這個動作。

-
- Note: 第一次把 B2G 寫入手機時,手機必須安裝 Androidd 4.0 (Ice Cream Sandwich) 版本。否則這個動作就不會正常的運作。而一旦您完成第一次 B2G 的安裝之後,您就可以熟練的更新了。
-

燒錄手機

-

您只要將您的手機連結到電腦上、並打下列指令,就可以燒任何東西到手機上:

-
./flash.sh
-
-

就這樣。您編譯好的 B2G 就會被燒錄到您的行動裝置上。

-

為您的行動裝置設定 udev 規則

-

在 Linux,如果您看到這個訊息,

-
< waiting for device >
-

那或許意味著這個 fastboot 裝置和提供給 adb 裝置的不同,而那個裝置沒有被加入 udev 規則。您現在可以藉由執行 lsusb 來取得 USB 廠商的 ID,但是它會是 Google 的 ID:18d1,所以將下面這一行加入 /etc/udev/rules.d/51-android.rules 這個檔案,然後就會正常運作了:

-
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
-
- Note: 如果您在 Linux 上碰到一個非常有幫助的 libusb 錯誤 "-3"的話,這意味著手機需要被 root 來取得 USB 裝置的權限。請使用 sudo 再執行一次這個 script。
-

Samsung Galaxy S2 要特別注意的地方

-

如果您的手機是 Galaxy S2 且使用 heimdall 1.3.2 (最新版;可以用 heimdall version 指令檢查版本) 的話,您可能會看到一個警告訊息「FACTORYFS upload failed!」、後面接著「Heimdall flashing failed」和一些額外的資訊。實際上這是一個成功的狀況,所以您可以忽略這個建議。

-

為了要擺脫這個奇怪的行為,您可以去抓 heidmall 的 複製的原始碼、並且降級到 1.3.1 release 版 ("git checkout fbbed42c1e5719cc7a4dceeba098981f19f37c06"),接著根據 README 編譯、然後安裝,這樣就不會再看到這個錯誤訊息了。然而,這並不是必須的 (看起來比較爽就是了)。

-

heimdall 的所有版本都無法燒錄超過 100MB 的 system.img。執行下列指令:

-
ls -l ./out/target/product/galaxys2/system.img
-
-

就可以看到您的 system.img 有多大。如果太大的話,先到 IRC 找人問問求救;有幾種方法可以分兩階段來燒錄。

-

Samsung Galaxy S2 額外的步驟

-

如果您正在燒錄到 Galaxy S2 的話,需要遵守一個額外的步驟。因為使用 flash.sh script 不會自動將 Gaia 燒錄上去;您需要也打下列指令:

-
./flash.sh gaia
-
-

燒錄某個分割區(partitions)到具備 fastboot 的手機

-

您可以燒錄某個分割區 (partitions)到 fastboot 的手機 (也就是說,除了 Samsung Galaxy S2 之外的任何其他手機)。指令如下:

-
./flash.sh system
-./flash.sh boot
-./flash.sh user
-
-

更新某個模組

-

在燒錄的時候,您可以藉由指名元件名稱來更新某個 B2G 的元件。如下:

-
./flash.sh gaia
-./flash.sh gecko
-
-

接著,下一步

-

此時,您的手機應該正在運作 Boot to Gecko!是時候該體驗、寫些程式測試、或是 除些錯 了!

-
- Note: 一個有用的技巧:如果您的 B2G 版本啟動的時候有螢幕鎖且需要密碼才能解鎖的話,預設的解鎖密碼是 0000。
-

Troubleshooting

-

如果行動裝置在安裝或更新 B2G 到新版本後不會正常運作的話,這裡還有一些技巧可以參考。

-

如果使用者介面 (Gaia) 沒有啟動

-

如果您更新您的手機導致使用者介面不會啟動的話,您可以重置手機來清除一些過期的設定或是之類的東西。這樣做可能會讓它回過魂來繼續運作。參考及使用下列指令:

-
cd gaia
-make reset-gaia
-
diff --git a/files/zh-tw/archive/b2g_os/introduction/index.html b/files/zh-tw/archive/b2g_os/introduction/index.html deleted file mode 100644 index 5b0319863d..0000000000 --- a/files/zh-tw/archive/b2g_os/introduction/index.html +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: Firefox OS 簡介 -slug: Archive/B2G_OS/Introduction -translation_of: Archive/B2G_OS/Introduction ---- -
-

Firefox OS 正將無限開拓 Web 的行動界線,且要讓擁有第一支智慧型手機的使用者,能獲得全新的網路體驗。此開放源碼的行動作業系統,即以 Linux、Open Web 標準、Mozilla 的 Gecko 技術為基礎,勢將重新定義「行動平台」。

- -

在導入 WebAPI 以存取硬體功能,並提供直覺且豐富的智慧型手機體驗之後,Mozilla 相信 Web 必將成為開發者的絕佳機會,讓更多消費者能觸及有趣且多樣的產品。

-
- -

目標客戶

- -

此一系列說明文件,主要將讓 Web\平台開發者能夠進一步了解 Firefox OS 的運作方式、貢獻專案的方法,並打造自己的客製化軟體版本以利安裝於裝置之上。若是想建立並發佈自己的 Web App,亦可透過 「應用程式中心 (App Center)」Marketplace 的「專區 (Zone)」輕鬆達成。

- -

Firefox OS 的基本承諾

- -

對 Web\平台開發者來說,所應了解的最重要部分就是:整個使用者介面 (UI) 就是 Web App,且此 Web App 又能夠顯示並啟動其他的 Web App。不論是修改 UI、撰寫 Firefox OS 上執行的 App,甚至是存取行動裝置硬體與服務,都是透過標準的 Web 技術進行。

- -

從產品面來看,Firefox OS 已是 Mozilla 的品牌名稱,透過 Boot to Gecko (B2G,為作業系統產品的設計代號) 而提供相關服務。Firefox OS 的 UI 稱為 Gaia,並包含了 OS 的預設 App 與系統功能。

- -

若要進一步了解平台架構,可參閱《平台指南》。

- -

目前與未來的規劃

- -

現正開發 Firefox OS 2.0 版,且 1.3/1.4 版已經趨於穩定。目前市面上已有多款手機,消費者或開發者所適用的型號均有。若要進一步了解,可參閱:

- - - -

版本週期

- -

從 Firefox OS 1.2 開始,Firefox OS 版本週期即已儘量同步於 Gecko 與 Firefox 桌面版的版本週期 (即 6 週)。現每 3 個月即釋出新版本 Firefox OS,因此每 2 個 Gecko (Firefox 瀏覽器核心) 版本週期就會釋出 1 次新版本 Firefox OS。

- -

舉例來說,Gecko 30 即與 Firefox OS 1.4 一同釋出 (跨過 Gecko 29);Gecko 32 即與 Firefox OS 2.0 (本為 1.5) 一同釋出 (跨過 Gecko 31)。

- -
-

注意:可參閱我們的版本釋出排程,確認 Firefox OS 與 Gecko\桌面版 Firefox 之間的對應版本,另可參閱 Firefox OS Release Milestones 進一步了解版本管理的相關細節。

-
- -

社群

- -

Boot to Gecko 與 Gaia 均是由 Mozilla 內部的工程師團隊開發而得,另加上 Mozilla 外部與開放源碼社群的一同貢獻。如果你想聯繫 Firefox OS 或 Gaia 開發的社群,則可利用下列的郵件群組與 IRC 頻道。

- -

同樣的,可使用 Bugzilla 系統提報 Firefox OS 元件的任何問題。如果你不確定哪些元件應該提報問題,歡迎隨時發問。

- -
-

注意:如果你對 B2G/Gaia 原始碼的特定部分 (例如特定的 Gaia App) 有任何問題或意見,則可在 Firefox Modules 頁面上找到特定聯絡細節。

-
- -

打造作業系統

- -

B2G 作業系統是以 Mozilla 的 Gecko 繪圖引擎為基礎,並從 Linux kernel 以及稱為 Gonk 的硬體抽象層 (Hardware Abstraction Layer,HAL) 延伸。這裡所說的 Gecko,基本上就是 Firefox for Android 或 Windows 或 Mac OS X 所用的相同 Gecko。而 Gonk 就是 Gecko 所衍生的另項系統。

- -

若要進一步打造並安裝 Firefox OS,可參閱《建立並安裝 Firefox OS》。你也可以到 Github 找到 B2G 的原始碼

- -

貢獻 Gaia

- -

若想為 Gaia 貢獻,其實並不需要深入了解 Web 的開發概念。如果要入門 Gaia 並執行,可參閱《入門開發 Gaia》。

- -

還有許多有用的工具,可讓你針對 Gaia 與 Firefox OS 的 Web App 進行除錯。若要進一步了解,亦可參閱《Hacking Gaia》。

- -

開發 Firefox OS 的 App

- -

Firefox OS App 同樣是以標準的 Web 技術 (如 HTML、CSS、JavaScript 等等) 所打造而成。如果你本來就是 Web 開發者,就已經具備了大部分的技術。另必須知道數個特定的 JavaScript API,以利存取裝置的硬體與重要功能 (如相機、陀螺儀、光線感測器、聯絡人資訊、系統警示\通知......)。這些也同樣能參閱應用程式中心Web 平台頁面獲得更多資訊。

- -
-

注意:如果你剛開始打造 Open Web/Firefox OS App,或想要初步了解 Web App 與傳統網頁之間的差異,可參閱《App 迅速入門指南》。

-
- -

支援 Firefox OS 的多個版本

- -

在開發 Firefox OS 的 App 時,必須留意消費者手上的裝置到底搭載了哪個版本 (可參閱目前可用手機表)。另請注意,更新手機平台軟體,可不像更新桌面版軟體一樣簡單。消費者往往受制於網路服務供應商。因此開發者應該讓 App 能夠支援不同的版本。舉例來說,multiline 的「Flexbox」就無法在 Firefox OS 1.3 以下的版本中執行。你可能必須使用較簡單的配置函式,或退而使用較舊的版本。

- -

隨著有越來越多消費性的 Firefox OS 裝置上市,並搭載更高版本的 Firefox OS,這個問題很快就能解決。

- -
-

我們目前建議能針對 Firefox OS 1.1 版本的特性來開發 App。

-
- -
-

注意:MDN 上的《Web 平台參考頁面》,包含瀏覽器\平台的支援資訊。另可到《Apps API Reference》找到特定 App 技術的相關資訊。

-
diff --git a/files/zh-tw/archive/b2g_os/phone_guide/flame/index.html b/files/zh-tw/archive/b2g_os/phone_guide/flame/index.html deleted file mode 100644 index 60b3a7ad8f..0000000000 --- a/files/zh-tw/archive/b2g_os/phone_guide/flame/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: Firefox OS 參考平台手機「Flame」 -slug: Archive/B2G_OS/Phone_guide/Flame -translation_of: Archive/B2G_OS/Phone_guide/Flame ---- -
-

Flame 的更新檔案:我們建議你加入下方的郵件群組,即可收到軟體版本定期更新檔案,以及其他可影響 Flame 效能的檔案:https://mail.mozilla.org/listinfo/flamenews

-
-

A picture of the Flame device, showing the Firefox OS homescreen containing several app icons.

-

Available to order

-

專為開發者所設計的「Flame」參考平台手機,是 Firefox OS 相關裝置的里程碑。Flame 的硬體規格均為一時之選,包含 FWVGA 顯示功能與雙核心處理器,可協助開發者打造絕佳的內容與經驗。且單一硬體平台同樣適合測試人員,可更輕鬆的測試並找出軟體問題,不必擔心裝置型號既有的特定問題。

-

如果你手上有 Flame,也打算開始把玩、開發\發佈 App,或為 Firefox 平台有所貢獻,則應先參閱下列連結:

- -

如果你想進一步了解作業系統的更新程序、探索手機的其他部分、將 App 送入手機,或觀看手機本身的規格,則可從下列 2 篇文章中找到相關資訊:

- -

購買 Flame

-

Flame 銷售已經告一段落。但我們仍為 Mozilla 貢獻者保留了許多機會要免費送出手機,包含第二輪的 Foxtrot 方案。如果你想免費獲得手機,請儘速聯絡 IRC 上的 Asa Dotzler。

-

連線網路與裝置的規格

-

連線網路:

- -

硬體:請透過手機與裝置的規格頁面找到更多硬體特色。

-

其他特色包含:

- -

另請參閱

- diff --git a/files/zh-tw/archive/b2g_os/phone_guide/index.html b/files/zh-tw/archive/b2g_os/phone_guide/index.html deleted file mode 100644 index 7e301af2de..0000000000 --- a/files/zh-tw/archive/b2g_os/phone_guide/index.html +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Boot to Gecko 開發者手機指南 -slug: Archive/B2G_OS/Phone_guide -translation_of: Archive/B2G_OS/Phone_guide ---- -

如果您已經從 Mozilla 收到了可以運作 B2G 的開發者手機,或是已經有人幫您將 B2G 安裝好在您的手機上的話,這裡有一份 關於手機運作的基礎指南。我們正在改善這個部分,也希望可以快一點放更有效率的指令放上 MSN。如果您對建置/燒錄有興趣,請看 '設定和建置 Boot to Gecko' 章節,裡面有更細節的資訊。

diff --git a/files/zh-tw/archive/b2g_os/phone_guide/zte_open/index.html b/files/zh-tw/archive/b2g_os/phone_guide/zte_open/index.html deleted file mode 100644 index 36ababcb56..0000000000 --- a/files/zh-tw/archive/b2g_os/phone_guide/zte_open/index.html +++ /dev/null @@ -1,287 +0,0 @@ ---- -title: The Firefox OS ZTE OPEN -slug: Archive/B2G_OS/Phone_guide/ZTE_OPEN -translation_of: Archive/B2G_OS/Phone_guide/ZTE_OPEN ---- -
-

Mozilla 與 ZTE 共同合作開發了 ZTE Open。ZTE Open 是一款為開發者和早期接受者所開發的 Firefox OS 裝置,它已解鎖、開放用於測試和實驗。

-
- -
-

Note: 本指南不適用於 ZTE Open C 裝置,針對 ZTE Open C 請參考 ZTE Open C 頁面。

-
- -

購買裝置

- -

請連至 ZTE 美國、歐洲或香港 ebay 商店購買。

- - - -

升級 Firefox OS

- -

接下來我們將提供升級 ZTE Open 的說明指示:

- -

一般

- -

一般 Firefox OS 的建置、更新和測試都是透過用 USB 連接電腦和手機後,利用 ADB (Android Debugging Bridge) 以及 Fastboot 發送指令進行操作,所以我們需要安裝 ADB 以及 fastboot 到電腦上 (可至 Android Developer Toolkit 取得) ,並不需要安裝整個 Android 開發工具包,adb 以及 fastboot 可以到 /platform-tools/ 資料夾找到。

- -

然後,請打開手機的遠端除錯選項,enable remote debugging

- -

Firefox OS 1.1

- -

2013/12/10,ZTE 發佈了 ZTE Open 的 Firefox OS 1.1 更新包,這個更新開啟了 fastboot, 解決了前一個發佈版本這方面的問題。

- -

在升級到 v1.2 前,最好先升級到 v1.1。升級 v1.1 首先先到 OPEN (American StandardOPEN (European Standard) 下載升級包,請注意我們需要下載對應 OS 版本,所以從 v1.0 升級的人請下載 "V1.1.0B02(for V1.0)",下載檔案中同時也含有說明文件。接下來請解開下載檔案按照以下步驟升級你的 ZTE Open。

- -
-

Note: 使用者資料會在 microSD 卡升級過程中被刪除,請先備份你的資料

-
- -

以下是透過 microSD 卡升級步驟:

- -
    -
  1. 關機、打開背蓋、取下電池背後的 microSD 記憶卡。
  2. -
  3. 將 SD 卡插入電腦。
  4. -
  5. 把下載的 US_DEV_FFOS_V1.1.0B04_UNFUS_SD.zipEU_DEV_FFOS_V1.1.0B04_UNFUS_SD.zip (看你下載的版本) 複製到 microSD 卡的 root 底下,請不要解開 zip 檔。
  6. -
  7. 卸除 SD 卡、裝回到手機上。
  8. -
  9. 同時按下音量向上鍵和電源鍵。音量向上鍵位於手機左側長條型按鍵的上半部。兩顆鍵同時按下後會進入 Firefox OS recovery 模式 (注意 Firefox logo 會先出現一陣子再進入 recovery 模式)。
  10. -
  11. 按音量上下鍵再選項間移動,請選擇 “apply update from external storage.”
  12. -
  13. 按電源鍵確認選項後會看見 microSD 卡裡的檔案列表。
  14. -
  15. 再用音量上下鍵選擇你剛剛複製過來的軔體檔 US_DEV_FFOS_V1.1.0B04_UNFUS_SD.zipEU_DEV_FFOS_V1.1.0B04_UNFUS_SD.zip,然後按電源鍵確認。
  16. -
- -

如果一切順利的話,你會看到一連串訊息,當你看到 Install from sdcard complete.” 那就代表升級完成,請選擇 “reboot system now” 重新開機,重新開機後你將會看到手機第一次啟動的設定頁面。

- -

Firefox OS 1.2

- -

2014, 1月,ZTE 發佈了一版 Firefox OS v1.2 beta 版 (fastboot 開啟、擁有 root 權限),此 beta 版本基本上是由 v1.1 baseline + v1.2 Gecko 與 Gaia, 而且不需要把檔案放在 microSD 卡中。

- -

請先確認 v1.1 已經上面說明安裝完成,接著打開 terminal 然後輸入以下指令確認連線建立成功:

- -
adb devices -l
-
- -

如果連線成功,你會看到類似 "roamer2    device usb:2-1.2" 的回應訊息。

- -

請前往 ZTE 建立的 Dropbox 帳戶下載對應 OS: US 版UK 版,,Windows 使用者可以去下載特殊說明還有升級工具來協助安裝新版本。底下的說明指示無需特殊工具、適用於所有作業系統 – Linux, OS X, 和 Windows。

- -

請解開下載好的檔案,開啟 terminal 進入到解開後的檔案資料夾。請注意以下步驟會刪除個人資料,所以請先備份好你的資料,接著輸入下列指令:

- -
adb reboot bootloader
- -

這個指令會讓裝置重開機,由於 fastboot 只在重開機過程中有效,請在重開機中輸入以下指令:

- -
sudo fastboot devices
-
- -

如果看到 "< waiting for device >" 訊息,請按下 Ctrl-C 並且再次輸入指令直到看見 "ROAMER2    fastboot" 之類的訊息回應。

- -

接著請快速在重開機當中輸入下面指令:

- -
fastboot flash boot boot.img
-fastboot flash userdata userdata.img
-fastboot flash system system.img
-fastboot flash recovery recovery.img
-fastboot erase cache
-fastboot reboot
- -
-

Note: 如果一直看到 "< waiting for device >" 訊息,請嘗試在指令開頭前加上 sudo ,例如 "sudo falshboot flash boot boot.img"。

-
- -

如果來不及輸入完指令,請從 "adb reboot bootloader" 指令開始再試一次。

- -

一切順利的話,重開機後又會看到第一次手機啟用頁面,ZTE Open 此刻已經升級到 v1.2,進入系統後會看到許多測試 app ,請隨意自由自由刪除。

- -
-

Note: Upgrading your ZTE Open to Firefox 1.1 or 1.2 (fastboot enabled)Frédéric Harper 所撰寫的文章也提供了有用的安裝步驟說明。

-
- -
-

Note: ZTE Open 的 v1.2 版有一個通知欄無法展開的問題,這個問題可以藉由燒錄最新的 Firefox OS 1.2 工程版解決,請確認 ADB 安裝好了 還有 遠端除錯 開啟,然後在 terminal 輸入下面指令:
-
- git clone -b v1.2 https://github.com/mozilla-b2g/gaia.git gaia_v1.2
- cd gaia_v1.2
- make reset-gaia

-
- -

Firefox OS 1.3 and beyond

- -

ZTE currently haven't released builds for Firefox OS 1.3 and beyond. To get these on your ZTE open you'll have to manually build and install a new Firefox OS/B2G build on it (start at the build prerequisite instructions, and treat the ZTE like it is an Inari device, for the purposes of configuration). You can recover your phone if necessary, using the procedure cited in the {{ anch("I bricked my phone") }} section.

- -

Phone features

- - - -
-

Note: the Hong Kong phones also support tri-band 3G Networks — HSDPA 850/1900/2100 (850/1900 for US, CA, 850/1900/2100 for Asia, AU, and 900/2100 for EU.)

-
- -

Wireless carriers

- -
-

Pricing information is for reference only and may not be accurate. Visit the associated link for official information.

-
- -

US carriers

- -

AT&T

- - - -
Sampling of prepaid AT&T plans
- -

Prepaid GoPhone®, Smartphone Plans

- - - -

Aio

- - - -
Sampling of prepaid Aio plans
- - - -

Good2GO

- - - -
Sampling of prepaid Good2GO plans
- - - -

Other {{ anch("AT&T") }} MVNOs

- -

These carriers do not offer additional 3G data.

- - - -

T-Mobile

- - - -

Canadian carriers

- -

The US version of the ZTE Open also work in Canada on carriers that use the Bell/Telus network, or the Rogers network. Some regional carriers like Sasktel or MTS that have UMTS should work too.

- -

It will not work on carriers that do not use UMTS or GSM, like Public Mobile, nor on the carriers that use the AWS band like WIND Mobile, Mobilicity, Videotron or Eastlink.

- -

Memory card

- -

File system

- -

In order to be recognized by the phone, the MicroSD card must be formatted as a FAT32 file system. If a card is new or has never been reformatted, it should work as is.

- -

Device revisions

- -

Revision 01

- -

Phones produced before 09/27/2013 do not have fastboot enabled and must be updated. Normally, this would be handled by Software Updates, but since some users have reported trouble with this method, ZTE have made SD card packages available to enable fastboot on earlier devices. Flash images for:

- - - -

The zip file is linked under Downloads.  Note that you need to download the version with your OS revision in it (that is, download the "V1.1.0B02(for V1.0)" if you are upgrading from V1.0).  Once the file is downloaded and unzipped, follow the instructions in the bundled PDF to flash the package to your phone.

- -

Related Support Forum Questions:

- - - -

Revision 02

- -

Phones produced on or after 09/27/2013 are fastboot enabled by default. This includes the Hong Kong phones.

- -
-

Note: If you are unsure of your phone's revision, check it in Settings > Device Information > Software. If it is older than the following version numbers, you will need to update your phone using the above SD packages to enable fastboot.

- - -
- -

Device support

- -

Once your phone has {{ anch("Device revisions","fastboot enabled") }}, you will then be able to build and install new Firefox OS/B2G builds on it (start at the build prerequisite instructions, and treat the ZTE like it is an Inari device, for the purposes of configuration), and recover your phone if necessary, using the procedure cited in the {{ anch("I bricked my phone") }} section.

- -

If you encounter errors about setting the system time while flashing a custom build, you may need to download a modified boot image.

- -

I bricked my phone

- -

If you are in the process of modifying your phone and it becomes “unresponsive” you should be able to recover it using fastboot with the following simple procedure.

- -

First remove the USB cable and then remove the battery from the phone for 30 seconds. Then reinsert the battery and press the volume up button while holding the power button for a few seconds. Next reconnect the USB cable and run the following commands from a terminal window in the directory that contains the SD package files described above (it is worth checking for an update to the SD package before you do this):

- -
fastboot flash recovery recovery.img
-fastboot flash boot boot.img
-fastboot flash userdata userdata.img
-fastboot flash system system.img
-fastboot reboot
-
- -

This process should recover your phone. If it doesn't seem to work, you may have to try it a second time.

- -

Headphones not working?

- -

We found that the headset jack is designed by a Chinese manufacturer that has compatibility problems with other brands of headsets that include microphones. You may have voice mute problems when you try to use headsets made by Apple, Samsung, HTC, and others. You can buy a 3.5 mm headset adapter that reverses the microphone and ground pins to avoid this problem. For more information, see {{ Bug("812607") }}.

- -

Other support notes

- -

Some customers have come across an Issue of FOTA updates failing to enable fastboot; this is still under investigation, and we are assisting ZTE to analyze every scenario. We will post more information as it is available.

- -

If your phone was unfortunately damaged during the FOTA update because of ZTE providing false or wrong update files, you can attempt to restore it to factory settings using the appropriate SD image and instructions referenced in {{ anch("Revision 01") }}. Otherwise, send your phone back to the eBay store you purchased it from in exchange for a new one. You may contact the store owner directly via an eBay message.

- -

See also

- -

Official Dev Phone page on Firefox Marketplace

- -

Draft User Manual [en-US] - PDF

diff --git a/files/zh-tw/archive/b2g_os/platform/apps_architecture/index.html b/files/zh-tw/archive/b2g_os/platform/apps_architecture/index.html deleted file mode 100644 index 2524c81d0b..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/apps_architecture/index.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Firefox OS apps 架構 -slug: Archive/B2G_OS/Platform/Apps_architecture -translation_of: Archive/B2G_OS/Platform/Apps_architecture ---- -
-

本文旨在說明 Firefox OS 內部如何管理和啟動應用程式,主要是針對 Firefox OS 平台開發者以及正在移植 Firefox OS 到新硬體裝置上的開發者,如果你只是一個單純 App 開發者並不會需要知道,不過有興趣的話還是可以看看了解 Firefox OS。

-
-

App 啟動程序

-

當 app 被啟動時,主畫面 app (Home screen app) 會透過 {{domxref("App")}} API 取得 app 的參照,然後呼叫 {{domxref("App.launch()")}} 方法來啟動 app。

-

Gecko 收到相關請求後會發送一個含有 app 詳細資訊的 {{domxref("mozChromeEvent")}} 到系統 app (System app),系統 app 接著會將一個 {{HTMLElement("iframe")}} 加入 DOM 樹(DOM tree)中,然後將 app 載入該 {{HTMLElement("iframe")}} 裡,直到 app 終止前這個 iframe 就是 app 的家。

-

每一支 app 都需要一個描述該 app 的 manifest 檔,app 包也需要遵照特定檔案階層,詳情請見 App manifest

-

和 Gecko 溝通

-

Gecko 和 Gaia' 系統 app 之間的溝通是經由 {{domxref("mozChromeEvent")}} 以及 {{domxref("mozContentEvent")}} 完成。 mozChromeEvents 是從 chrome 廣播到內容,而 mozContentEvents 是從內容廣播到 chrome,這些溝通主要在控管受信任 UI 的創建與終止,還有在為通知和其他任務,包括通知系統 app 啟動某個 app,提供必要的功能。

-
-

Note: 請參考 System app 文件 以取得更多有關這些事件如何運作的細節,同時也可以參考相關的原始碼 {{source("b2g/chrome/content/shell.js")}}。

-
-

延伸閱讀

- diff --git a/files/zh-tw/archive/b2g_os/platform/gaia/gaia_apps/index.html b/files/zh-tw/archive/b2g_os/platform/gaia/gaia_apps/index.html deleted file mode 100644 index 4a284db78e..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/gaia/gaia_apps/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Gaia apps -slug: Archive/B2G_OS/Platform/Gaia/Gaia_apps -translation_of: Archive/B2G_OS/Platform/Gaia/Gaia_apps ---- -
-

Gaia 位在 Firefox OS 的上層,其中包含系統管理功能以及一系列 Firefox OS 內建 apps。所有 Gaia 的原始碼 — 即便系統和鍵盤輸入法 — 都是由 HTML5 (HTML + CSS + JavaScript) 和 Open WebAPIs 技術所建構而成的,本文旨在說明 Gaia 內建的 apps 是如何運作之。

-
-

Gaia 功能類別

-

Gaia 內不同的 apps 大致上可以分成以下幾類。

-
-

Note: 許多 app 運作說明都會連結到 Gaia Github repo 上的 README 頁面,那是因為很多 app 都還在快速開發迭代階段,常常會有更動,所以一直更新 MDN 相當不切實際,如果想要進一步獲取最新的資訊,請再參考各 README 頁面。

-
-

平台類

-

包括系統、設定、螢幕鎖定、建置腳本和藍芽 apps。

-

-

平台類 apps:

-
-
- 系統 (System)
-
- System app 是第一個在 Firefox OS 開機程序 中被 Gecko 載入的web app,它負責處理許許多多系統運行工作,所以不算是在一般個別 web app 的範疇內。
-
- 瀏覽器 (Browser)
-
- Browser app (現在算是 System 一部分) 當有相關需求時,如網頁瀏覽、搜尋或書籤標記,提供瀏覽器類的功能。
-
- 視窗管理 (Window Management)
-
- Firefox OS 視窗管理功能 — 包括 app 生命週期和互動、通知、動畫等等 — 由 System app 特定一塊負責。
-
- 設定 (Settings)
-
- Settings app 讓使用者設定裝置、回應當前活動呼叫 (帶有 configure 名稱的 Web 活動),讓其他 app 可以跳轉到 Settings app 其中的設定面板處理需要的設定任務 (例如說顯示 wifi 設定面板當數據傳輸無法使用時)。
-
-

通訊類

-

包括 Dialer, Contact, SMS apps 與 FTU apps.

-

-

生產力類

-

包括 Email, Calendar, 與 Clock apps.

-

-

生產力類 apps:

-
-
- 日歷 (Calendar)
-
- Firefox OS 內建 calendar app.
-
- 時鐘 (Clock)
-
- Firefox OS 預設 Clock app,具備鬧鈴、計時等功能
-
- Email
-
- Gaia e-mail app.
-
-

媒體類

-

包括 Camera, Gallery, Music, 和 Video apps 等等媒體相關功能,如桌布和轉送 DRM 鎖。

-

-

媒體類 apps:

-
-
- 影音 (Video)
-
- Video 是影音媒體撥放器。
-
- 相機 (Camera)
-
- Firefox OS 使用者透過相機照相、錄影,它也會回應 type 為pick 的 Web 活動,讓其他想使用相機功能的 app 使用相機。
-
-

其他 Gaia 特色功能

-

除了上述功能,Gaia 還有其他功能如 browser, homescreen, marketplace, test framework, PDF viewer, 和 app manager 等。

-
-
- pdf.js
-
- pdf.js 是 HTML5 基礎的 PDF 瀏覽器,Gaia 用其來瀏覽 PDF,請注意 pdf.js 的程式碼庫 (repo) 和 Gaia 是分開來的。
-
diff --git a/files/zh-tw/archive/b2g_os/platform/gaia/index.html b/files/zh-tw/archive/b2g_os/platform/gaia/index.html deleted file mode 100644 index d2a4886cf1..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/gaia/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Gaia -slug: Archive/B2G_OS/Platform/Gaia -tags: - - B2G - - Gaia - - Mobile - - NeedsTranslation - - TopicStub -translation_of: Archive/B2G_OS/Platform/Gaia ---- -

Gaia is the user interface level of Firefox OS. Everything that appears on the screen after Firefox OS starts up is drawn by Gaia, including the lock screen, home screen, dialer, and other applications. Gaia is written entirely in HTMLCSS, and JavaScript. Its only interface to the underlying operating system and hardware is through standard Web APIs, which are implemented by Gecko.

-

Because of this design, not only can Gaia be run on Firefox OS devices, but also on other operating systems and in other web browsers (Albeit with potentially degraded functionality depending on the capabilities of the browser).

-

Third party applications onto the device installed alongside Gaia can be launched by Gaia.

- - - - - - - -
-

Documentation about Gaia

-
-
- Introduction to Gaia
-
- Gaia is the user interface application for Firefox OS devices; it's simply a Web application running atop the Firefox OS software stack. This guide introduces Gaia at a high level.
-
- Gaia hacking guide
-
- A guide to hacking and modifying the Gaia interface.
-
- Gaia Build System Primer
-
- Most of the meaniful work for the build steps are performed by the scripts that live inside the build/ subdirectory of Gaia.
-
- Gaia Hacking Tips And FAQ
-
- A list of helpful tips and frequently asked questions around hacking on Gaia.
-
-

View All...

-
-

Getting help from the community

-

If you're working with Gaia, or developing Gaia applications, there are community resources to help you!

-
    -
  • Consult the Boot to Gecko project forum: {{ DiscussionList("dev-gaia", "mozilla.dev.gaia") }}
  • -
-

 

-
- - -

Resources

- -
-

 

diff --git a/files/zh-tw/archive/b2g_os/platform/gaia/introduction_to_gaia/index.html b/files/zh-tw/archive/b2g_os/platform/gaia/introduction_to_gaia/index.html deleted file mode 100644 index 27c9ea5ea4..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/gaia/introduction_to_gaia/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Gaia 簡介 -slug: Archive/B2G_OS/Platform/Gaia/Introduction_to_Gaia -translation_of: Archive/B2G_OS/Platform/Gaia/Introduction_to_Gaia ---- -

Gaia 是 Boot to Gecko (B2G) 的使用者介面;它只是在 B2G 裝置、模擬器、桌上型電腦版本、或是 Firefox 版本上運作的一個網頁應用程式 (Web application)。如果想要在 Gaia 上添加 apps 程式或是做一些改變的話,所有你需要了解的就是網頁科技 (Web Technologies),例如 JavaScriptHTML、和 CSS

-

Gaia 的鎖定畫面

-

鎖定畫面預設是啟動的,而預設解鎖密碼 (PIN) 是「0000」。隨著這個功能會隨著時間愈趨完整。

-

預設的 Gaia 介面

-

Gaia 的預設介面跟大家所見最典型的智慧型手機相仿,如這邊所看到的圖。

-

screenshot.png這是張 prerelease 版本作業系統的圖,有一些暫時使用的圖示(和一些測試的程式)。頂端的狀態條顯示手機正在使用哪個行動網路 (如果行動裝置沒有網路的話,會顯示「No SIM card」)、行動網路強度、WiFi 訊號強度、電池使用狀態、和現在的時間。

-

畫面的中間區域顯示應用程式的圖示;透過螢幕的圖示切換左右頁。

-

在螢幕的底部是一個底座,可以放四個最常用的應用程式。現在底座還不能修改,且被預設顯示播號 (Dialer)、訊息 (Messages)、市集 (Market)、和瀏覽器 (Browser)的程式。

diff --git a/files/zh-tw/archive/b2g_os/platform/gonk/index.html b/files/zh-tw/archive/b2g_os/platform/gonk/index.html deleted file mode 100644 index 71d064ac30..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/gonk/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Gonk -slug: Archive/B2G_OS/Platform/Gonk -translation_of: Archive/B2G_OS/Platform/Gonk ---- -

{{draft()}}

-
-

Gonk是Firefox OS的底層系統,包含基於Android Open Source Project (AOSP)的Linux核心以及硬體抽象層(hardware abstraction layer, HAL)。本文旨在說明Gonk的組成,更多有關FireFox OS架構以及Gonk是如何配置在其中的細節,請參考Firefox OS架構指南。

-
-

Gonk 概觀

-

在Gecko原始碼中,有一個b2g/資料夾,這個資料夾含有Gonk接口,它為網頁開啟了行動裝置的硬體能力。這其中包含了Linux核心、HAL和其他OEM特定的函式庫(library)。好機個Gonk函式庫是開放原始碼專案,如libusb, bluez等,有些HAL部分則是和Android專案共享,如GPS, camera等。

-

Gonk是裝置接口層,介於硬體和Gecko之間的配接器。Gonk是一個相對簡單的Linux發布版本,可以視為Gecko的配接目標,就像是Gecko和OS X, Windows和Android的接口。

-
-

Note: 由於不同的行動裝置有不同的晶片組與硬體規格,所以可能會有不同的Gonk發布版本。

-
-

Firefox OS專案擁有Gonk百分之百的控制權,所以能夠提供Gecko那些原本在其他作業系統上無法看到的介面,例如,Gecko可以直接存取電話系統框架和Gonk的顯示frame buffer。

-

Gonk 原始碼

-

B2G repo on Github 上有多種裝置的官方Gonk支援移植,可以視為Gonk的檔案庫。至於裝置支援列表,請見B2G/config.sh。

-

大部分Gonk相關的日常工作包括了移植Gonk到不同硬體上,還有確保Gecko能在不同硬體上順利運行。

-
-
-

 

diff --git a/files/zh-tw/archive/b2g_os/platform/index.html b/files/zh-tw/archive/b2g_os/platform/index.html deleted file mode 100644 index fe9474eed5..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Firefox OS 平台 -slug: Archive/B2G_OS/Platform -translation_of: Archive/B2G_OS/Platform ---- -

Firefox OS 平台是由多樣的元件所組成。如果你只是要撰寫能在 Firefox OS 上執行的 App,其實不太需要通盤了解其架構。但如果你從事平台開發、平台移植,甚或只是單純好奇的話,也許會對以下說明文件感興趣。

- - - - - - - - -
-

關於 Firefox OS 平台的說明文件

- -
-
Firefox OS 架構概述
-
簡單概述 Firefox OS 的內部架構,可供平台開發或移植工程師初步了解 Firefox OS。
-
 
-
Firefox OS 的 App 架構
-
概述 Firefox OS 的 App 模型。
-
Gaia
-
Gaia 是 Firefox OS 裝置的使用者介面 (UI) App,也是在 Firefox OS 軟體堆疊上執行的 Web App。
-
Gonk
-
Gonk 的說明文件。Gonk 屬於 Gaia 之下的作業系統層,包含 Linux kernel 硬體抽象層 (Hardware abstraction layer),且由 Gecko 負責之間的溝通。
-
Gecko
-
Gecko 即為 Firefox、Thunderbird,以及其他許多 App 所使用的相同 Open Web 標準實作。
-
安全性
-
Firefox OS 的安全性說明文件,包含各個面相的裝置安全,適合 App 開發者、裝置整合商等參考。
-
Firefox OS 記憶體耗盡時的管理作業
-
本文將解釋 Firefox OS 記憶體不足時的管理方式,可透過記憶體清理與記憶體不足通知等功能。
-
功能支援表
-
各個 Firefox OS 版本所支援的各項功能特色。
-
Firefox OS 設定清單
-
常見的設定名稱清單,可搭配 Settings API。
-
- -

全部文章...

-
-

尋求社群協助

- -

如果你正在開發 Firefox OS,或是可於 Firefox OS 裝置上執行的 App,則能參閱以下社群資源!

- -
    -
  • Boot to Gecko 論壇:{{ DiscussionList("dev-b2g", "mozilla.dev.b2g") }}
  • -
- -
    -
  • 在「Boot to Gecko」的 IRC 頻道上提問:#b2g
  • -
- -

請遵守網路禮節...

- - - - - - -

相關資源

- - -
- -

 

diff --git a/files/zh-tw/archive/b2g_os/platform/out_of_memory_management_on_firefox_os/index.html b/files/zh-tw/archive/b2g_os/platform/out_of_memory_management_on_firefox_os/index.html deleted file mode 100644 index 5b7f2045cc..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/out_of_memory_management_on_firefox_os/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Firefox OS 記憶體管理 -slug: Archive/B2G_OS/Platform/Out_of_memory_management_on_Firefox_OS -translation_of: Archive/B2G_OS/Platform/Out_of_memory_management_on_Firefox_OS ---- -
-

Firefox OS 會運行在一些記憶體容量不大的裝置上,當程序用盡了記憶體,系統核心就必須關閉其他程序好釋放出記憶體使用。本文旨在描述記憶體關閉和記憶體不足通知如何運作、如何控制關閉那些程序,以確保當記憶體不夠時,主系統還是可以運作。

-
-

記憶體不足時會有兩個系統介入管理: Low memory killer (LMK) Low memory notifications.

-

Low memory killer

-

LMK 是 Android 核心的次系統,這個次系統負責關閉程序好騰出記憶體使用。為了決定程序關閉優先順序,每一個程序都會透過 /proc/<pid>/oom_adj or /proc/<pid>/oom_score_adj files 被賦予一個優先值,這個優先值為調整分數(adjustment score 或 oom_adj)。

-

一般來說 oom_adj 值越大,程序越容易被刪除,LMK 提供多個層級,每個層級對應到一定容量的可用記憶體以及最小 oom_adj 值。當可用記憶體掉到某一個層級,所有 oom_adj 值大於該層級 oom_adj 值的程序都有可能被關閉,LMK 會從占用最多記憶體的程序開始一個一個關閉,直到可用記憶體回復到安全層級為止。

-
-

Note: 被 LMK 關閉的背景 app 仍然以 "殭屍 app" 的形式存在在程序管理員 (task manager),下次再回到該 app,app 會被重新喚醒。目前最大殭屍 app 的數量是 10。

-
-
-

Note: 為了記憶體不足被關閉的 app 不一定就是造成記憶體不足的原因。

-
-

程序關閉優先順序

-

Firefox OS 關閉 app 的優先順序是由每個 app 給定的優先層級和相關聯的 OOM 調整分數所決定 (現有值都存在 pref):

-
    -
  1. 最先關閉的 app 是背景 app,最近最少使用的。
  2. -
  3. 第二是 homescreen app。
  4. -
  5. 接下來是使用者可察覺的背景 app (例如,在背景撥放音樂的程式,或高優先 (high-priority)、或持有 cpu wakelock 並且註冊有系統訊息處理器(system messages handler) 的 app)。
  6. -
  7. 第四是鍵盤程式。
  8. -
  9. 前景 (Foreground) app 則是第五順位被關閉的 app。
  10. -
  11. 最後則是前景高優先 (high-priority)、或持有 cpu wakelock 的前景 app。
  12. -
-
-

Note: 大部分在前景的子程序持有為 2 的oom_adj,背景子程序則持有 3 ~ 6 的 oom_adj,背景子程序到底會持有多大 oom_adj 值取決於許多因素,比如說是否撥放音月或是否屬於 homescreen app。

-
-

下面是例外:

- -

記憶體過低通知

-

第二個釋放記憶體的機制是記憶體過低通知。當可用記憶體量低過一定的門檻值,LMK 便會向使用者空間 (userspace) 發出記憶體過低通知,系統 app 和一般使用者 app 都會等待這個通知,然後透過觀察器服務 (observer service) 發出 memory-pressure 事件回應之;這個事件 app 不會直接看見,只有 C++ 和 Chrome JS 程式碼會看到,在 Gecko 裡我們從這個事件中會盡一切可能釋放記憶體 — 通常是刪除內部快取 (images, DNS, sqlite, 等等),拋棄可以回復的物件 (比如 WebGL contexts) 還有執行垃圾回收機制。
-
- 當碰到記憶體過低狀況時,第一個發出的 memory-pressure 事件會有 low-memory 負載,倘若經過預定的5秒後我們依然處於記憶體過低狀態,另一個 memory-pressure 事件會發出,不過這一次是帶著 low-memory-ongoing 負載,這個時候我們持續處於記憶體過低狀態,很明顯地像一些垃圾回收機制等大動作的作法也不夠了,所以其他一些更低階的記憶體釋放作法會被採行。

-

LMK 和記憶體過低通知如何協同運作

-

目前記憶體過低門檻介於 LMK 的背景 app 層級(大於)和 homescreen 層級(小於)之間,所以整體記憶體不足的反應機制如下:

-
    -
  1. 關閉最近最不常用的背景 app。
  2. -
  3. 當記憶體依然不足,發出 memory-pressure 事件通知給所有的 app。
  4. -
  5. 當記憶體依然不足,每5秒發出 memory-pressure 事件,但標記為 ongoing 讓垃圾回收機制不要回應。
  6. -
  7. 關閉 homescreen.
  8. -
  9. 關閉使用者可察覺或高優先值的背景 app。
  10. -
  11. 關閉運作中的鍵盤 app。
  12. -
  13. 關閉前景 app。
  14. -
  15. 關閉高優先值的前景 app。
  16. -
  17. 關閉 preallocated 程序。
  18. -
diff --git a/files/zh-tw/archive/b2g_os/preparing_for_your_first_b2g_build/index.html b/files/zh-tw/archive/b2g_os/preparing_for_your_first_b2g_build/index.html deleted file mode 100644 index 1d165926a1..0000000000 --- a/files/zh-tw/archive/b2g_os/preparing_for_your_first_b2g_build/index.html +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: 準備第一次建置 B2G -slug: Archive/B2G_OS/Preparing_for_your_first_B2G_build -translation_of: Archive/B2G_OS/Preparing_for_your_first_B2G_build ---- -

在開始建置 B2G 前,要先複製整個倉儲 (repository)並且作編譯的設定。這篇文章說明要怎麼做。

- -

複製 B2G 倉儲(repository)

- -

在第一次編譯前,要做的第一步就是複製 B2G 的倉儲(repository)。這個步驟將不會把所有東西抓下來!相反地,他會抓 B2G 建置系統和安裝工具。B2G 大部分的程式碼都在主要的 Mozilla Mercurial 倉儲。

- -

用 git 來複製倉儲:

- -
git clone git://github.com/mozilla-b2g/B2G.git
- -

複製了之後(應該會花個幾分鐘),cd 到 B2G 的目錄:

- -
cd B2G
-
- -

複製 B2G 樹(tree)到一台新機器

- -

當您有一台新電腦時(超幸運的!),您會覺得把 B2G tree 從一台電腦轉移到另一台電腦的話,生活會簡單很多。

- -

將您就電腦的磁碟掛上(mount)到新的電腦,然後敲入下面的指令,就可以做到:

- -
rsync -a source/ dest/
-
- -

source 是整個原始碼樹(source tree)的完整路徑 (包括後面的斜線),而 dest 是您要複製的目的位置 (同樣也包含後面的斜線,它很重要!)。

- -

這樣做之後,您可以跳過這篇文章剩下的部份,然後直接跳到的「建置」部份。

- -

設定專屬於您的行動裝置的 B2G

- -
重要:請注意只支援 Android 4 (aka. Ice Cream Sandwich) 的行動裝置。請確認您的手機運作的真的是 ICS,否則這個步驟很可能會失敗於某些非 Nexus 裝置的驅動程式。另外,如果您必須要將行動裝置燒成 ICS,請留意有些 USB hubs 和燒錄工具不相容,因此您可能需要將行動裝置連接到內建的 USB port。
- -

擷取了核心的 B2G 建置系統之後,您需要為了要安裝的行動裝置作設定。您可以使用 config.sh 工具來擷取支援的行動裝置列表,如下:

- -
./config.sh
-
- -

這會顯示支援的行動裝置列表;舉例來說:

- -
Usage: ./config.sh [-cdflnq] (device name)
-Flags are passed through to |./repo sync|.
-
-Valid devices to configure are:
-- galaxy-s2
-- galaxy-nexus
-- nexus-4
-- nexus-4-kk
-- nexus-5
-- nexus-5-l
-- nexus-s
-- nexus-s-4g
-- flo (Nexus 7 2013)
-- otoro
-- unagi
-- inari
-- keon
-- peak
-- hamachi
-- helix
-- tarako
-- dolphin
-- dolphin-512
-- pandaboard
-- vixen
-- flatfish
-- flame
-- flame-kk
-- flame-l
-- rpi (Revision B)
-- emulator
-- emulator-jb
-- emulator-kk
-- emulator-l
-- emulator-x86
-- emulator-x86-jb
-- emulator-x86-kk
-- emulator-x86-l
-> Sony Xperia devices
-- aries (Z3 Compact KK)
-- aries-l (Z3 Compact L)
-- leo-kk (Z3 KK)
-- leo-l (Z3 L)
-- scorpion-l (Z3 Tablet Compact L)
-- sirius-l (Z2 L)
-- tianchi-l (T2U L)
-- flamingo-l (E3 L)
- -

如果您的行動裝置沒被列出,您應該馬上停止來幫忙將 B2G 移植到您的行動裝置,或是等到某個人移植完之後再安裝。我們當然比較希望您可以幫忙移植!

- -
注意:如果因為任何原因您想要編譯某個版本的 Gecko,請在您著手之前先看 Building against a custom Gecko
- -

設定給行動裝置

- -

首先,連接您的裝置;設定的過程會需要存取它。

- -

如果您的裝置有被列出,您可以再執行一次 config.sh 來開始設定的程序,這次需要指名您的行動裝置的名字。舉例來說,如果要編譯給 Samsung Google Nexus S的話,您要打:

- -
./config.sh nexus-s
-
- -

在設定一開始的附近您可能會需要設定使用顏色的選項,而在這之後設定程序會繼續下去。接著可以去喝個咖啡休息一下,因為這個時候您會第一次把建置 Boot to Gecko 中所有需要的程式碼都抓下來。

- -

如果您的手機不再使用 Android 且 B2G tree 還沒裝到手機上,而您又有遵照前幾頁所說、聰明地作了一份 /system 磁區的備份的話,您可以這樣使用它:

- -
ANDROIDFS_DIR=<absolute path to parent dir of system dir> ./config.sh <target>
-
- -

設定來建置模擬器

- -

如果您要編譯模擬器的話,就需要指定 "emulator" 來使用 ARM 的模擬器,或是 "emulator-x86" 來編譯 x86 模擬器。後者比較快,但也因此在表現實際行動裝置上較不準確。
-
- 舉例來說,您要像下面這樣設定來編譯 ARM 模擬器:

- -
./config.sh emulator
-
- -

在設定一開始的附近您可能會需要設定使用顏色的選項,而在這之後設定程序會繼續下去。接著可以去喝個咖啡休息一下,因為這個時候您會第一次把建置 Boot to Gecko 中所有需要的程式碼都抓下來。

- -

編譯客製的 Gecko

- -

可能您會想要或需要以好幾種版本的 Gecko 來編譯 Boot to Gecko (manifest 中預設是一種)。您可以在您抓倉儲 (在上述的 config.sh 之前),藉由編輯 .userconfig 來做到這件事情。舉例來說,如果您要根據 mozilla-central 來編譯:

- -
GECKO_PATH=/path/to/mozilla-central
-GECKO_OBJDIR=/path/to/mozilla-central/objdir-gonk
-
- -
-

注意: 如果是在 Mac OS X 下客製化編譯的話,檔案系統本身會注意 mozilla-central 的大小寫。

-
- -

您可以參考 客製化 .userconfig 設定檔 來客製化更多東西。

- -

接著,開始編譯

diff --git a/files/zh-tw/archive/b2g_os/quickstart/app_tools/index.html b/files/zh-tw/archive/b2g_os/quickstart/app_tools/index.html deleted file mode 100644 index bc539adefa..0000000000 --- a/files/zh-tw/archive/b2g_os/quickstart/app_tools/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: App tools -slug: Archive/B2G_OS/Quickstart/App_tools -translation_of: Archive/B2G_OS/Quickstart/App_tools ---- -
-

用什麼來建立開放式Web應用程序?答案是,"你通常會用它來建立網絡'以下是工具和資源的清單,可以幫助您開始開放式Web應用程序他們可以很容易地成您現有的Web開發工作流程,如果你有一個,或者你可以將它們周圍建立為一個新的工作流程

-
-

應用程序驗證程序

-

您的應用程序以準備好進入Firefox市場應用程序驗證器檢查你的清單,並會顯示任何錯誤,它也有可能顯示你沒有考慮過的警告

-

火狐系統模擬器

-

安裝和使用火狐系統模擬器開始和令你的應用程序運行最簡單的方法安裝模擬器,通過 工具-> Web開發 -> 火狐系統模擬器菜單。啟動後, 便會有JavaScript控制台,以便您可以從模擬器試應用程序啟動和刪除錯誤

-

應用程序管理器

-
-
-  
-
-

的測試工具被稱為應用程序管理器這個工具可以讓你通過USB火狐來連接至兼容的設備(或一個火狐系統模擬器應用程序直接存在設備上,驗證的應用程序,設備上刪除錯誤

-

Firefox的開發者工具

-
-
-
-
- 火狐現在提供了一套開發工具,確保了極大的發展經驗,既好用,又高效率。欲了解更多有關這些工具如何運作,看看還有什麼的Mozilla所提供的,請到我們的工具區域
-
-
-
-

 

diff --git a/files/zh-tw/archive/b2g_os/quickstart/index.html b/files/zh-tw/archive/b2g_os/quickstart/index.html deleted file mode 100644 index a5bb4fa406..0000000000 --- a/files/zh-tw/archive/b2g_os/quickstart/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Build -slug: Archive/B2G_OS/Quickstart -tags: - - Apps - - NeedsTranslation - - Quickstart - - TopicStub -translation_of: Archive/B2G_OS/Quickstart ---- -
-

Quickstart information on coding open web apps.

-
-
-
- Introduction to open web apps
-
- What are open web apps? How they differ from regular web pages? Why is this significant? This article aims to answer these questions and more.
-
- Your first app
-
- This article takes you through the basic steps and additional knowledge on top of regular web development required to create installable open web apps.
-
- Introduction to Firefox OS
-
- An introduction to Firefox OS, Mozilla's new open web app-based mobile platform.
-
- Introduction to manifests
-
- An FAQ designed to answer any questions you may have about manifests, hosting apps, origins, and other such topics.
-
- App development for web developers
-
- If you're a web developer, how do open web apps differ from what you're used to? This article explains all.
-
- App development for mobile developers
-
- If you're a native mobile application developer, what advantages can open web apps bring to you, and how do they differ from what you are used to? Here are some ideas.
-
- Developing app functionality
-
- This page talks about the kinds of different functionality that you might want to build into your apps, with links to further information.
-
- Payments
-
- How do you build functionality to make people pay for installing your open web apps? Here is the lowdown.
-
- App tools
-
- Last for this section, we provide some links to more information on the tools available to help you develop great open web apps.
-
diff --git a/files/zh-tw/archive/b2g_os/quickstart/your_first_app/index.html b/files/zh-tw/archive/b2g_os/quickstart/your_first_app/index.html deleted file mode 100644 index d40315b16c..0000000000 --- a/files/zh-tw/archive/b2g_os/quickstart/your_first_app/index.html +++ /dev/null @@ -1,265 +0,0 @@ ---- -title: Your first app -slug: Archive/B2G_OS/Quickstart/Your_first_app -translation_of: Archive/B2G_OS/Quickstart/Your_first_app ---- -
-

Note: 快速入門這段章節已經取代先前舊的快速入門章節,更新為最新的及更專注於Firefox OS app essentials 文章。我們希望你將發現這份是比舊文更有用和更快學習經驗的文章。

-
- -
-
-

開放式Web應用讓開發人員實現了期盼多年的夙願:通過Firefox OS這一首款開放式Web應用平台,可以僅僅使用HTML、CSS和JavaScript在跨平台的環境中生成可部署的應用。本手冊包含了基本的架構和應用構建指南,你能夠迅速掌握這些內容並開始創造自己的下一個偉大的應用!

-
- -

如果你想按照本指南開發,你可以下載我們的quick start app template.  或可以藉由參閱我們的Apps template 指南,找到更多有關的內容。

- -

App 結構

- -

打包型 Apps VS. 托管型 Apps

- -

開放網絡應用有兩種類型:打包型和托管型。打包型apps本質上來說就是一個包含各種HTML、CSS、JavaScript、圖像、表單等應用資源的zip文件。托管型apps在一個給定域名的服務器上運行,就像是一個獨立的網站。兩種應用都需要有有效的表單。到了要在火狐市場中列出你的app,你要上傳app zip文件或提供托管app所在的URL。

- -
-

{{EmbedYouTube("Q7x-B13y33Q")}}

- -
-

用Treehouse為製作夥伴: Check them out!

-
-
- -

本指南的目的,會讓你將創建一個於本機(localhost)地址上的托管型app。一旦你的app準備好進入火狐市場,你可以選擇把它作為打包app或作為托管app啓動。

- -

App 表單

- -

每一個火狐app都需要一個位於根目錄下的manifest.webapp文件, 這個manifest.webapp 文件提供app有關的重要信息,如:版本、名稱、描述、圖標位址、本地字符串、指明app可以從哪兒被安裝等等。只有名稱和描述是必須的。app模板中的簡單表單如下所示:

- -
{
-  "version": "0.1",
-  "name": "Open Web App",
-  "description": "Your new awesome Open Web App",
-  "launch_path": "/app-template/index.html",
-  "icons": {
-    "16": "/app-template/app-icons/icon-16.png",
-    "48": "/app-template/app-icons/icon-48.png",
-    "128": "/app-template/app-icons/icon-128.png"
-  },
-  "developer": {
-    "name": "Your Name",
-    "url": "http://yourawesomeapp.com"
-  },
-  "locales": {
-    "es": {
-      "description": "Su nueva aplicación impresionante Open Web",
-      "developer": {
-        "url": "http://yourawesomeapp.com"
-      }
-    },
-    "it": {
-      "description": "La tua nuova fantastica Open Web App",
-      "developer": {
-        "url": "http://yourawesomeapp.com"
-      }
-    }
-  },
-  "default_locale": "en"
-}
- -
-

{{EmbedYouTube("dgAUgHQOm8M")}}

- -
-

Made in partnership with Treehouse: Check them out!

-
-
- -

 

- -

一個基本的表單是你所需要最先上手的地方。關於表單的更多細節,見App Manifest.

- -

App 佈局 & 設計

- -

隨著不同設備上屏幕解析度標準的增多,響應式設計已經變得越來越重要。即使你app的主要目標平台是移動平台比如Firefox OS,其他設備很有可能也會訪問它。CSS media queries 使你可以根據設備調整佈局,如下的CSS樣例中所示的結構:

- -
/* The following are examples of different CSS media queries */
-
-/* Basic desktop/screen width sniff */
-@media only screen and (min-width : 1224px) {
-  /* styles */
-}
-
-/* Traditional iPhone width */
-@media
-  only screen and (-webkit-min-device-pixel-ratio : 1.5),
-  only screen and (min-device-pixel-ratio : 1.5) {
-  /* styles */
-}
-
-/* Device settings at different orientations */
-@media screen and (orientation:portrait) {
-  /* styles */
-}
-@media screen and (orientation:landscape) {
-  /* styles */
-}
- -

有許多JavaScript和CSS的框架可以用於協助響應式設計和移動app發展(Bootstrap等),選擇最適合你的app和開發樣式的框架即可。

- -

Web APIs

- -

JavaScript APIs正隨著設備快速開發,同時地被創造和增強。Mozilla的WebAPI 致力於為JavaScript APIs引入成打的標準移動端特性。設備支援和狀況列表可以在WebAPI 頁面中查看。在下面這個例子中,JavaScript 特徵偵測仍然是最好的例子:

- -
// If this device supports the vibrate API...
-if('vibrate' in navigator) {
-    // ... vibrate for a second
-    navigator.vibrate(1000);
-}
- -

在下面這個例子中,<div>的顯示樣式會根據設備的電池狀態的改變而改變:

- -
// Create the battery indicator listeners
-(function() {
-  var battery = navigator.battery || navigator.mozBattery || navigator.webkitBattery,
-      indicator, indicatorPercentage;
-
-  if(battery) {
-    indicator = document.getElementById('indicator'),
-    indicatorPercentage = document.getElementById('indicator-percentage');
-
-    // Set listeners for changes
-    battery.addEventListener('chargingchange', updateBattery);
-    battery.addEventListener('levelchange', updateBattery);
-
-    // Update immediately
-    updateBattery();
-  }
-
-  function updateBattery() {
-    // Update percentage width and text
-    var level = (battery.level * 100) + '%';
-    indicatorPercentage.style.width = level;
-    indicatorPercentage.innerHTML = 'Battery: ' + level;
-    // Update charging status
-    indicator.className = battery.charging ? 'charging' : '';
-  }
-})();
- -

在上面的示例代碼中,一旦你確定設備支持Battery API,你就可以為chargingchange 和 levelchange添加 event listeners 來更新元素的樣式。試試添加下面的指令到快速入門模板,你會看到你的工作效果。

- -

時常檢查WebAPI 頁面以確保更新設備API的狀態。

- -

Install API 功能

- -

在我們的快速入門應用模板範例中,我們已經實現了一個安裝按鈕,可以在你把應用當作一個標準網頁來瀏覽時可以單擊它來把那個網站當作一個應用安裝在Firefox OS上。按鈕標籤並沒有什麼特別的:

- -
<button id="install-btn">Install app</button>
- -

按鈕的功能由Install API實現(見install.js):

- -
var manifest_url = location.href + 'manifest.webapp';
-
-function install(ev) {
-  ev.preventDefault();
-  // define the manifest URL
-  // install the app
-  var installLocFind = navigator.mozApps.install(manifest_url);
-  installLocFind.onsuccess = function(data) {
-    // App is installed, do something
-  };
-  installLocFind.onerror = function() {
-    // App wasn't installed, info is in
-    // installapp.error.name
-    alert(installLocFind.error.name);
-  };
-};
-
-// get a reference to the button and call install() on click if the app isn't already installed. If it is, hide the button.
-var button = document.getElementById('install-btn');
-
-var installCheck = navigator.mozApps.checkInstalled(manifest_url);
-
-installCheck.onsuccess = function() {
-  if(installCheck.result) {
-    button.style.display = "none";
-  } else {
-    button.addEventListener('click', install, false);
-  };
-};
-
- -

我們來簡要的看一下發生了什麼:

- -

1. 我們得到一個安裝按鈕的引用並把它儲存在button變量中。
- 2. 我們使用navigator.mozApps.checkInstalled 來檢查這個由http://people.mozilla.com  /~cmills/location-finder/manifest.webapp 這個表單來定義的應用是否已經安裝在設備上。這個測試結果被儲存在installCheck這個變量中。
-  3. 當測試被成功完成時,它的成功會完成事件被觸發,因此installCheck.onsuccess = function() { ... }會被執行。
-  4. 然後我們用一個if語句判斷installCheck.result是否存在?如果存在,以為著app已經被安裝了,我們就隱藏安裝按鈕。在應用已經被安裝的情況下不需要安裝按鈕。
-  5. 如果app沒有被安裝,為按鈕添加一個單擊事件監聽器。所以在按鈕被單擊的時候,install()函數會被執行。
-  6. 當單擊按鈕並且install()函數執行時,我們把表單檔案位置保存在一個叫manifest_url的變量中,然後利用navigator.mozApps.install(manifest_url)來安裝app,用一個installLocFind變量來儲存對那個安裝的app參考資訊。你會注意到安裝也會觸發success和error事件,所以你可以根據應用是否成功安裝來執行不同的動作。

- -

第一次遇到可安裝web apps時,你可能想要覈實implementation state of the API 的執行狀態。

- -

注意:可安裝開放web apps有一個「每個來源(origin,感覺就是URL的意思)就是一個app」的安全策略;基本上, 你不可以在一個來源上托管多個可安裝apps。這會讓檢測變得有一點複雜,但是仍有很多辦法解決這個問題,比如為應用創建多個子域名、用Firefox OS模擬器測試應用、或者在Firefox Aurora/Nightly上安裝測試功能,通過這種方式你可以在桌面環境上安裝開發web app。關於來源的跟多信息詳見FAQs about apps manifests

- - -

WebRT APIs (基於權限的 APIs)

- -

有些WebAPI雖然可以使用但是需要特定的功能開啓才具有使用的權限。應用可能會像下面這樣在manifest.webapp中記錄權限請求:

- -
// New key in the manifest: "permissions"
-// Request access to any number of APIs
-// Here we request permissions to the systemXHR API
-"permissions": {
-    "systemXHR": {}
-}
- -

權限分為下面三個等級:

- -
    -
  1. -

    一般權限——不需要任何特定訪問權限的API。

    -
  2. -
  3. -

    特殊權限——只要開發者在app表單文件中設置了訪問權限就可以在應用中利用並通過可信任來源進行分發的API。

    -
  4. -
  5. -

    認證權限——控制力設備上關鍵功能的API,比如打電話和發短信的服務。這些一般不允許第三方開發者使用。

    - -

    關於應用權限等級的更多信息,請閱讀Types of packaged apps。你可以在應用權限中找到更多關於API要求權限和需要什麼樣的App permissions.。

    -
  6. -
- -
-

有一點需要注意的很重要就是不是所有的Web API都可以在Firefox OS模擬器中執行。

-
- -

工具 & 測試

- -

測試在對移動應用的支持中是至關重要的。測試可安裝的開放web app有多種方式。

- -

WebIDE 和 Firefox OS 模擬器

- -

安裝和使用Firefox OS模擬器是啓動和運行你的應用最簡單的方式。在你安裝模擬器之後,可以通過工具->web開發者->Firefox OS模擬器菜單來啓動。模擬器啓動時會有一個Javascript控制台,這樣你就可以在模擬器中調試你的應用。

- -

測試工具的新寵兒被稱為app管理器WebIDE。這個工具允許你通過USB鏈接桌面火狐瀏覽器和一個可兼容性設備(或者一個Firefox OS模擬器),直接將app推送到設備上,驗證app並且像運行在設備上一樣的調試。

- -

單元測試

- -

當在測試不同設備和版本時,單元測試就會非常有價值。jQuery的QUnit 是一個流行的客戶端測試工具,當然你也可以使用任何你喜歡的測試工具。

- -

在設備上安裝Firefox OS

- -

既然Firefox OS是一個開源平台,代碼和工具都可以用於在你自己的設備上構建和安裝Firefox OS。構建和安裝指南以及什麼設備可以安裝的注意事項可以在MDN上發現。

- -

特定的Firefox OS開發者預覽版設備可以在Developer preview phone page找到更多信息。
- 應用。

- -

App 提交和分發

- -

一旦你的app完成,你可以像標準網站或app一樣托管它(更多信息請閱讀Self-publishing apps ),或者可以submittedFirefox Marketplace。你的app表單將被驗證並且你可以選擇你的應用將支持的設備(比如:Firefox OS、桌面版火狐瀏覽器、移動版火狐瀏覽器、平板火狐瀏覽器)。一旦驗證通過,你可以為你的app添加更多細節(截屏、描述、價格等)並且正式在火狐市場中提交app列表。提交成功後,你的應用可以被任何人購買和安裝。

- -

更多商場 & 上市信息

- -

    1. 向Firefox OS商場中提交應用 Submitting an App to the Firefox OS Marketplace
-     2. 市場審查標準 Marketplace Review Criteria
-     3. 應用提交演練視頻 App Submission Video Walkthrough

-
diff --git a/files/zh-tw/archive/b2g_os/releases/1.2/index.html b/files/zh-tw/archive/b2g_os/releases/1.2/index.html deleted file mode 100644 index bc8f785f6b..0000000000 --- a/files/zh-tw/archive/b2g_os/releases/1.2/index.html +++ /dev/null @@ -1,465 +0,0 @@ ---- -title: Firefox OS 1.2 for developers -slug: Archive/B2G_OS/Releases/1.2 -translation_of: Archive/B2G_OS/Releases/1.2 ---- -
-

Firefox OS 1.2 is at a pre-release stage right now. Its Gecko component is based on Firefox 26 (encompassing all Gecko additions between Firefox 19 and Firefox 26; see Firefox 26 release notes for developers for the latest.) This page details the developer features newly implemented in Firefox OS 1.2.

-
- -

Developer Tools

- - - -

HTML

- -

General Gecko:

- - - -

CSS

- -

General Gecko:

- - - -

JavaScript

- -

General Gecko:

- -

EcmaScript 6 (Harmony) implementation continues!

- - - -

Telephony-specific additions (mostly API-related)

- - - -

DOM/API

- -

Firefox OS-specific:

- - - -
New WebGL 1 extensions supported in Firefox OS 1.2:
- - - -
-
Note: availability of these extensions depends on device capabilities; not all extensions will be available on all devices.
-
- -

General Gecko:

- - - -

SVG

- -

General Gecko:

- - - -

MathML

- -

General Gecko:

- - - -

Network

- -

General Gecko:

- - - -

Worker

- -

General Gecko:

- - - -

Security

- -

General Gecko:

- - - -

XForms

- -

General Gecko:

- -

Support for XForms has been removed in Firefox 19.

- -

See also

- - - -

Older versions

- -

- -

- -

- -

Share this article: http://mzl.la/1av9ZRr

diff --git a/files/zh-tw/archive/b2g_os/releases/index.html b/files/zh-tw/archive/b2g_os/releases/index.html deleted file mode 100644 index 3edbcd4c75..0000000000 --- a/files/zh-tw/archive/b2g_os/releases/index.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Firefox OS developer release notes -slug: Archive/B2G_OS/Releases -tags: - - Firefox OS - - NeedsTranslation - - TopicStub -translation_of: Archive/B2G_OS/Releases ---- -

Firefox OS release notes by version

-

This section provides articles covering each new release of Gaia and Gecko for Firefox OS, explaining what features were added and bugs eliminated in each update. There is also a linked summary table showing what APIs are supported by each version of Firefox OS.

-
- {{ListSubpages("",1,0,1)}}
-

Other supporting information

-
-
- Firefox OS API support table
-
- Lists the different APIs available, and what versions of Firefox have support for them.
-
- App permissions
-
- Lists hosted, privileged and certified APIs, along with information on the permissions they need to have set in the App Manifest of your installable apps, such as the manifest permission name, app type required, description, access property, and default permission.
-
diff --git a/files/zh-tw/archive/b2g_os/running_custom_builds_in_the_app_manager/index.html b/files/zh-tw/archive/b2g_os/running_custom_builds_in_the_app_manager/index.html deleted file mode 100644 index be4fefd747..0000000000 --- a/files/zh-tw/archive/b2g_os/running_custom_builds_in_the_app_manager/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: 在 WebIDE 中執行 Firefox OS/Gaia 自訂版本 -slug: Archive/B2G_OS/Running_custom_builds_in_the_App_Manager -translation_of: Archive/B2G_OS/Developing_Gaia/Running_custom_builds_in_WebIDE ---- -
-

Firefox OS 模擬器 (Firefox OS Simulator) 已於 2014 年 2 月新增功能,可執行自訂的 B2G 執行環境及/或 Gaia 設定檔 (Profile)。本文將說明相關設定方式,並透過 WebIDE 執行模擬器。

-
-
-

注意:在本文發表之時,滑鼠事件尚未能正確對應觸控事件。例如回到主畫面鈕並無法回應滑鼠點擊的動作。但只要使用 B2G Desktop 鍵盤指令,即可解決此問題。可參閱「Using the B2G Desktop client」。

-
-
-

注意:如果你能提交 Try 版本,則可在各個 B2G 桌面平台的版本路徑中產生模擬器附加元件。如此可讓模擬器搭配自訂的 Gecko,或搭配對 Gaia 上進行的修改。在某些使用條件下可選用此較簡易的方式。

-
-

必要條件

-

要在模擬器內執行自訂版本,必須齊備相關工具。

-
    -
  1. 安裝 Firefox 並確定其內有 WebIDE (工具 > 網頁開發者 > WebIDE)。
  2. -
  3. 安裝最新版 B2G Desktop Nightly,或建構自己的版本
  4. -
  5. 安裝最新版 Firefox OS 模擬器套件,即 7.0pre7.20140113 或更高版本。或可將 FXOS_SIMULATOR=1 添增到自己的 mozconfig,並使用 ./mach build && ./mach package,從自己的 B2G Desktop 原始碼來建構。
  6. -
  7. SIMULATOR=1 flag 建立 Gaia 設定檔。舉例來說,你可在自己的 Gaia 路徑中執行 make SIMULATOR=1 PROFILE_FOLDER=profile-b2g profile-b2g 指令 (請參閱 Hacking Gaia 進一步了解)。
  8. -
-

設定自己的模擬器

-

你必須完成某些設定,才能讓模擬器找到你的 B2G Desktop 與自訂的 Gaia。

-
    -
  1. 打開附加元件管理分頁 (工具 > 附加元件;或在網址列中輸入 about:addons)。
  2. -
  3. 點擊「擴充套件 (Extensions)」分頁,可列出現已安裝的套件。
  4. -
  5. 在清單中找到新的 Firefox OS 模擬器擴充套件。應該會顯示如 Firefox OS 1.3 Simulator 7.0pre.7.20140113
  6. -
  7. 點擊此擴充套件內的「選項 (Preferences)」按鈕。
    - the Firefox OS simulator preferences: Preferences, disable and remove.
  8. -
  9. 如果你要使用自訂的可執行檔 (最新的 B2G Desktop 版本),以利於 WebIDE 中執行 Firefox OS,則點擊「Select a custom runtime executable」旁邊的「Browse...」按鈕,在檔案選擇介面中找到自己的 B2G Desktop 可執行檔。如果是 Windows/Linux 環境就很好找;而在 Mac 環境中,只要安裝於 Applications 路徑下,就可於 /Applications/B2G.app/Contents/MacOS/b2g 找到。
  10. -
  11. 你也能在 WebIDE 中執行自訂的 Gaia 設定檔。同樣點擊「Select a custom Gaia profile directory」旁邊的「Browse...」按鈕,找到自訂的設定檔路徑 (應該是 gaia/profile-b2g)。
  12. -
  13. 如果要回到非自訂的模擬器,只要重新設定組態值即可。但不能單純的刪除再重新安裝模擬器附加元件。你必須開啟新的分頁,在網址列中輸入「about:config」,繼續在該頁的搜尋欄位中輸入「fxos」或「simulator」,找到如「extensions.fxos_2_0_simulator@mozilla.org.customRuntime」,或「extensions.fxos_2_0_simulator@mozilla.org.gaiaProfile」。這時按下滑鼠右鍵並點選「Reset」。最後重新啟動模擬器版本,就能使用非自訂版本的模擬器。
  14. -
-

使用自訂的模擬器

-

最後說明該如何使用自訂的模擬器。

-
    -
  1. 啟動 WebIDE (工具 > 網頁開發者 > WebIDE);或可按下「Shift + F8」。
  2. -
  3. 點擊右上方的按鈕,開啟「Runtime」選單。
  4. -
  5. 點擊「Firefox OS 1.3」按鈕 (或你安裝的任何最新版本)。即使你的 B2G desktop/Gaia 版本比較新,仍建議點選 Firefox OS 1.3 版。
  6. -
  7. 接著就會啟動模擬器,將載入 B2G Desktop 並執行你的 B2G Nightly 版本與自訂 Gaia!
  8. -
-

a screenshot of the b2g desktop simulator

diff --git a/files/zh-tw/archive/b2g_os/screencast_series_colon__app_basics_for_firefox_os/index.html b/files/zh-tw/archive/b2g_os/screencast_series_colon__app_basics_for_firefox_os/index.html deleted file mode 100644 index ae38c355ea..0000000000 --- a/files/zh-tw/archive/b2g_os/screencast_series_colon__app_basics_for_firefox_os/index.html +++ /dev/null @@ -1,208 +0,0 @@ ---- -title: 系列影片:Firefox OS App 開發入門 -slug: 'Archive/B2G_OS/Screencast_series:_App_Basics_for_Firefox_OS' -translation_of: 'Archive/B2G_OS/Firefox_OS_apps/Screencast_series:_App_Basics_for_Firefox_OS' ---- -
-

Firefox OS 這款作業系統,就是要將 Web 帶入行動裝置所設計。Firefox OS 不是以新技術或新開發環境所建構的全新 OS;而是以行之有年的標準化 Web 技術所打造而成。如果你本身就是 Web 開發者且想建構行動 App,那麼 Firefox OS 就能提供最適合的工具,且不會要求你改變自己以熟悉的工作流程,也不需再重新學習另一套開發環境。此系列短片是由 Mozilla 與 Telenor 在挪威共同錄製而成,將引領你入門 Firefox OS App 的開發作業。

-
- -

你可透過本系列影片了解:

- - - -
-

注意:每部短片均極為精簡扼要,讓你短暫休息時也能欣賞。一口氣看完整個系列也不會超過一個小時。

-
- -

程式碼與開發環境

- -

除了短片之外,你也能從 GitHub 下載程式碼範例。如果你想自己測試程式碼範例,就必須先設定簡易的開發環境。必備條件如下:

- - - -

系列影片介紹

- -

此系列短片是由 Telenor Digital 的 Jan Jongboom (@janjongboom)Sergi Mansilla (@sergimansilla),以及 Mozilla 的 Chris Heilmann (@codepo8) 於 2014 年 2 月所錄製。地點位於挪威首都奧斯陸的 Telenor Digital 辦公室內。

- -

這三位接下來將為大家簡短介紹系列影片:

- -

{{EmbedYouTube("835Z2RTPdQk")}}

- -

Section 1:建構並發佈

- -

自己的第一款 Firefox OS App

- -

接下來 5 支短片將說明如何建構 Firefox OS App、如何在電腦和實體裝置上測試 App 並除錯、如何將 App 發佈至 Firefox Marketplace 中。這看起來好像很複雜,但其實只要你已經知道怎麼寫網站,就等於能完成 90% 的 App。

- -

不只是網站

- -

Firefox OS App 就是 HTML5 App;其所使用的技術本質上也與網站技術相同。你可以先寫個網站,再提供 manifest 檔案 (可參閱《App manifest》進一步了解) 即可將網站轉為 App。這個動作就等於告知 Firefox OS 你在撰寫 App,並可讓你:

- - - -

HTML5 App 其實是透過網站強化其功能,也同樣遵循相同的規則,如:

- - - -

若要將網頁轉為絕佳的 App,其中的差異就在於開發者就必須考量到行動裝置使用者。也代表 App 首先必須要能:

- - - -

在大多數的情況下,開發者必須稍微讓網頁「瘦身」並簡化介面。而使用者也確實能因此獲得更好的經驗。

- -

{{EmbedYouTube("oUbOw2cQC4k")}}

- -
-

注意:若要進一步設計出絕佳的 HTML5 App,可參閱 MDN 上的《應用程式中心》一文。

-
- -

App 的 Manifest 檔案

- -

Firefox OS App 的 manifest 檔案 (你會在「應用程式管理員 App Manager」看到中文翻譯為「安裝資訊檔」),屬於簡易的 JSON 檔案,將告知作業系統該 App 的相關訊息;另外也可將網頁轉為 Open Web App。開發者可於 manifest 定義 App 不同語系的名稱,也可要求作業系統存取不同的服務與硬體。當然亦可定義該 App 適合的方向 (直幅或橫幅),亦能依需要而鎖定畫面。

- -

{{EmbedYouTube("UTXIVg6sYtA")}}

- -

進一步了解 manifest 檔案與相關工具:

- - - -

應用程式管理員 (App Manager)

- -

要想開始入門 Firefox OS,最簡單的方法就是使用「應用程式管理員 (App Manager)」。應用程式管理員也是桌面版 Firefox 的開發者工具之一,可在電腦上模擬 Firefox OS 裝置。開發者可盡情把玩 Firefox OS,也可像在實際裝置上安裝並測試 App。此外,你也能離線或上線編輯 App,進而體驗 App 並進行除錯,在模擬裝置中即時看到修改之後的結果。

- -

{{EmbedYouTube("oyAlYjpK-PE")}}

- -

若要進一步了解應用程式管理員:

- - - -

在實體裝置上測試

- -

在模擬器上測試 App 當然不錯,但畢竟會受限於模擬的環境。如果想測試 App 互動時的效能或畫面呈現方向,就需要實體裝置。實機同樣可搭配既有的開發者工具,以及「應用程式管理員 (App Manager)」。在實機上使用 App 時,可透過上述 2 種工具進一步了解 App 所發生的作業。而且 App 不必更新,也不必解除安裝,即可即時看到 App 的變化。

- -

{{EmbedYouTube("T8sr9SHKDHE")}}

- -

發佈至 Marketplace

- -

Firefox Marketplace 可供開發者提交 App,並讓消費者能夠接觸到自己的作品。Marketplace 亦可發佈如 Firefox 桌面版與行動版所適用的 App。而消費者只需要簡單的幾個步驟,就能對 App 評分、提出反饋意見、購買自己所需的 App。要發佈自己的 App 真的很簡單:

- - - -

{{EmbedYouTube("kk3gYALtE0Q")}}

- -

App 在提交到 Marketplace 之後,均會由 Mozilla 審查團隊進行審閱,並在幾天內就會通知審查結果。如果 App 有任何問題,在提交期間就會收到相關的檢驗訊息。開發者也有可能收到詳細的問題說明,並獲得修復問題的方法。

- -

Section 2:Firefox OS 進階說明

- -

引言

- -

在前幾支影片中,我們談了 Firefox OS 的基礎概念、打造自己第一個 App 的步驟、在桌機與 Firefox OS 實體裝置上進行 App 除錯,最後把自己的 App 提交到 Marketplace 上。

- -

而接下來的影片會再進一步說明 Firefox OS App 的技術;也會談談存取功能,讓開發者能妥善利用平板電腦與智慧型手機。但這些技術目前僅適用於 Firefox OS,還未能擴及其他平台。Firefox OS 內的所有程式,都是針對標準化與開放源碼的目標所設計。也就是說,我們很快就能在其他裝置或平台上看到 Firefox OS App 的蹤跡。

- -

Web API

- -

智慧型手機具備 GPS、相機、加速規等的多樣高階功能。但問題是 Web 技術並無法碰觸到這些功能技術。如果要存取這些功能,就必須撰寫原生應用程式。為了克服這個問題,Mozilla 與合作夥伴定義了一系列 API,可讓開發者以安全的方式,透過 JavaScript 存取行動裝置所搭載的硬體。這些開放的 API 即所謂的 Web API,同樣也提供給他人建構更多功能。Firefox OS 也是第一個使用 Web API 的平台。開發者不需另外撰寫原生的應用程式,即可存取智慧型手機上所需的功能。

- -

{{EmbedYouTube("QkpH_qugrPk")}}

- -

若要進一步了解 Web API:

- - - -

Web Activities

- -

Web Activities 可視為 Web API 的替代方案,同樣可存取某些特定裝置的硬體。相較於 API 直接與裝置溝通,Web Activities 則是在裝置上建立所有 App 的生態系統,讓 App 彼此相互溝通。舉例來說,App 不會存取相機而是要求圖片,讓使用者可透過自己最愛用的 App 取得圖片。也就是說,App 不要求使用者存取硬體 (偏安全性的考量),而是讓使用者所信賴的 App 去取得圖片。此外,你也可以註冊特定 App 負責處理 OS 中的特定作業。Web Activities 其實就像對桌機裡的檔案按下滑鼠右鍵,你能在右鍵選單中看到有多種 App 可開啟檔案。而使用者可要求 OS 預設特定 App 開啟此一類型的檔案。Web Activities 可讓裝置上的 App 相互溝通,而不需再透過伺服器作為媒介。App 之間傳送的資料均已為最終資料。

- -

{{EmbedYouTube("RQbCyDd9ejE")}}

- -

進一步了解 Web Actitivies:

- - - -

推播通知

- -

使用 SimplePush WebAPI 的推播通知 (Push notification) 功能,可在裝置接收到特定訊息時喚醒 App。如此可在省電狀態下讓 App 保持待機,再隨時根據需求喚醒 App;此功能對行動裝置 App 格外重要。用這種方式所傳送的通知也有其優點:這種通知不會攜帶任何資料,Mozilla 不會取得 App 的資訊,而惡意攻擊者也無法監聽。

- -

{{EmbedYouTube("F5UF4dKojzw")}}

- -

若要進一步了解 SimplePush 所推播的通知:

- - - -

離線功能

- -

如果 App 無法離線作業,那可用性就會大大降低。有部分使用者也因為這個理由,比較喜歡安裝 App 之後只要開啟瀏覽器,就能在裝置的瀏覽器上查看所需的內容。其實「Web App」這個詞看起來會有「需要網路連線才能運作」的感覺。但使用者總是有無法上網的時候:飛機上必須關機、地底下收不到訊號,甚或手機內沒留任何資料。開發者應該要確保自己的 App 能離線運作。而 HTML5 即具備幾項離線作業的技術,主要就是 AppCacheDOMStorage

- -

{{EmbedYouTube("Q_WmkCzEKho")}}

- -

進一步了解離線功能:

- - - -

深入了解

- -

我們希望這一系列的影片,能夠順利帶領開發者建構出自己的第一款 Open Web App。如果你很感興趣也想了解更多細節,也有許多其他資源與管道可供你利用:

- -

{{EmbedYouTube("UVf2EVrLpl8")}}

- - - -

歡迎大家多多交流

- -

影片錄製人:Chris、Sergi、Jan

diff --git a/files/zh-tw/archive/b2g_os/security/application_security/index.html b/files/zh-tw/archive/b2g_os/security/application_security/index.html deleted file mode 100644 index 3e8f8d576e..0000000000 --- a/files/zh-tw/archive/b2g_os/security/application_security/index.html +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: 應用程式安全 -slug: Archive/B2G_OS/Security/Application_security -translation_of: Archive/B2G_OS/Security/Application_security ---- -
-

本文涵蓋 Firefox OS 應用程式安全模型細節內容。

-
-

Firefox OS Web app 核心安全控制如下:

- -

App 類別

-

Firefox OS 支援: "web", "privileged" 和 internal ("certified") 三種類別的 Web app,app 的類別宣告在 manifest 裡 (另外使用權限也在裡面) 。

- -
-

Note: 關於 App 類別,詳細說明請見 App Manifest

-
-

App 下載

-

Firefox OS 共有兩種 App 下載機制:hosted 以及 packaged。一般 web app 兩種方式都能適用,但 privileged 和 certified apps 只能走 packaged 的方式。

-

Hosted(託管式) apps

-

Hosted app 只包含開發者網站伺服器上的 application manifest 檔案,Manifest 檔案裏面有 app 開啟時的啟動頁面路徑。從安全性角度來看 hosted app 和網頁差不多,當打開 hosted app ,載入頁面的 URL 就是網頁在伺服器上的一般 URL,如果之前有 appcache 存檔的話則會從裝置上載入。

-

Packaged(封裝式) apps

-

Packaged app 將所有的資源 (HTML, CSS, JavaScript, app manifest 等等) 包在一份 zip 檔中,而非網頁伺服器,細節請見 Packaged apps

-

App 來源

-

對於 hosted app,application manifest 檔案所在地就是其來源。

-

至於 packaged apps,其來源就是安裝當下決定的應用程式識別,而 Privileged 和 Internal apps 另外可以在 applications manifest 檔案裡用 origin 參數請求使用特定來源。

-

App 安裝

-

App 透過 Apps JavaScript API 安裝:

- -

App manifest 和 App 來源必須一致,這樣避免了未知的第三方冒用 App;另外為了避免網站被不小心或故意被偽裝成有 app manifest,manifest 檔必須以特定 mime-type,application/x-web-app-manifest+json, 發送。

-

更新

-

更新程序請見更新 apps

-

權限

-

App 能夠被授予比一般網頁更多的權限。基本上 app 擁有和網頁同等的權限,如果 app 需要更多額外權限,那麼 app 便需要在 manifest 檔裡明白列出需要的額外權限。

-

Manifest 宣告

-

在 manifest 裡,每一個需要的額外權限必須加入供人閱讀的描述說明為何需要此額外權限,例如 app 想要 navigator.geolocation API 使用權限,manifest 裡就必須如此宣告:

-
"permissions": {
-  "geolocation":{
-    "description": "Required for autocompletion in the share screen",
-  }
-},
-
-

這樣 app 便可以如同網頁一般提示使用者來請求地理位置存取權限。更多細節請見 App manifest

-
-

Note: 目前權限使用目的並不會呈現給使用者看 — 見 bug 823385.

-
-

權限授予

-

當權限需求在 manifest 中宣告後,依據權限不同,可能會直接被同意,但也可能需要在第一次相關 API 被存取時提示使用者徵詢其同意。一般來說會影響到使用者隱私的權限會需要額外徵詢使用者同意,而且這種情況下使用者也有理由知道甚麼權限被請求使用,例如存取通訊錄前會需要徵詢,但存取 TCP 連線則不需要。權限直接同意會經過 Marketplace 安全審核程序以確保安全性。

-

權限駁回

-

使用者可以在任何時候從設定駁回先前授予的權限,但這不包括那些直接同意的權限。

-

Web App Sandbox

-

App 資料獨立

-

每一個 app 都運行在 sandbox 之中,所以所有資料都和其他 app 隔離開來,這涵蓋了 cookie、localStorage、indexedDB 以及網站權限。

-

A diagram showing three Firefox OS apps all open is separate sandboxes, so none of them can affect each other.

-

所以說即使 App A 和 App B 都開啟了指向同一來源 (如 http://www.mozilla.org) 的 {{ htmlelement("iframe") }},但他們兩者的 cookie 資料還是會不同。結果就是當用  App A 登入 Facebook 帳號,開啟了 App B 前往 Facebook 時,因為 App B 無法存取 App A 的 cookie,所以 App B 還是必須要再執行登入作業,如此一來變確保了 App 之間不互相影響、資料安全。

-

Apps 無法啟動彼此

-

App 不能利用 <iframe> 開啟另一個 App,如果 App A 開啟了一個指向 App B URL 的 iframe,這並不會啟動 App B,相反地這只會前往那個 URL 指向的網頁,任何 App B 的 cookie 都無法被存取,這就和 App B 沒有被安裝的情況一樣。

-

就算是 App A 嘗試開啟透過 packaged 式 App B 的 app:// URL,來將 App B 載入到 <iframe> 裡啟動,也會失敗,而且不論 App B 有沒有被安裝,失敗訊息都會一樣,所以說 App A 也無法推敲 App B 的安裝狀態。

-

當 App A 上層的 frame 前往 App B 所在的 URL,結果依然相同。我們永遠知道是哪個 frame 開啟哪個 app,所以說透過上層 frame 開啟其他 app 就和前述一樣會失敗,App 之間資料絕對獨立、無法被盜取。

-

動機

-

資料獨立的做法有好有壞,壞處是使用者必須每開一個 app 都要登錄一次同一個網站,或者是網站有存放一些資料於本地端,每個 app 都會儲存一份資料,同樣的資料可能被重複儲存,如果資料剛好又不小的話,將會相當佔儲存空間。

-

好處是這是比較安全的做法,app 之間不能透過第三方網站互相影響進而導致未預期的行為,或是一個 App A 移除後,另一個 App B 不會因為依賴 App B 的資料或功能而無法運作。更重要的是,資料獨立確保了惡意 app 難以利用漏洞竊取其他網站的資料。

-

最後資料獨立也確保了 app 無法得知使用者是否有裝甚麼其他 app、其他 app 的資料,保護了使用者隱私。

-

權限 Sandbox

-

如同資料在 snadbox 下是獨立隔離開來的,權限亦然。App A 打開了 http://maps.google.com 網頁,而使用者也准許永遠允許 http://maps.google.com 使用地理位置服務,但這也只限於 App A,改天換 App B 打開 http://maps.google.com 網頁,地理位置服務使用權限還是得再徵詢使用者同意。

-

如同一般網頁,每個來源的權限同樣獨立,App A 取得地理位置服務使用權限,但這不代表所有 App A 開啟的網頁都有權使用地理位置服務,如果說 App A 開啟 http://maps.google.comhttp://maps.google.com 照樣需要取得使用者同意才能使用地理位置服務。

-

瀏覽器 API Sandbox

-

對於會開啟大量 URL 的應用程式,如瀏覽器,我們引進了一個 browserContent 旗標來強化安全性,這個 browserContent 讓 app 可以有兩個 sandbox,一個供 app 本身使用,另一個給開啟的網頁使用,例如說:

-

有一個 MyBrowser app 自 https://mybrowser.com 載入,所以程式碼和資源都隸屬於這個網域。

-

當這個 app 建立一個 <iframe mozbrowser>,另一個 sandbox 便會產生,所以說 <iframe mozbrowser> 裡的 cookie、IndexedDB、localStorage 資料都會獨立隔離開來,兩者間不會互相影響。

-

從另一方面來看,如果 MyBrowser app 想要整合 Google Map 的地理位置功能,那麼從一般 <iframe> 裡載入 http://maps.google.com,便可以存取 Google Map 網站的 cookie 資料;但若是從 <iframe mozbrowser> 裡載入的話,便無法取得 Google Map 的 cookie 資料了。

-

假設另一個情況,有一個類似 Yelp、會造訪餐廳網站的 app,這個 app 只要利用 <iframe mozbrowser> 來打開餐廳網站,就可以確保餐廳網站不能含有指回這個 app 的 <iframe> (例如指回 http://yelp.com),如果有的話,該餐廳網站將只能收到 Yelp 網站的資料,而非此 Yelp app,所以該餐廳網站便無法和 Yelp app 共享資料和權限,進而攻擊 Yelp app。

-

App 安全性總結

-

下表總結各類 Firefox OS App 的格式、安裝、更新特性:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Web App 類型
類型發布權限安裝更新
WebHosted 或 Packaged較不敏感的權限,既使未驗證的網站取得也沒關係。可以從各種來源安裝依據安裝來源和發布機制可以背景更新或透過 marketplace 更新。
PrivilegedPackaged 和 Signed需要驗證和審核才可以取得特殊權限 API。從可信任的 marketplace 安裝從可信任的 marketplace 更新,需要使用者同意更新。
InternalPackaged第三方 app 無法存取高度敏感 API裝置預裝跟隨系統層級類別更新。
-
-

Note: 版本 1.0 的 Firefox OS,privileged app 只能從 Mozilla Marketplace 安裝,至於其他多種安全 marketplace 的支援尚未底定。

-
-

 

diff --git a/files/zh-tw/archive/b2g_os/security/index.html b/files/zh-tw/archive/b2g_os/security/index.html deleted file mode 100644 index 468bab0472..0000000000 --- a/files/zh-tw/archive/b2g_os/security/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: Firefox OS security -slug: Archive/B2G_OS/Security -tags: - - B2G - - Firefox OS - - Mobile - - NeedsTranslation - - Security - - TopicStub -translation_of: Archive/B2G_OS/Security ---- -

The following articles cover security-related topics about Firefox OS. This includes overall security features as well as application security and how the install process is kept secure.

- - - - - - - -
-

Firefox OS security documentation

-
-
- The Firefox OS security model
-
- An overview of the Firefox OS security model.
-
- System security
-
- Details of security controls built-in to the FirefoxOS runtime.
-
- Application security in Firefox OS
-
- An overview of how applications are made secure on Firefox OS.
-
- Securely installing and updating applications
-
- How Firefox OS securely installs and updates applications.
-
- Software permissions in Firefox OS
-
- A guide to what types of software have permission to perform various tasks on Firefox OS.
-
-  Debugging and security testing with Firefox OS
-
- This guide shows you the basic security testing steps, from opening a remote JavaScript debugger to setting up an intercepting HTTP(S) proxy against a desktop version of Firefox OS
-
-

View All...

-
-

Getting help from the community

-

If you're working with Firefox OS, or developing applications you'd like to run on Firefox OS devices, there are community resources to help you!

-
    -
  • Consult the Boot to Gecko project forum: {{ DiscussionList("dev-b2g", "mozilla.dev.b2g") }}
  • -
-
    -
  • Ask your question on Mozilla's Boot to Gecko IRC channel: #b2g
  • -
-

Don't forget about the netiquette...

-
- - -
-

 

-
-
- Firefox OS
diff --git a/files/zh-tw/archive/b2g_os/security/security_model/index.html b/files/zh-tw/archive/b2g_os/security/security_model/index.html deleted file mode 100644 index d71380833f..0000000000 --- a/files/zh-tw/archive/b2g_os/security/security_model/index.html +++ /dev/null @@ -1,299 +0,0 @@ ---- -title: Firefox OS 安全性概述 -slug: Archive/B2G_OS/Security/Security_model -translation_of: Archive/B2G_OS/Security/Security_model ---- -

此篇文章將概述 Firefox OS 的安全架構,可阻絕 App、平台、資料所挾帶的惡意威脅,進而保護行動裝置。Mozilla 建構了完整且多層次的安全模式,為行動電話提供絕佳的防護效果。

-

 

-

平台安全性

-

Firefox OS 平台具備多層次安全模式,可將各層次的開發風險降至最低。第一線的保護機制更整合了深度防禦 (Defense-in-depth) 策略,進而達到完整的防護機制。

-

 

-

安全架構

-

Firefox OS 將銜接網路架構的應用與其底層硬體,而其整合式技術囊括了下列層級:

-

-

行動裝置 (Mobile device) 即是執行 Firefox OS 的智慧型手機。Gonk 則包含 Linux kernel、韌體、系統函式庫、裝置驅動程式。Gecko 屬於應用程式的執行時間層,為 App提供執行框架,另建構 Web API 以存取行動裝置的功能。Gaia 則是網頁 App (包含 HTML5、CSS、JavaScript、圖片、媒體等) 套件,可隨時改善使用者經驗。

-

Gecko 扮演守門人的角色,可強制執行安全策略,避免行動裝置遭到誤用;並可作為網頁 App (位於 Gaia) 之間的中介層 (Intermediary)。Gonk 則可將行動電話底層的硬體功能,直接提供予 Gecko 使用。只有在 Gecko 放行存取請求時,網頁 App 才能透過 Web API 而存取行動電話的功能;而不會有直接存取或「走後門」的情況發生。Gecko 將強制執行許可,並阻擋未經授權的請求。

-

 

-

佈署安全系統

-

手機上的 Firefox OS 系統映像檔 (System image) 是由受信任的來源 (一般為該裝置的 OEM 廠商) 所提供,這些受信任的系統映像檔提供者負責發布檔案的組建、建置、測試以及數位簽章作業。

-

整個技術層均需經過安全驗證。由Linux 的存取控制清單 (ACL) 執行檔案系統的權限控制。系統 App 則安裝於唯讀 (僅於更新期間才暫時轉為可讀寫) 媒體之中;若是使用者相關內容的區域,則可能為讀寫性質。裝置硬體中的不同元件,均已內建了業界標準的防護機制。舉例來說,晶片製造商會加入安全防護技巧來提高安全性,我們同樣強化了核心平台 (Gecko 與 Gonk),以阻絕潛在的可能威脅,亦提升了相關編譯器的功能。可參閱執行期間的安全性進一步了解細節。

-

 

-

更新安全系統

-

Firefox OS 平台的後續升級與修正,將透過安全的 Mozilla 程序完成佈署,並確保行動電話上的系統映像保有其完整性。同樣由已知且受信任的來源 (一般為該裝置的 OEM 廠商) 提供更新作業,並負責更新封裝的組裝、建構、測試、數位簽章等作業。

-

系統更新可能牽涉 Firefox OS 部分或所有的層級。若更新作業必須變更 Gonk,則安裝作業將使用 FOTA (Firmware Over the Air)。FOTA 更新作業亦可能包含 Firefox OS 的其他層級,如 Gaia、Gecko、安全更新、裝置管理 (FOTA/韌體/驅動程式)、設定管理 (Firefox OS 的設定),還有更多修正檔。

-

若更新作業並未牽涉 Gonk,則僅需 Mozilla 系統更新公用程式 (System Update Utility) 即可完成。Firefox OS 所使用之更新架構、程序、Mozilla ARchive (MAR) 格式 (用於更新封裝),與 Firefox 桌面版產品完全相同。可參閱 https://wiki.mozilla.org/Software_Update 以進一步了解。

-

而行動電話所內建的更新服務 (亦可能由 OEM 廠商提供),將定期檢查是否有系統更新。一旦發佈系統封裝,更新服務隨即將偵測到該封裝,並提醒使用者完成安裝作業。在行動裝置安裝更新檔案之前,另將檢查裝置的儲存容量是否足夠,且將驗證下列分配空間:

- -

更新期間應注意下列要點:

- -

請確實完成相關檢查,讓行動電話確實完成更新作業。

-

 

-

App 的安全性

-

Firefox OS 使用深度防禦 (Defense-in-depth) 策略,可保護行動電話免受惡意應用程式的攻擊。此策略必須佈署多種機制,如根據 App 信任模式 (Trust model) 所建構的隱式許可 (Implicit permission) 層級;執行期間的沙箱執行作業 (Sandboxed execution);僅限 API 存取行動電話的底層硬體;健全的許可模型 (Permission model);安全的安裝與更新程序。若要進一步了解相關技術,可參閱應用程式安全性

-

在 Firefox OS 中的所有應用程式,均為 Web App ─ 即以 HTML5、JavaScript、CSS、媒體、其他開放式 Web 技術 (可於瀏覽器中執行的網頁,並不屬於本文所提的 Web App) 所撰寫的程式。由於這些 Web App 並非二進制 ─ 即所謂的「原生 (Native)」─ 應用,因此將由 Web API居中嚴格協調所有的系統存取作業。甚至檔案系統存取都只能透過 Web API 與後端的 SQLite 資料庫, App 不能直接存取 SD 記憶卡上的檔案。

-

Firefox OS 可限制 App 所能存取/使用的資源規模,同時又可針對多樣的 App 而支援不同的許可層級。Mozilla 嚴格控制各類 App 所能存取的 API。舉例來說,僅有 Certified App (隨手機出貨) 可存取 Telephony API。另外,Dialer App 必須存取 Telephony API 才能撥打電話,而非所有 Certified App 均可存取此 API。如此可避免安裝了任何第三方 App 之後,撥打出國際/長途電話而讓帳單金額暴增。但針對其他 OEM App,仍可選擇是否給予 Telephony API 存取權。舉例來說,電信服務商可提供系統管理應用程式,讓客戶能管理自己的帳戶,甚至能直接以電話送出電信服務帳單或支援辦公室作業。

-

 

-

受信任 (Trusted) 與未信任 (Untrusted) 的 App

-

Firefox OS 將 App 分為下列類型:

- - - - - - - - - - - - - - - - - - - - - - - - - -
-

類型

-
-

受信任層級

-
-

說明

-
-

Certified

-
-

受高度信任

-
-

這類系統 App 經過電信服務商或 OEM (起因於裝置毀損或重要功能所產生的風險) 所核可。但僅限系統 App 與相關服務,並無第三方 App。
- 此信任層級僅用於極少部分的重要 App,例如 SMS、藍牙、相機、電話、系統時鐘、預設的電話播號鍵盤 (為了可確實用於緊急電話)。

-
-

Privileged

-
-

受信任

-
-

由授權的商城審視、核可、數位簽章過的第三方 App。

-
-

Web (與其他 App)

-
-

未受信任

-
-

屬於一般網頁內容。包含安裝式 App (儲存於行動電話中) 與托管式 (Hosted,儲存於遠端,僅有 manifest 檔案儲存於行動裝置中) App。另外也可以從 Marketplace 取得托管式 App 的  manifest 檔案。

-
-

App 的受信任層級,某種程度上將決定其所能取用的行動電話功能。

- -

某些作業 (如網路存取) 均先假設為所有 App 的隱式許可。一般來說,越是高敏感性的作業 (如撥打電話號碼或取得通訊錄內容),就僅有更高信任度的 App 才能執行。

-

最小權限原則 (Principle of Least Permissions)

-

針對 Web App,Firefox OS 安全架構則以《最小權限原則 (principle of least permissions)》為架構:先給予最低權限,僅在必要或合理的情況下,才選擇性的提高權限。依預設值,任一 App 均具備最低權限,以因應未受信任的網頁內容。如果 App 所呼叫的 Web API 需要額外權限,則其 manifest 檔案 (本文稍後將敘述) 必須先列舉這些額外權限。而僅在 App 的 manifest 檔案明確要求 App 授權時,Gecko 才會給予 Web API 的存取權。此外,只有在 Web App 的類型 (即上述的 Certified 或 Trusted 或 Web 分類) 符合其存取層級,Gecko 才會給予必要的授權。

-

Marketplace 對 Privileged App 的審核程序

-

若要達到 Privileged App,則 App 開發/供應商必須將之提交予經過授權的 Marketplace。而 Marketplace 隨即開始嚴格的程式碼審核程序:檢視其完整性與穩定性、審查其索取的授權是否符合其載明的用途、確認其隱式許可是否使用合宜、審核「Privileged App 的內容」與「未授權的外部內容」之間的介面,是否具備合適的緩衝,以避免權限提升 (Elevation of privilege) 的影響。Marketplace 另需負責確保 Web App 不會對其給予的權限進行惡意動作。

-

在 App 通過審核之後即許可使用,且 Marketplace 亦將以數位方式簽署其 manifest 檔案,以供行動裝置的使用者下載之。一旦 Marketplace 遭駭,數位簽章可確保駭客無法將任意內容或惡意程式碼,安裝於使用者的行動電話上。也基於此審查程序,Firefox OS 從 Marketplace 取得的 Privileged App,其可信任度亦高於一般的 (未受信任的) 網頁內容。

-

 

-

封裝式 (Packaged) 與托管式 (Hosted) App

-

Firefox OS 可用封裝式 (儲存於行動電話中) 或托管式 (儲存於遠端伺服器中,僅有 manifest 檔案儲存於行動電話中) App。而此 2 種 App 的安全管理方式亦有所不同。封裝式與托管式 App 同可作為應用程式的封閉沙箱,本文稍後將說明。

-

封裝式 (Packaged) App

-

封裝式 App 是以 ZIP 壓縮檔所構成,內含應用程式的相關資源 (HTML5、CSS、JavaScript、影像、媒體),另以 manifest 檔案提供上述資源的清單,與其對應的 雜湊值 (Hash)。由於 Certified 與 Privileged App 的 manifest 檔案均需完成數位簽章,因此Certified/Privileged App 必為封裝式 App。只要使用者取得封裝式 App,就會將 ZIP 檔案下載至行動電話中,另從 ZIP 檔案內的已知位置讀取 manifest 檔案。系統將在安裝過程中驗證 App 的資源,其他則儲存於本端的封裝內。執行期間將請求所有的顯式許可 (Explicit permission)、顯示使用者 App 的資料儲存目標,最後依預設值完成保存。

-

若要清楚指明封裝式 App 中的資源,則 URL 應以 App 開頭並使用下列格式:

-
-

app://identifier/path_within_zipfile/file.html

-
-

這裡的「app://」代表 ZIP 檔案的掛載點 (Mount point)。於行動電話上安裝 App 時,隨即產生「identifier」作為 UUID。如此可確保以 :app 的 URL 指向了特定資源,且已納入於 ZIP 檔案中。而 app: 中的路徑為相對路徑,因此可於 ZIP 檔案中允許資源的相對鏈結。

-

封裝式 App 主要用於 Certified 與 Privileged App,不過一般的 Web App 亦可作為封裝式。但這些 Web App 不會因為封裝格式,就自動提高其信任度或存取權限。

-

托管式 (Hosted) App

-

托管式 App 均儲存於網頁伺服器上,或需透過 HTTP 載入。僅有其 manifest 檔案儲存於行動電話中;其他所有檔案均儲存於遠端。僅 Privileged 與 Certified App 才能使用特定 API,以因應數位簽章作業而必須將 App 封裝。因此,即使 Web API 作業需要 Privileged/Certified App 的狀態,托管式 App 亦不需存取任何 Web API 作業。

-

從安全性的觀點來說,托管式 App 的作業方式比較像一般網頁。在該網頁伺服器上,必須以寫死 (Hard-coded) 的完整 URL 指向 App 根目錄中的起始頁面,才能載入托管式 App。一旦載入托管式 App 之後,行動電話將根據網頁瀏覽時的 URL,跟著連至相同頁面。

-

 

-

App 的 Manifest 檔案

-

Open Web App 的 manifest 檔案,將提供瀏覽器與 App 互動時的必要資訊。而 manifest 即為 JSON 檔案,至少均具備 App 的名稱與描述。可參閱 App 的 manifest 檔案常見問題以進一步了解。

-

Manifest 範例

-

下列程式碼則具備基礎設定的 manifest 範例:

- - - - - - - -
-

1

-

2

-

3

-

4

-

5

-

6

-

7

-

8

-

9

-

10

-

11

-

12

-

13

-
-

{

-

  "name": "My App",

-

  "description": "My elevator pitch goes here",

-

  "launch_path": "/",

-

  "icons": {

-

    "128": "/img/icon-128.png"

-

  },

-

  "developer": {

-

    "name": "Your name or organization",

-

    "url": "http://your-homepage-here.org"

-

  },

-

  "default_locale": "en"

-

}

-
-

Manifest 檔案的安全性設定

-

manifest 檔案亦可具備其他設定,如下列的安全性設定:

- - - - - - - - - - - - - - - - - - - - - - - - - -
-

欄位

-
-

說明

-
-

permissions

-
-

App 的必要許可。任何 App 需列出所要使用的 Web API,以取得使用者的許可。Privileged/Certified App 可識別大多數的許可,但托管式 App 不適用。API 必具備的屬性:

-
    -
  • description ─ 在請求使用此 API 時,此字串將指定其背後的目的地。必填。
  • -
  • access ─ 此字串將指定許可所需的存取類型。安裝時即給予隱式許可 (Implicit permission)。僅數種 API  為必填欄位。僅接受:readreadwritereadcreatecreateonly 等數值。
  • -
-
-

installs_allowed_from

-
-

App 的來源。而構成來源的陣列 (scheme+unique hostname) 則可觸發此 App 的安裝作業。另可讓 App 廠商限制僅授權過的 Marketplace (如 https://marketplace.firefox.com/) 才可安裝 App。

-
-

csp

-
-

內容安全政策 (Content Security Policy),將套用至 App 所載入的所有頁面。可強化 App 而避免遭惡意插入任何程式碼。若未指定 CSP,則 Privileged 與 Certified App 均已預設了系統定義值,其語法為:
- https://developer.mozilla.org/en-US/docs/Apps/Manifest#csp

-

另請注意,此指令僅能增加所套用的 CSP。舉例來說,此指令並無法減少 Privileged App 所套用的 CSP。

-
-

type

-
-

App 的類型,即 Web、Privileged、Certified 等類型。

-
-

Firefox OS 要求 manifest 檔案必須為特定的 mime-type 格式 ("application/x-web-app-manifest+json"),而且必須與該 App 為相同來源的完整主機名稱 (即來源)。若「App 的 manifest 檔案」與「要求安裝 App 的頁面」兩者的來源相同,則將放寬此限制。此機制可確保不能偽裝網站並托管 App 的 manifest 檔案。

-

 

-

隔離式 (Sandboxed) 執行作業

-

本章節將說明 App 與執行作業的沙箱隔離區 (Sandbox)。

-

App 隔離區

-

Firefox OS 的安全架構,即是將隔離區作為深度防禦 (Defense-in-depth,DID) 策略,以減少風險並保護資料、平台、行動電話。在執行期間,隔離區可為 App 產生邊界與限制。各個 App 僅於自己的工作空間 (Working space) 內執行,另僅經過授權可存取的 Web API 與資料,才能存取;工作空間相關的資訊 (IndexedDB 資料庫、Cookies、離線儲存等) 亦然。請參閱 https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Security/Security_model 以進一步了解。

-

下圖則簡略說明了安全模型:

-

-

在隔離各個 App 之後,所產生的影響亦僅限於其工作空間之內,而不會受到工作空間之外的干擾 (如其他 App 或資料)。

-

執行作業隔離區

-

B2G (Gecko) 在一個高授權度的系統程序 (可存取行動電話中的硬體功能) 中執行。在執行期間,各個執行環境裡的 App 皆是 B2G 系統程序的子程序。而各個子程序又具備嚴格的 OS 授權。舉例來說,子程序並無法直接讀寫檔案系統中的任意檔案。必須由 Web API 提供相關存取權限;且該權限又由 B2G 母程序所居中協調。在子程序要求授權過的 API 時,母程序將確認子程序具備必要的許可,以執行相關動作。

-

App 僅能透過 B2G 核心程序 (非其他程序或 App) 而相互溝通。App 無法於 B2G 之外獨立執行;各 App 亦無法互相開放。App 之間僅能間接「溝通」─ 例如接收器 (Listener) 程序偵測到其他程序所產生的事件,且必須由 B2G 程序居中協調。

-

僅透過 Web API 才能存取硬體

-

Web App 若要存取行動電話的功能,唯一管道只有以 Gecko 所建構的 Firefox OS Web API 。Gecko 是行動裝置與底層服務的單一出口,因此必須讓 Web API 進行呼叫作業,才能存取裝置的硬體功能。絕對沒有「原生 (Native)」的 API 或其他途徑可繞過此機制,而直接存取硬體或滲透至初階的軟體層。

-

 

-

安全架構

-

下圖則為安全架構的元件:

-

- -

 

-

許可的管理與強化

-

針對 Web App 所需的許可 (Permission),Firefox OS 安全機制將進一步驗證並強化。
- 僅當內容 (Content) 請求特殊許可,或當內容具備 manifest 所要求的適當許可時,系統才會發出特定許可至 App。若需要使用者進一步的授權,則某些許可亦將提出請求 (例如 App 要存取使用者目前的位置)。與傳統「角色為中心 (Role-centric)」的方式 (各個獨立角色將獲得一系列的許可)相較,這種「應用為中心 (app-centric)」的架構更能嚴密控管許可。

-

現有的 Web API 集合了一系列動作 (Action) 與接收器 (Listener)。各個 Web API 則具備必須的許可層級。每次只要呼叫 Web API,則 Gecko 檢查許可 (角色查找) 的基準為:

- -

若該請求並不符合許可的準則,則 Gecko 隨即拒絕該請求。舉例來說,只要是受信任 App 所保留的 Web API,未受信任的 App 均無法執行。

-

 

-

要求使用者給予許可

-

除了與 Web App 隱性關連 (Implicitly associated) 的許可之外,在執行特定作業之前需要使用者給予顯式許可。針對這些作業,Web App 必須在 manifest 檔案中表示索取許可的理由 (Justification)。這種「資料使用意圖 (Data usage intention)」,可讓使用者在給予許可之後,知道 Web App 處理資料的方式,亦將了解可能的風險,進而能做出決定並控管自己的資料。

-

 

-

安全的 App 更新程序

-

-

針對 Privileged app 的升級與修正,開發/供應商必須將更新封裝提交至授權過的 Marketplace,以供 Marketplace 進一步審查。而在核准之後,隨即完成數位簽章並提供予使用者。在搭載 Firefox OS 的裝置上,亦可透過 App 更新公用程式 (暫譯 App Update Utility) 定期檢查 App 是否有可用的更新。若發現可用的更新,系統隨即會詢問使用者是否安裝。在行動裝置安裝更新檔案之前,必將驗證封裝的:

- -

透過適當且嚴格的檢查,可確保行動電話已正確套用了更新。
- 在開始更新程序之前,必須先下載完整的更新封裝至特定且安全的位置。安裝作業並不會覆寫任何使用者資料。

-

 

-

裝置安全性 (硬體)

-

行動裝置硬體的安全機制,一般均由 OEM 廠商所決定。舉例來說,OEM 廠商可能提供 SIM (Subscriber Identity Module) 卡的鎖定機制,另搭配 PUK (PIN Unlock Key) 密碼,以用於輸入錯誤 PIN 而遭鎖定的 SIM 卡。這部份需聯絡 OEM 廠商以了解細節。Firefox OS 則可讓使用者設定密碼與待機畫面,將於稍後說明。

-

 

-

資料安全性

-

使用者可將個人資料儲存於手機中,並可設定其隱私性,包含聯絡資訊、金融資訊 (銀行與信用卡細節)、密碼、行事曆等。Firefox OS 則針對惡意 App (竊取、挖掘、破壞私密資料) 而設計了防護機制。

-

 

-

密碼與待機畫面

-

Firefox OS 可供使用者設定行動電話的密碼,往後必須輸入正確密碼才能使用該行動電話。Firefox OS 另提供待機畫面的功能。只要設定特定時間內未使用行動電話,隨即顯示待機畫面。此時必須輸入密碼授權才能繼續使用手機。

-

 

-

隔離式 (Sandboxed) 資料

-

如之前所述,執行期間的 App 均進入隔離狀態。如此可避免 App 相互存取其內的資料;除非該筆資料已設為共享資料,且其他 App 擁有夠高的許可層級可存取之。

-

 

-

序列化 (Serialized) 資料

-

Web App 並無法直接讀寫檔案系統。相反的,僅能透過 Web API 而存取儲存媒體。Web API 另將透過 SQLite 資料庫居中協調,才能進一步讀取、寫入儲存媒體。不會直接以 I/O 進行存取作業。各個 App 均擁有自己的資料儲存媒體,將經過資料庫而序列化至磁碟中。

-

 

-

資料銷毀

-

一旦使用者取消安裝 App,則將刪除該 App 所有的相關資料,如 cookies、localStorage、Indexeddb 等。

-

 

-

隱私性

-

根據隱私權原則 (https://www.mozilla.org/privacy/),Mozilla 致力保護使用者隱私與資料,同時可參閱 Mozilla Manifesto (https://www.mozilla.org/about/manifesto.html)。而 Mozilla 的 Firefox Privacy Policy 則說明 Mozilla 將如何蒐集、利用 Mozilla Firefox 瀏覽器的使用者資訊,包含 Firefox 所傳送至網頁的資料、Mozilla 的資料保護方式、Mozilla 資料實務情況等。若要進一步了解相關細節,可參閱:

- -

在擬定 Firefox OS 的原則時,均將使用者資料的控制權交付給使用者本身。而使用者必須自己決定個人資訊的運用方法。Firefox OS 將提供下列功能:

- diff --git a/files/zh-tw/archive/b2g_os/security/system_security/index.html b/files/zh-tw/archive/b2g_os/security/system_security/index.html deleted file mode 100644 index edb0e64697..0000000000 --- a/files/zh-tw/archive/b2g_os/security/system_security/index.html +++ /dev/null @@ -1,376 +0,0 @@ ---- -title: 系統安全 -slug: Archive/B2G_OS/Security/System_security -translation_of: Archive/B2G_OS/Security/System_security ---- -
-

本文旨在提供 Firefox OS 系統安全模型概觀,說明系統是如何保持安全性與實施權限管理。

-
-

名詞解釋

-

在開始之前,有幾個名詞需要了解一下。

-
-
- 網頁應用程式 (Web application)
-
- 網頁應用程式 (web application, web app, open web app, moz app, application) 是運行在 Firefox OS (或其他支援平台)、用 HTML, JavaScript, 以及其他開源網頁技術所寫成的應用程式。所有 B2G 上使用者使用的應用程式都是網頁應用程式,例如撥號程式是一個 web app,但顯示在瀏覽中的網頁並不屬於網頁應用程式的範疇。
-
- b2g 程序 (b2g process)
-
- Firefox OS b2g process 通常會被叫做 "b2g" 或 "Gecko"。b2g 實際上是一個高權限 (root 權限) 應用程式,控制了所有 web app 對資源和硬體的存取。
-
- 內容程序 (Content process)
-
- b2g 產生的子程序,會和 b2g 溝通,代表了 web app。它擁有的權限較低 (一般使用者權限;受限的作業系統資源存取),透過 inter-process communication (IPC) 和 OS 核心溝通。
-
- IPDL
-
- Intercommunication Protocol Definition Language, 請參照 IPDL.
-
- AOSP
-
- Android Open Source Project.
-
- System call
-
- 一個介於使用者空間 (user space) 和核心 (kernel) 的溝通介面,使用者空間只能透過這個介面和核心溝通。
-
- DAC, MAC
-
- 使用者可設定的自主存取控制 (Discretionary Access Control) 和 系統強制的強制存取控制 (Mandatory Access Control)。
-
- FOTA
-
- 自動韌體更新機制 (Firmware Over The Air),透過無線網路"空中"更新韌體。
-
- MSU (Mozilla System Updater), MAR (Mozilla ARchive)
-
- 和 Firefox 桌面產品一樣的更新機制和檔案格式。
-
-

Firefox 作業系統安全模型目標與範疇

-

Firefox OS 安全模型的設計目標:

- -

下面將說明每一個目標以及 Firefox OS 如何達成個目標。

-

權限強制

-

應用程式安全模型描述了使用者如何直接或透過受信任第三方來授予應用程式權限,這些強制加諸於內容程序 (content process) 的權限是透過限制資源存取必須經過和核心程序 (core process) 之間的 IPC call。

- -

內容程序初始化

-

所有的 web app 都運行在低權限、分開的內容程序。當 web app 載入到一個特別的 {{HTMLElement("iframe")}} 型態: <iframe mozapp> 時 b2g 程序會啟動內容程序,這樣會將 web app 和其他內容隔離開來,而且和 web app 的 manifest 高度相關 (請參照 應用程式安全模型),內容程序會在一個稱為 "out of process" (OOP) 的容器裡啟動,這個 OOP 即是 plugin-container 程序,並且和桌面 Firefox 所用的 plugin-container 程序有著相似的原始碼。

-

風險

- -

實作

-

在 b2g 程序裡啟動

-

順序如下:

-
    -
  1. fork()
  2. -
  3. setuid(new, different, unused user id|nobody) (無特權的使用者)
  4. -
  5. chrdir('/')
  6. -
  7. execve('plugin-container')
  8. -
-

這邊的啟動順序確保 OOP 程序運行在隔離的記憶體空間,同時只是低權限使用者,無法提高到 b2g 的高權限。

-

File descriptor (檔案描述子) 管理

-

File descriptors 的管理方法是白名單;一份受允許的 file descriptors (FDs) 清單儲存在 mFileMap 物件,在呼叫 fork() 後 (FDs 複製前) 和呼叫 execve()前 (新 web app 開始運行),LaunchApp() 函數會強制關閉不在白名單上的 FD。

-

不同於傳統的黑名單作法 (close-on-exec flag: CLOEXEC),這種做法確保不會有多餘的開啟 FD,比較可靠。

-

Content process sandboxing (沙箱,低權限內容程序)

-

風險

- -

下表為 sandbox 開啟下可能的威脅列表,附帶前述的可能風險。

-
-

範疇: 當攻擊者以內容程序執行意外執行碼時,會出現下面的威脅,也就是說,攻擊者發現了 Gecko 的安全漏洞。

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
威脅潛在衝擊可能性因子建議對應作法
-

惡意內容程序利用核心安全漏洞

-

"2 steps attack".

-
嚴重:整個裝置都將受到控制: 內容程序只有有限的方法呼叫系統。 -
    -
  • 減少允許的系統呼叫數量到最低需要量。
  • -
  • 用預防性修正檔保護核心,例如 PaX (Protection Against eXecution).
  • -
-
-

提升到父程序權限

-

惡意內容程序利用和父程序之間的 IPDL 安全漏洞

-

"2 steps attack".

-
: 許多敏感的系統呼叫都可以被執行 (資料損失、相機存取、網路存取等等): 父程序大量的程式碼代表大範圍的可能攻擊點。少量的 IPDL 資料消毒,例如傳送指標。 -
    -
  • 以非 root / 非特權使用者執行父程序
  • -
  • 盡可能以 sandbox 方法執行父程序
  • -
-
-

惡意內容程序利用父程序攻擊核心安全漏洞

-

"3 steps attack".

-
嚴重:整個裝置都將受到控制 -

: 需要父程序有可以透過 IPDL 攻擊的 bug。

-

需要核心和父程序之間的系統呼叫可利用的漏洞 (相較內容程序,父程序有更多可行的系統呼叫)

-
-
    -
  • 以非 root / 非特權使用者執行父程序
  • -
  • 盡可能以 sandbox 方法執行父程序
  • -
  • 用預防性修正檔保護核心,例如 PaX (Protection Against eXecution)
  • -
-
-

惡意內容程序、父程序、web app 利用硬體裝置的 bug

-

"1 and 2 steps attack".

-
-

: 可以執行特別權限的作業 (如撥號、傳 SMS 簡訊等)

-

嚴重:整個裝置都將受到控制或執行硬體程式碼。

-
: 需要硬體 bug 以及 IPDL 或系統呼叫授予的硬體溝通管道 -
    -
  • 對硬體裝置實施模糊測試 (Fuzz testing)
  • -
  • 利用核心或父程序 API 修正檔避開問題 (關閉不安全的硬體功能、消毒資料等等)
  • -
-
-
-

Note:

-

* PaX (Protection Against eXecution) 是一個由 GrSecurity (docs) 所發佈的核心修正檔,實作了 PaX 以及額外的保護措施,如 UDEREF 和 SMAP。

-

* 未列出的安全性漏洞代表已被 snadbox 解決掉了。

-
-

實作內容

-

Process Model Sandbox

-
-

Note: 內容程序 (Content Processes) 就是運行中的 web app,也會被限制在 sandbox 環境。

-
-

Gecko APIs 實作

-

內容程序可見的 APIs 絕不應該直接存取檔案系統,取而代的是應該透過 IPDL,所以說會需要存取資源的 API 都需要在父程序中有一個對應的元件代表 API 存取資源。

-

實作相關部分時要特別小心,所有送到父程序的輸入都應該要先消毒,不可以相信內容程序以及來自內容程序的 IPDL 訊息。

-
-

Warning: 任何內容程序取得的受信任授權都可以被用來繞過 sandbox 所加諸的限制。

-
-

何謂 seccomp

-

Seccomp 代表 secure computing mode (安全電腦模式),目前有兩種版本:

-
    -
  1. -

    seccomp, 可見於 Linux kernel 2.6.12 以上版本:

    -
      -
    • -

      開啟 seccomp 會將程序的系統呼叫 (System call) 限制在 read, write, sigreturn, 和 exit

      -
    • -
    • -

      使用 prctl() system call

      -
    • -
    • -

      可以在指定地方、程序初始化後啟動

      -
    • -
    -
  2. -
  3. -

    seccomp-bpf, 又稱為 seccomp mode filter 或 mode 2, 可見於 Linux kernel 3.5 以上版本:

    -
      -
    • -

      如同 seccomp,但多了 BPF 過濾系統呼叫

      -
    • -
    • -

      可以使用系統呼叫白名單和啟動時傳入參數,而非單單預先寫死的作法

      -
    • -
    • -

      更有彈性,可以有"較多自由的 sandbox",對限制性較低的 sandbox 來說很有用,而且也可以移轉到限制性較高的 sandbox

      -
    • -
    • -

      多了一個安全性旗幟避免程序和子程序推翻既有權限限制

      -
    • -
    -
  4. -
-
-

Note: 基於 seccomp-bpf 更有彈性,所以我們決定採用,並且替版本低於3.5 的 kernel (涵蓋了目前大部分的 Android kernel)提供向下相容移植。目前已經有不會造成衝突、可供使用的移植包 (請見 bug 790923).

-
-

Seccomp-bpf 效能

-

seccomp-bpf 會對每一次系統呼叫造成效能負擔,目前沒有一定的效能標竿準則,但我們預估大約最高 1% 的系統呼叫負擔會產生。

-

由於我們的程序模型減少許多系統呼叫,所以實際上我們預估效能負擔將會趨近於無。

-

不過因實作細節而異, IPDL 呼叫卻可能造成效能負擔以及增加延遲,建議對於資源需求密集的 API,如 OpenGL 呼叫,可以看一下 Chromium的實作細節。和 seccomp-bpf 一樣,我們能夠最少化 IPDL 呼叫次數來最小化效能負擔。

-

實作內容

-

seccomp 在 Gecko 以 --enable-content-sandbox 開啟。.

-

預設上系統呼叫拒絕資訊不會被回報,我們可以透過 --enable-content-sandbox-reporter 打開回報機制。

-

程式碼放在 gecko/security/sandbox,白名單放在 gecko/security/sandbox/seccomp_filter.h

-

檔案系統安全強化

-

風險

- -

實作內容

-

原則上只有使用者內容區域可以讀寫 (除非 OS 未來要求新的讀寫區域),而且一定要包含 nodevnosuidnoexec 選項。標準檔案系統掛載點限制如下:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
掛載點檔案系統選項
/rootfsread-only
/devtmpfsread-write, nosuid, noexec, mode=0755
/dev/ptsptsfsread-write, nosuid, noexec, mode=0600
/procprocread-write, nosuid, nodev, noexec
/syssysfsread-write, nosuid, nodev, noexec
/cacheyaffs2 or ext4read-write, nosuid, nodev, noexec
/efsyaffs2 or ext4read-write, nosuid, nodev, noexec
/systemext4read-only, nodev
/dataext4read-write, nosuid, nodev, noexec
/mnt/sdcardext4 or vfatread-write, nosuid, nodev, noexec, uid=1000, fmask=0702, dmask=0702
/acctcgroupread-write, nosuid, nodev, noexec
/dev/cpuctlcgroupread-write, nosuid, nodev, noexec
-
-

Note: 實際的掛載點可能有所變更

-
-

Linux DAC

-

Linux DAC represents 是一個有名的 Linux 檔案系統權限模型。

-
-

Note: 這是傳統的 user/group/others 權限模型,而非 Linux POSIX 1.e ACLs.

-
- -

安全系統更新

-

風險

- -

實作內容

-

Firefox OS 的更新機制使用安全的 Mozilla 程序,更新檔是由受信任,通常是 OEM 廠商,組建、測試、簽署數位簽章。

-

FOTA (Firmware over the air) 更新

-

系統更新可能涵蓋全部或部分 Firefox OS,如果更新涵蓋到 Gonk,那麼 FOTA (Firmware Over the Air) 安裝程序會被採用。FOTA 也可涵蓋到 OS 其他部分,例如裝置管理 (FOTA, firmware / drivers)、設定管理 (Firefox OS settings)、安全更新、Gaia、Gecko 等等。

-

MSU/MAR 更新

-

不牽涉到 Gonk 的更新可以透過 Mozilla 系統更新工具。Firefox OS 使用和桌面 FIrefox 一樣的更新架構、程序 Mozilla ARchive (MAR) 格式 (用於更新包)。

-

更新服務

-
-

Note: 更新服務能由 OEM 廠商提供。

-
-

手機內建的更新系統會定期檢查更新,一但發現新更新,會提示使用者安裝更新,另外安裝前也會檢查手機儲存空間以及驗證發行者身分:

- -

下列安全性作法會用在更新程序:

- -

縝密的更新檢查確保正常地安裝更新。

-
-

Note: 更多有關更新資訊,請見 Creating and applying Firefox OS update packages.

-
-

 

diff --git a/files/zh-tw/archive/b2g_os/simulator/index.html b/files/zh-tw/archive/b2g_os/simulator/index.html deleted file mode 100644 index 3b5677a518..0000000000 --- a/files/zh-tw/archive/b2g_os/simulator/index.html +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Firefox OS 模擬器 -slug: Archive/B2G_OS/Simulator -translation_of: Archive/B2G_OS/Simulator ---- -
-

本文將針對 Firefox OS 1.2 或更高版本,說明 Firefox OS 模擬器 (Firefox OS Simulator) 相關使用方式。如果開發者目前正開發 Firefox OS 1.1 的 App,則請參閱 Firefox OS 1.1 Simulator 的相關文章。

-
- -

Firefox OS 模擬器可於桌機中模擬 Firefox OS 裝置。開發者不用真的弄到實際設備就能夠測試 App 並進行除錯。模擬器會在視窗中以 Firefox OS 裝置的實際尺寸執行,亦包含 Firefox OS 使用者介面與已內建的 App,進而模擬多樣的 Firefox OS 裝置 API。

- -

Firefox OS 模擬器是以 Firefox 附加元件的格式發佈,可下載並安裝於 Firefox 瀏覽器之上,接著可透過應用程式管理員 (App Manager) 來執行模擬器、將 App 送入模擬器、搭配其他開發者工具。

- -

安裝

- -

直接點擊下方按鈕即可安裝模擬器。現有多個版本可供安裝。我們也建議開發者能安裝所有版本,以達最佳開發靈活度。

- -

安裝 Firefox OS Simulator

- -

另請參閱《應用程式管理員》中的說明來啟動模擬器。一旦模擬器開始執行,開發者即可將 App 送入應用程式管理員進行除錯;就如同使用實際裝置一樣。

- -
-

注意:模擬器 (1.2 與 1.3 版) 目前正回報 1 組錯誤的 Gecko user agent 字串:請參閱 {{ Bug("964598") }} 進一步了解。

-
- -

模擬器的使用者介面 (UI)

- -

模擬器將另外顯示獨立的視窗,且模擬畫面則為 320x480 像素。若要模擬觸控事件,則可按下滑鼠按鈕不放並拖曳。只要在主畫面上按下滑鼠不放並從右向左拖曳,即可看到已內建的 App,還有開發者剛送入的 App:

- -

- -

在模擬器視窗底部的工具列共有 2 個按鈕:

- - - -

模擬器的限制

- -

請注意,Firefox OS 模擬器仍無法提供完美的模擬作業。

- -

硬體限制

- -

模擬器除了螢幕尺寸的限制之外,也無法模擬 Firefox OS 裝置的硬體 (例如 CPU 速度或可用的記憶體容量)。

- -

音訊/視訊編碼

- -

下列編碼 (Codecs) 因硬體加速解碼而有所不同,因此尚未支援:

- - - -

也就是說,若 App 或網站 (如 Youtube) 使用這些編碼,則模擬器將無法測試其中的視訊回播功能。

- -

未支援的 API

- -

一般來說,因為桌上型電腦無法使用支援硬體,所以可於裝置上運作的特定 API,可能無法用於模擬器之上。我們另外針對某些 API (例如 Geolocation 地理位置定位) 建構了模擬功能,未來版本亦將新增更多模擬 API。但目前仍尚未支援下列 API。如果使用了這些 API,也只會得到錯誤的報告或結果:

- - - -

獲得協助

- -

如果有任何問題,請透過 dev-developer-tools 郵件群組或到 #devtools on irc.mozilla.org 上發問。

- -

啟動詳細資訊 (verbose) 記錄的方法

- -

開發者可到網頁主控台 (Web Console) 觀看 App 的記錄訊息,並透過應用程式管理員將記錄附加到 App 上。如果想知道 App 啟動時的早期訊息,甚至早於主控台連線並開始作業的訊息,則開發者可啟動模擬器中的詳細資訊記錄功能。

- -

可透過 about:config 並建立新的 preference 設定。依照模擬器的版本,preference 的名稱也有所差異:

- - - -

針對「附加元件管理員 (Add-on Manager)」中的附加元件,可將字串值設為「all」、停用,再啟用。目前有關模擬器作業的額外訊息,均將出現於瀏覽器主控台 (Browser Console) 中。

diff --git a/files/zh-tw/archive/b2g_os/simulator/simulator_walkthrough/index.html b/files/zh-tw/archive/b2g_os/simulator/simulator_walkthrough/index.html deleted file mode 100644 index 9e7fba8c07..0000000000 --- a/files/zh-tw/archive/b2g_os/simulator/simulator_walkthrough/index.html +++ /dev/null @@ -1,268 +0,0 @@ ---- -title: Firefox OS 模擬器簡易攻略 -slug: Archive/B2G_OS/Simulator/Simulator_Walkthrough -translation_of: Archive/B2G_OS/Simulator/Simulator_Walkthrough ---- -

這裡將透過 Firefox OS 模擬器 (Firefox OS Simulator) 對 Web Apps 進行很簡單的除錯 (但要找的 bug 有點多)。

-

整個簡易攻略分成 6 個部分,各自使用不同的診斷/除錯工具,包含 manifest 檢驗功能網頁主控台 (Web Console)JavaScript 除錯器 (JavaScript Debugger)網路監測器 (Network Monitor)樣式編輯器 (Style Editor)收據 (Receipts) 測試

-

這 6 個部分各自獨立。就算你只挑其中幾段來看,應該也能看得懂而不會有銜接上的問題。

-

manifest 檢驗功能

-
-

GitHub 上的 firefoxos-simulator-walkthrough 現有不同版本的 App。如果你想從第一段開始了解 App 的修正程序,可從 App 的 whereami-1 版本著手,逐步完成此攻略。

-

這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。

-

此處假設你已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator),並開啟了 Dashboard。

-
-

首先我們點選「Add Directory」,將 App 新增至 Dashboard 中,再選擇 manifest 檔案。畫面如下:

-


-
- 點選「(2 errors and 0 warnings)」就會看到:

-


- 畫面將清楚顯示錯誤訊息。此時看到「manifest.webapp」就會發現少了 1 組「name」:

-
{
-  "description": "A simple web app",
-  "launch_path": "/index.html",
-  "icons": {
-    "128": "/style/icons/earth.png"
-  }
-}
-


- 我們把「name」欄位加入 manifest 檔案之後儲存,再點選 Dashboard 中的「Refresh」:

-
{
-  "name": "Where am I?",
-  "description": "A simple web app",
-  "launch_path": "/index.html",
-  "icons": {
-    "128": "/style/icons/earth.png"
-  }
-}
-


- 此時 Dashboard 應該會告知沒有錯誤,也就能執行 App:

-

-

但這時就算你按下按鈕,模擬器也不會有任何動作。我們會在下一段中使用 WebConsole 診斷此問題。

-

使用網頁主控台 (Web Console)

-
-

如果你要從這裡開始研讀攻略:

-

這一段將透過 Firefox OS 模擬器 (Firefox OS Simulator),對很簡單的 Web App 進行除錯。GitHub 上的 firefoxos-simulator-walkthrough 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 whereami-2 版本著手,逐步完成此攻略。

-

這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。

-

但此版本的 App 不會執行任何作業。本段透過 WebConsole 診斷出問題。

- 此處假設你已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。
-

這裡必須按下 Dashboard 上的「Connect」按鈕:

-

-

隨即自動開啟模擬器視窗並執行 App。而 Dashboard 分頁另將出現網頁主控台 (WebConsole)。

-

主控台的輸出結果會提示幾項錯誤、警告、訊息。但請注意最後一項:
-
-
-
- 看來是 App 的程式碼「whereami.js」明顯出了問題。這裡列出程式碼的前幾行:

-
var whereami = document.getElementById('whereami');
-
-whereami.onclick = function() {
-  navigator.geolocation.getCurrentPosition(getMap, error);
-};
-


- 若與 App 的「index.html」相較,則問題明顯是:

-
<!DOCTYPE html>
-
-<html>
-
-  <head>
-    <meta charset='utf-8'>
-    <script src="http://open.mapquestap.com/sdk/js/v7.0.s/mqa.toolkit.js"></script>
-    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
-
-  </head>
-
-  <body>
-    <button id ="where-am-i">Where am I?</button>
-    <div id="map"></div>
-    <script src="scripts/whereami.js"></script>
-    <link media="all" href="style/style.css" type="text/css" rel="stylesheet">
-  </body>
-
-</html>
-


- 在 HTML 中的按鈕 ID 是「where-am-i」,而不是我們在前面 JavaScript 中所使用的「whereami」。所以我們修改為:

-
var whereami = document.getElementById('where-am-i');
-
-whereami.onclick = function() {
-  navigator.geolocation.getCurrentPosition(getMap, error);
-};
-

接著啟動 App 時雖然沒有問題,但仍未顯示地圖。這時主控台又出現新的訊息:

-

-

此訊息是由「whereami.js」程式碼所記錄,指出 Geolocation API 回傳了錯誤,卻沒有說明是哪種錯誤。接著我們可用 JavaScript 除錯器 (JavaScript Debugger) 找出錯誤類型。

-

使用 JavaScript 除錯器 (JavaScript Debugger)

-
-

如果你要從這裡開始研讀攻略:

-

這一段將透過 Firefox OS 模擬器 (Firefox OS Simulator),對很簡單的 Web App 進行除錯。GitHub 上的 firefoxos-simulator-walkthrough 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 whereami-3 版本著手,逐步完成此攻略。

-

這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。

-

此版本 App 的 Geolocation API 將回傳錯誤。所以本段將透過 JavaScript 除錯器 (JavaScript Debugger) 找出到底是哪種問題。

-

此處假設你已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。

-
-

在連上 App 的網頁主控台 (WebConsole) 中,點選 Geolocation 錯誤記錄的右側鏈結:

-


- 按下「whereami.js:8」鏈結之後,JavaScript 除錯器隨即自動載入相關檔案並跳到有問題的行數。

-

根據這篇 Geolocation API 參考所述,這裡將由錯誤處理器 (Error handler) 的 error() 屬性送入 code 物件,而我們再透過 error 物件的 code 屬性獲知此特定錯誤的詳細資訊。所以我們點選左側行數為 8 的那一行,即可於 error() 之內設定中斷點:

-

-

在 App 之內點選「Where am I?」之後,執行作業就會停在中斷點:

-

-

此時只要按下「Add watch expression」的地方並鍵入「error.code」,就會立刻看到其值為「1」:

-


- 同樣根據 Geolocation API 參考文件所述,「1」即代表「權限已遭否決」。如果 Web Apps 尚未請求 Geolocation 權限,或使用者尚未許可該權限,都會發生這種錯誤。
-
- 這時來看「manifest.webapp」檔案,就會看到我們尚未要求權限:

-
{
-  "name": "Where am I?",
-  "description": "A simple web app",
-  "launch_path": "/index.html",
-  "icons": {
-    "128": "/style/icons/earth.png"
-  }
-}
-


- 接著修復如下:

-
{
-  "name": "Where am I?",
-  "description": "A simple web app",
-  "launch_path": "/index.html",
-  "icons": {
-    "128": "/style/icons/earth.png"
-  },
-  "permissions": {
-    "geolocation": {
-      "description": "Needed to tell the user where they are"
-      }
-  }
-}
-


- 儲存「manifest.webapp」之後,再按下 Dashboard 中的「Refresh」。這裡記得要在除錯器停在中斷點時,才能繼續除錯。而當你點選「Where am I?」,App 隨即會要求你分享你的位置。而你允許分享之後仍看不到地圖,接著又在 WebConsole 中找到新的訊息:

-

-

此訊息指出 MapQuest API (在 App 中以 script 標籤所指定) 並未正確載入。接著可使用網路監測器 (Network Monitor) 找出問題。

-

使用網路監測器 (Network Monitor)

-
-

如果你要從這裡開始研讀攻略:

-

這一段將透過 Firefox OS 模擬器 (Firefox OS Simulator),對很簡單的 Web App 進行除錯。GitHub 上的 firefoxos-simulator-walkthrough 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 whereami-4 版本著手,逐步完成此攻略。

-

這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。

-

此版本 App 的網頁主控台 (WebConsole) 將顯示「MQA is not defined」錯誤。所以本段將透過網路監測器 (Network Monitor) 找出未載入 MapQuest API 的原因。

-

此處假設你已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。

-
-
-

警告:需 Firefox 23.0 或更高版本才具備網路監測器功能。

-
-

在連上 App 的開發者工具中,點選「Network」分頁就會看到下列面板。可以看到「open.mapquestap.com」網域針對「mqa.toolkit.js」資源所發出的請求,從未完全成功過:

-

-

成功的請求均標記為綠色。如果我們點選「open.mapquestap.com網域 (深灰色) 的請求之一,點選「Timings」的細節面板,就會看到 DNS 解析 (DNS resolution) 並未成功,因此該請求從未達到「Connecting」的狀態。

-

再看到「index.html」檔案,會發現 script 標籤指向錯誤網域。

-

這裡變更 script 標籤以使用正確的網域:open.mapquestapi.com (於網域名稱內加入缺少的「i」) 之後,即可修復此錯誤。

-
<!DOCTYPE html>
-
-<html>
-
-  <head>
-    <meta charset='utf-8'>
-    <script src="http://open.mapquestapi.com/sdk/js/v7.0.s/mqa.toolkit.js"></script>
-    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
-
-  </head>
-
-  <body>
-    <button id ="where-am-i">Where am I?</button>
-    <div id="map"></div>
-    <script src="scripts/whereami.js"></script>
-    <link media="all" href="style/style.css" type="text/css" rel="stylesheet">
-  </body>
-
-</html>
-

儲存「index.html」並點選 Dashboard 中的「Refresh」。在 App 執行時按下「Where am I?」,系統就會要求你分享你的位置。在你允許分享之後,App 終於顯示地圖:
-

-

使用樣式編輯器 (Style Editor)

-
-

如果你要從這裡開始研讀攻略:

-

這一段將透過 Firefox OS 模擬器 (Firefox OS Simulator) 客製化 App 的樣式表 (Stylesheets)。 GitHub 上的 firefoxos-simulator-walkthrough 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 whereami-5 版本著手,逐步完成此攻略。

-

這個 App 只會顯示 1 個「Where am I?」按鈕。只要使用者點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。

-

此版本的 App 已修復前述的所有錯誤。接著我們將透過樣式編輯器 (Style Editor),為執行中的 App 即時變更樣式並儲存之。

-

此處假設你已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。

-
-
-

警告:必須 Firefox 23.0 或更高版本才具備網路監測器 (目前 Firefox Beta 試用版才是 23.0 版)

-
-

在連上 App 的開發者工具中,點選「Style Editor」分頁就會看到下列面板:

-

-

點選左側樣式表清單中的「style/style.css」,並修改 CSS 規則。新的規則會立刻套用至已連線的 App 上:

-

-

現在點選樣式表「style/style.css」正下方的「Save」,即可將之儲存回專案中。

-

使用收據 (Receipts) 測試功能

-
-

如果你要從這裡開始研讀攻略:

-

這一段將透過 Firefox OS 模擬器 (Firefox OS Simulator),為 Web App 新增付款收據驗證碼。GitHub 上的 firefoxos-simulator-walkthrough 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 whereami-6 版本著手,逐步完成此攻略。

-

這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。

-

我們要把此版本 App 變更為付費 Web App。

-

此處假設你已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。

-
-

目前你已經將 App 修改為無錯誤的 App,並已擁有合適的樣式。現在可新增付款收據驗證 (Payment Receipt Validation) 功能,確保使用者必須購買此 App。

-

Mozilla 另已提供小型的 JavaScript 函式庫,可協助 Apps 檢查自己的收據:http://github.com/mozilla/receiptverifier

-

為 App 新增 receiptverifier (把新的 script 標籤加入「index.html」檔案中):

-
<!DOCTYPE html>
-
-<html>
-
-  <head>
-    <meta charset='utf-8'>
-    <script src="https://raw.github.com/mozilla/receiptverifier/master/receiptverifier.js"></script>
-    <script src="http://open.mapquestapi.com/sdk/js/v7.0.s/mqa.toolkit.js"></script>
-    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
-
-  </head>
-
-  <body>
-    <button id ="where-am-i">Where am I?</button>
-    <div id="map"></div>
-    <script src="scripts/whereami.js"></script>
-    <link media="all" href="style/style.css" type="text/css" rel="stylesheet">
-  </body>
-
-</html>
-

接著再以「mozmarket.receipts.Verifier」API 檢查「scripts/whereami.js」中的收據 (將於按下按鈕,或於載入 App 時檢查收據):

-
...
-
-var verifier = new mozmarket.receipts.Verifier({
-  installs_allowed_from: '*',
-  typsAllowed: 'test-receipt',
-  logLevel: mozmarket.receipts.Verifier.levels.DEBUG,
-  onlog: mozmarket.receipts.Verifier.consoleLogger
-});
-verifier.clearCache();
-
-function verifyPaymentReceipts(cb) {
-  verifier.verify(function (verifier) {
-    if (verifier.state instanceof verifier.states.OK) {
-      cb(null); // valid payment
-    } else {
-      cb("invalid-payment"); // invalid payment
-    }
-  });
-  setTimeout(function checkNoReceipts() {
-    if (verifier.state instanceof verifier.states.NoReceipts) {
-      cb("no-receipts");
-    }
-  }, 2000);
-}
-
-whereami.onclick = function() {
-  verifyPaymentReceipts(function (err) {
-    if (err) {
-      alert("Invalid Payment Receipt.");
-    } else {
-      navigator.geolocation.getCurrentPosition(getMap, error);
-    }
-  });
-};
-
-

正常情況需透過 Marketplace 與 Payment 服務,以加密方式簽署收據。但目前可先用模擬器 App 項目中的「Receipts」選單,點選所要安裝的收據類型 (預設為「None」),即可為 App 安裝測試收據。

-

-

現在即可測試 App 具備「Valid」、「Invalid」、「Refunded」收據,或無收據時的行為。另可於網頁主控台觀看「receiptverifier」函式庫所產生的記錄,藉以了解相關結果:

-

-

-
-

注意:whereami-7 版本即為最終完成的 App。

-
-

 

diff --git a/files/zh-tw/archive/b2g_os/using_the_app_manager/index.html b/files/zh-tw/archive/b2g_os/using_the_app_manager/index.html deleted file mode 100644 index 8486eeb959..0000000000 --- a/files/zh-tw/archive/b2g_os/using_the_app_manager/index.html +++ /dev/null @@ -1,259 +0,0 @@ ---- -title: 應用程式管理員 (App Manager) -slug: Archive/B2G_OS/Using_the_App_Manager -translation_of: Archive/B2G_OS/Using_the_App_Manager ---- -
-

「應用程式管理員 (App Manager)」為 Firefox 桌面版的新工具,具備多樣的有效工具,可透過開發者的瀏覽器,直接於 Firefox OS 手機與 Firefox OS 模擬器 (Firefox OS Simulator) 中進行 HTML5 Web App 的測試、佈署、除錯等作業。

- -

應用程式管理員適用於 Firefox OS 1.2 或更高版本。如果你正為 Firefox OS 1.1 開發 App,則請參閱《Firefox OS 1.1 Simulator》一文。

-
- -

{{EmbedYouTube("z1Bxg1UJVf0")}}

- -

應用程式管理員具備下列元件:

- - - -

快速設定:

- -

本段將協助開發者儘快設定並執行應用程式管理員。如果你需要進一步詳細資訊,則請略過本段文章而直接觀看下一段《裝置與系統設定》。若發生任何問題,亦可參閱本文最後一段《疑難排解》。

- -
    -
  1. 確認已安裝桌面版 Firefox 26 或更高版本
  2. -
  3. 開啟應用程式管理員 (可於網址列中鍵入 about:app-manager)
  4. -
  5. 若你手上並沒有實際的 Firefox OS 裝置: -
      -
    1. 先安裝 Firefox OS 模擬器 (Firefox OS Simulator)
    2. -
    3. 在應用程式管理員底部的工具列中,點選 Start Simulator 再點選已安裝的模擬器名稱 (已安裝的模擬器均應出現)。
    4. -
    -
  6. -
  7. 若你擁有 Firefox OS 實體裝置: -
      -
    1. 確認目前為 Firefox OS 1.2 或更高版本
    2. -
    3. 確認已在視窗系統中安裝該款手機的驅動程式
    4. -
    5. 進入裝置的「Settings」,停用「Screen Lock (Settings > Screen Lock)」並啟用「Remote Debugging (Settings > Device information > More information > Developer)」
    6. -
    7. 另為 Firefox 桌面版安裝 ADB Helper 附加元件
    8. -
    9. 使用 USB 纜線銜接裝置與電腦
    10. -
    11. 接著應可於應用程式管理員的底部看到裝置名稱,點選該裝置
    12. -
    -
  8. -
  9. 底部應顯示「Connected to: xxx」
  10. -
  11. 點選 Apps panel 並新增 App;封裝式 (Packaged) 或托管式 (Hosted) App 均可
  12. -
  13. Refresh 按鈕將驗證該 App 並安裝於裝置/模擬器中
  14. -
  15. Debug 按鈕則銜接開發者工具與執行中的 App
  16. -
  17. 若遇上任何錯誤,可參閱〈疑難排解〉章節
  18. -
- -

裝置與系統設定

- -

使用應用程式管理員前的第一件事,就是必須正確設定現有的系統與手機。本段將逐步說明各個步驟。

- -

需要 Firefox 1.2 或更高版本

- -

確認裝置目前為 Firefox OS 1.2/Boot2Gecko 1.2 或更高版本。若要檢查目前 Firefox OS 版本,可點選 Settings > Device Information > Software

- -

如果尚未安裝必要的 Firefox OS 版本,則根據手機型號的不同,你可能必須安裝 Firefox 1.2 或更高的 nightly 版本,或自行透過原始碼進行設定與建置 (Build)。

- -

目前可用的建置:

- - - -

若要建構自己的 Firefox OS 1.2 或更高版本,請參閱 Building and installing Firefox OS 說明,並從 Firefox OS build prerequisites 著手開始。

- -

遠端除錯 (Remote debugging)

- -

接著必須啟動 Firefox OS 中的遠端除錯 (Remote debugging) 功能。點選Settings > Device information > More information > Developer,最後勾選 Remote Debugging 方塊即可。

- -

ADB 或 ADB helper

- -

透過 Android Debug Bridge (ADB) 處理裝置與電腦之間的連線作業。現有 2 種 ADB 執行方式:

- - - -
-

注意:只要安裝 ADB Helper 附加元件,就不需執行此指令。

-
- -

將裝置連上應用程式管理員

- -

完成所有設定之後,就可將裝置連上電腦並啟動應用程式管理員:

- -
    -
  1. 以 USB 纜線銜接裝置與電腦。
  2. -
  3. 進入 Settings > Screen Lock 並取消勾選 Lock Screen,以停用裝置的螢幕鎖定功能。一旦螢幕鎖定之後,手機與電腦的連線將隨之中斷,也就無法進行除錯作業。因此最好先停用此功能。
  4. -
  5. 啟動應用程式管理員 — 到 Firefox 桌面版中點選「工具 (Tools)」>「網頁開發者 (Web Developer)」>「應用程式管理員 (App Manager)」選單;或於網址列中鍵入 about:app-manager
  6. -
  7. 應用程式管理員分頁的底部可看到連線狀態顯示列 (如下圖所示)。只要點選「Connect to localhost:6000」按鈕即可連線裝置。
  8. -
  9. 若連線成功,裝置畫面隨即出現「An incoming request to permit remote debugging connection was detected. Allow connection?」對話框。按下「OK」鈕 (你可能必須按下手機的電源鍵,才會看到該對話框)。接著應會更新連線狀態列並顯示「Connected to B2G」。此時也將出現「Disconnect」按鈕,以利隨時中斷連線。
  10. -
- -

- -
-

另請注意,位於連線狀態列中的其他控制鈕,可讓你銜接模擬器與應用程式管理員 (將於下一段中說明),並更改連線所使用的通訊埠。若要更改通訊埠,則必須啟動該通訊埠的「轉發通訊埠 (Port forwarding)」功能。可參閱上述的啟動轉發通訊埠

-
- -

使用 Firefox OS Simulator 附加元件

- -

如果你手上還沒有實際的 Firefox OS 裝置可搭配 App Manager,也能透過 Firefox OS 模擬器 (Firefox OS Simulator) 附加元件體驗應用程式管理員。請先為自己的作業系統安裝合適的模擬器:

- -

安裝 Firefox OS 模擬器

- -
-

注意:目前僅有 Firefox OS 1.2 模擬器。未來將提供更多版本選擇。

-
- -

安裝模擬器之後,請透過 about:app-manager 找到應用程式管理員分頁底部的連線狀態列,點選「Start simulator」按鈕。接著將出現至少 3 組按鈕:

- - - -
-

注意:模擬器 (1.2 與 1.3 版) 目前回報 1 組錯誤的 Gecko user agent 字串:可參閱 {{ Bug("964598") }} 進一步了解。

-
- -

「Apps」面板

- -

所有要件設定完畢之後,就從「Apps」面板開始了解應用程式管理員的功能吧。先透過 Apps 面板將現有 App 送入裝置中並進行除錯:

- - - -

視窗右側隨即顯示 App 的相關資訊,如下圖所示:

- -

- -

Manifest 檔案編輯器 (Manifest Editor)

- -

從 Firefox 28 開始,「Apps」面板即包含編輯器功能,可用於 App 的 manifest 檔案:

- -

- -

除錯

- -

此時點選「Update」就會更新 (或安裝) 裝置上的 App。點選「Debug」則會連上工具箱,以利直接對程式碼進行除錯:

- -

- -
-

注意:你可能會玩工具箱玩到上癮 — 快試著修改 DOM、CSS 等。接著就能看到裝置即時反應出更新的效果。相關更新均將儲存於已安裝的 App 程式碼中,下次再開啟裝置中的 App 就能一目了然。

-
- -

若是 Firefox 28 之前的版本,這些工具將顯示於另一個獨立視窗中。從 Firefox 28 開始,這些工具均顯示於應用程式管理員之內的獨立分頁中;就接在「Apps」與「Device」分頁之下。此分頁將顯示目前 App 的圖示,因此極容易辨識:

- -

- -

錯誤

- -

如果新增 App 失敗 (可能是 URL 錯誤,或選到了封裝式 App 的資料夾),則該頁仍會顯示所新增的 App 項目,也會包含錯誤資訊。

- -

- -

另外只要將滑鼠游標移至視窗左邊的 App 名稱/說明之上,在「X」按鈕出現時按下,即可在此畫面中刪除該 App。請注意此動作並不會刪除裝置中的 App。必須從裝置上手動移除 App,才會真正刪除裝置中的 App。

- -

「Device」面板

- -

「Device」面板將顯示已連線裝置的相關資訊。另可透過「Installed Apps」視窗中開啟裝置上的 App 並進行除錯。

- -

- -
-

注意:依預設值,此處並不會顯示 Certified App。可參閱 Certified App 的除錯方式

-
- -

「Permissions」視窗將針對目前裝置上的不同 Web API,顯示必要的權限。

- -

- -

最後可按下「Screenshot」按鈕,即可對目前裝置的顯示項目拍下截圖。此截圖將以 Firefox 的新分頁開啟,讓你決定是否要儲存該圖。

- -

Certified App 的除錯

- -

目前僅限搭載 Firefox OS 1.2 開發版本的裝置,才能進行 Certified Apps 的除錯。若你手上的裝置正執行開發版本,則可將設定檔中的「 devtools.debugger.forbid-certified-apps」變更為「false」,即可開始 Certified App 的除錯。可參閱下列步驟:

- -
    -
  1. -

    在電腦的終端/主控台上輸入下列指令,以進入裝置的 filesystem:

    - -
    adb shell
    - -

    接著命令列提示將轉為 root@android

    -
  2. -
  3. -

    接著以下列指令暫停執行 B2G:

    - -
    stop b2g
    -
  4. -
  5. -

    進入以下目錄:

    - -
    cd /data/b2g/mozilla/*.default/
    -
  6. -
  7. -

    以下列指令更改 prefs.js 檔案:

    - -
    echo 'user_pref("devtools.debugger.forbid-certified-apps", false);' >> prefs.js
    -
  8. -
  9. -

    在完成編輯並儲存檔案之後,再以下列指令重新啟動 B2G:

    - -
    start b2g
    -
  10. -
  11. -

    輸入 exit 指令以退出 Android 的 filesystem 之後,就會回到正常的終端畫面。

    -
  12. -
  13. -

    最後再次連回應用程式管理員,就能看到 Certified App 出現,即可進行除錯。

    -
  14. -
- -
-

注意:如果你想把這個偏好設定加入自己的 Gaia 版本,則可執行 DEVICE_DEBUG=1 reset-gaia

-
- -

在應用程式管理員中執行自訂的版本

- -

只要透過 Firefox OS 模擬器,即可於應用程式管理員中執行自訂的 B2G Desktop 與 Gaia 版本。可參閱《Running custom Firefox OS/Gaia builds in the App Manager》進一步了解。

- -

疑難排解

- -

如果系統無法辨認裝置:

- - - -

還是無法讓自己的裝置連上應用程式管理員或啟動模擬器嗎?快讓我們知道到 bugzilla 回報錯誤

diff --git a/files/zh-tw/archive/b2g_os/using_the_b2g_desktop_client/index.html b/files/zh-tw/archive/b2g_os/using_the_b2g_desktop_client/index.html deleted file mode 100644 index 46fc57a972..0000000000 --- a/files/zh-tw/archive/b2g_os/using_the_b2g_desktop_client/index.html +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: 使用 Firefox OS 的電腦桌面 client 程式 -slug: Archive/B2G_OS/Using_the_B2G_desktop_client -translation_of: Archive/B2G_OS/Building_the_B2G_OS_simulator ---- -

Firefox OS 的 desktop client,也被稱為 B2G desktop client,讓您可以在一個以 Gecko 為基礎的環境-有點類似實際行動裝置的環境下執行 Gaia 和 web apps。它不會模擬行動裝置的硬體,因此它並不適合拿來測試行動裝置的 API,也不能取代在實際硬體上的測試。然而,它的確擁有一些 Firefox 上所沒有 APIs,像是聯絡人(Contacts)和設定(Settings)的 Apis。因此,當我們在開發應用程式、或是在操作 Gaia 使用者介面上可以派上用場。

- -

這篇文章不但涵蓋下載或是建置 Firefox desktop client,也包含了如何使用它。

- -

下載 nightly 版本

- -

如同 Firefox Nightlies 一般,Firefox OS 的 desktop client 每天都會用最新的原始碼編譯出一個版本。最新的版本將 可以從 Mozilla FTP 伺服器取得。請確定挑到最新的版本和對的封存給您的作業系統。

- -

我們現在可以略過下面內容,直接到「執行 desktop client」。

- -

建置 desktop client

- -

我們需要做的地一件事情是架起 Mozilla 的標準建置環境。一旦我們有了這個環境,我們可以降低我們所需要的原始碼,並且設定建置 Firefox OS 的 desktop client。

- -

第一次下載原始碼

- -

在我們要放置程式碼的目錄(資料夾)中,讓我們將包含所有 Gecko 的 mozilla-central 倉儲 (repository)給複製下來。

- -
 hg clone http://hg.mozilla.org/mozilla-central
-
- -

更新程式碼

- -

當我們之後編譯後來的版本時,我們要確定我們有最新的原始碼。下列就是如何拉到最新的更新的指令:

- -
cd mozilla-central
-hg pull -u
-
- -

建立 mozconfig

- -

接著,我們要在 mozilla-central 目錄下新增一個檔案 mozconfig 來設定建置系統去編譯 Boot to Gecko client 程式而不是 Firefox:

- -
mk_add_options MOZ_OBJDIR=../build
-mk_add_options MOZ_MAKE_FLAGS="-j9 -s"
-
-ac_add_options --enable-application=b2g
-ac_add_options --disable-libjpeg-turbo
-
-# This option is required if you want to be able to run Gaia's tests
-ac_add_options --enable-tests
-
-# turn on mozTelephony/mozSms interfaces
-# Only turn this line on if you actually have a dev phone
-# you want to forward to. If you get crashes at startup,
-# make sure this line is commented.
-#ac_add_options --enable-b2g-ril
- -

建置(編譯)

- -

現在我們已經準備好要在目錄 mozilla-central 裡面、透過下面的指令來編譯 desktop client。

- -
./mach build
- -

編譯好的 client 會被放在 ../build/dist 目錄下 (基本上是依照 mozconfig 檔案裡面的 MOZ_OBJDIR 參數所指定的值)。

- -

執行 desktop client

- -

預設 desktop client 會顯示空的畫面,因為它並不知道一開始要載入哪個 web app 來當做系統 app。系統 apps 和 Firefox OS 中預設會有的 apps 就被稱為 Gaia。

- -

下載 Gaia

- -

第一次下載 Gaia、讓我們從 GitHub 上複製原始碼的倉儲 (repository):

- -
 git clone https://github.com/mozilla-b2g/gaia
- -

為了更新成 Gaia 的一個已存在的版本,我們可以從 GitHub 拉最新的更新:

- -
cd gaia
-git pull
-
- -

產生 profile

- -

接著我們需要設定 desktop client 中 Gaia 的 apps。這包括包裝行動裝置上也有的 Gaia apps,以及設定系統 apps 的權限。我們透過產生一個 profile 來做這些事情。接著的指令會做這些事情:新的 profile 包含一個客製的擴充以及其他 B2G 正常運作所需的設定。所以在 gaia 目錄裡執行下面的指令:

- -
cd gaia
-make
-
- -

這應該會在 gaia 目錄下面建立一個 profile 目錄。

- -

在 Linux 上執行

- -

只要在啟動 b2g 執行檔的時候加上 profile 參數,就可以使用我們剛剛產生的 profile 來啟動 desktop client 。如果是自己編譯的話,執行檔的位置會在早先下載下來的 tarball 裡面,如果是自己編譯的話,就會在 ../build/dist/bin 的目錄裡。

- -
.../b2g -profile gaia/profile
-
- -

您可能會碰到惱人的 rendering 問題。只要在 gaia/profile/prefs.js 裡面加上下面這行就可以避開這個問題:

- -
user_pref("layers.acceleration.disabled", true);
-
- -

在 Mac 上執行

- -

在 Mac 上,b2g 執行檔的位置和需要指定 profile 的絕對路徑,因此指令比較複雜:

- -
.../B2G.app/Contents/MacOS/b2g -profile /full/path/to/gaia/profile
-
- -

指令的選項(或參數)

- -

在使用 desktop client 時,你可以使用一些指令的參數來調校執行時的體驗。您可以用 -help 這個參數來列出參數的列表。這一節涵蓋一些特別的參數。

- -

明確指定螢幕大小

- -

您可以用 --screen 來指定您想要模擬的行動裝置的螢幕大小:

- -
b2g --screen=<width>x<height>[@<dpi>]
- -

<width>, <height>, and <dpi> 都是相當不用解釋的參數:行動裝置以 pixels 為單位的長和寬以及 DPI 解析度。舉例來說:

- -
b2g --screen=320x480
-b2g --screen=320x480@160
-
- -

或者,您可以使用某些行動裝置的名字來模擬他們的螢幕大小和解析度:

- - - -

開啟 JavaScript console

- -

在您開啟 B2G 的 desktop client 時,您可以藉由加上 -jsconsole 這個記號來開啟
- JavaSCript console。在編譯之後,只要:

- -
.../b2g -jsconsole -profile /path/to/your/profile
- -

如果您已經在 Mac 上安裝了 nightly 版本的話,您可以照著下面的指令:

- -
/Applications/B2G.app/Contents/MacOS/b2g -jsconsole -profile /path/to/your/profile
- -

在 B2G 啟動時,指定開啟一個應用程式

- -

您現在可以指定一個應用程式在 b2g desktop client 開始運作時,自動執行起來。這會在其他系統程式被掛載起來之後,馬上讓指定的應用程式被執行起來。只要加上 --runapp 這個參數、後面在加上要執行應用程式的名字,就可以做到了。如下:

- -
 .../b2g -profile /path/to/your/gaia/profile --runapp email
- -

在尋找要執行的 app 之前,指定的名字要被正規化為全部小寫、且不能帶有 - 和空白的符號。接著這個正規化過的名字會被拿來和 app 的 manifest 的名字做比較。

- -

舉例來說,現在 email app 的名字是「E-mail」,但是因為正規化的效果, --runapp email 這個參數是 ok可以執行的。

- -

如果您加了 --runapp 參數但是卻沒有帶後面的 app 名字、或是帶了空的名字的話,b2g client 會列出一串列表,其中包括已知的應用程式和簡短的使用訊息。

- -
-

Note:--runapp 參數會有關閉螢幕鎖的副作用,且不會再度啟用螢幕鎖。這是假設您不會用這個指令加上 profile 來測試螢幕鎖,否則您會重新打開這個選項。如果這個行為會造成問題的話,也歡迎提供 patch 來改變這個它。

-
- -

Usage tips

- -

這一節提供一些在使用 B2G desktop client 時,有幫助的技巧。

- - - -

Next steps

- -

現在您有一個執行 Boot to Gecko 的 desktop 版本了,您可以在上面測試、開發以及做其他事情:

- - diff --git a/files/zh-tw/archive/b2g_os/using_the_b2g_emulators/index.html b/files/zh-tw/archive/b2g_os/using_the_b2g_emulators/index.html deleted file mode 100644 index 6dccacbe06..0000000000 --- a/files/zh-tw/archive/b2g_os/using_the_b2g_emulators/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: 使用 B2G 模擬器 -slug: Archive/B2G_OS/Using_the_B2G_emulators -translation_of: Archive/B2G_OS/Using_the_B2G_emulators ---- -

這篇文章提供簡潔的指南,包括使用 Boot to Gecko 模擬器時需要知道的一些重要的事情。這不意味著這是一個完整的使用手冊;相反地,它只告訴您一些有用的事情,讓您不必自己去學。

-

這篇指南假設您已經編譯了一個模擬器;如果您還沒編譯的話,請跳回「建置和安裝 Boot to Gecko」!

-

關於 B2G 模擬器

-

有兩種 B2G 模擬器。第一種是 x86 行動裝置的模擬器,使用 "emulator-x86" 設定以 config.sh 編譯而成。雖然這遠比模擬 ARM 處理器快多了,但是它執行的沒有那麼接近一個實體行動裝置的結果。而第二種則是 ARM 行動裝置的模擬器,使用 "emulator" 的設定編譯。

-

一旦你選擇、設定及編譯模擬器,就使用者而言,剩下來要做的事情都是一樣的,所以這篇導覽剩下的共同部分是兩種模擬器都適用的。

-
- Note: 在 Mac OS X 上,B2G 模擬器需要 Core 2 Duo 或更快 CPU;也就是說,一個相容於 Mac OS X 10.7 "Lion" 的系統。你不必一定得使用 Lion,只是要在和 Lion 相容的系統上面執行就可以了。
-

啟動模擬器

-

執行下列指令,就可以打開 B2G 模擬器了:

-
./run-emulator.sh
-
-

這個指令將會會您操作所有模擬器的起始作業。現在就耐心等模擬器啟動以及 Boot to Gecko 在上面開始運作起來。啟動會花好幾分鐘,所以請耐心等候。

-

當模擬器掛了

-

有時候模擬器會啟動失敗。歡迎來到尖端科技的前緣。這裡有一些派的上用場的技巧,可用來解決問題。

-

確定 adb server 是不是還活著

-

adb server 處理與模擬的行動裝置之間的互動,而這裡常常出問題的原因是 adb server 不是沒在執行就是故障。

-
-

Note: 舉例來說,如果您使用 B2G 版本所編譯出的 adb 的話,它的位置會在 $B2G/out/host/<platform>/bin 目錄裡。在 Mac 上的話,則是在 $B2G/out/host/darwin-x86/bin 目錄下。

-
-

使用下列指令來看 adb 是否還在運作中:

-
ps aux | grep adb
-
-

If it's there, do this to kill it, because it's probably not working correctly.

-
adb kill-server
-
-

If it's not there, do this:

-
adb start-server
-
-

接著試試看再執行模擬器一次看看。如果還是沒辦法運作的話, 就是時候到 irc.mozilla.org 使用 #b2g 搜尋尋求幫助了。

-

抹掉 configuration 設定值

-

有時候,在模擬的行動裝置上使用過期的設定檔的設定值也會讓它暴走。你可以砍掉 indexedDB 資料庫來解決這個問題,如下:

-
    -
  1. 確定 adb 在執行中,如同 Make sure the adb server is running 中所描述的一般。
  2. -
  3. 啟動模擬器。
  4. -
  5. 先打開電腦裡的 terminal,然後切換到編譯模擬器的主目錄 (root code build directory),接著打:「out/host/<platform>/bin/adb -e shell」;在 Mac 上使用「out/host/darwin-x86/bin/adb -e shell」。
  6. -
  7. 現在你已經在 adb 的 shell 裡面、且可以直接在模擬器的行動 裝置上執行 shell 指令 (commands)了。讓我們使用「stop b2g」來停止裝置上的 B2G。
  8. -
  9. 刪除 indexedDB 資料庫:rm -rf /data/local/indexedDB
  10. -
  11. 在模擬的行動裝置上重新啟動 B2G:start b2g
  12. -
-

希望此時您所打開 Gaia 介面一切都恢復正常。

-

設定模擬器

-

如果您想要調整模擬器更接近您想要模擬的裝置的話,有幾個選項可以改改看。這一節提供一些關於「如何調校」的基本資訊。您可以編輯 run-emulator.sh (觀念上還是複製一份來編輯)這個 script 來調校模擬器的設定。這裡指會討論到一些最常用到的參數;您可以 連到 qemu 網站 來看其他部分的細節。

-
- Tip: 您可以為每個想要模擬的裝置建立一個 run-emulator.sh 的複製版本;這會您比較容易以不同的設定啟動模擬器。
-

改變外觀

-

模擬器預設會以 HVGA 模式啟動;VGA 的一半、也就是 320x480 pixels 的外觀。在啟動時,我們可以給模擬器加上 -skin 的參數來指定外觀。您可以編輯 run-emulator.sh 來切換成不同的顯示模式來執行模擬器。可以使用的外觀列表如下:

- -

外觀的存放位置在 B2G/development/tools/emulator/skins 目錄。外觀的格式很簡單;如果您打開來看的話,他們只是一些資料夾,裝著一些使用者介面物件的 PNG 檔案以及一個描述使用者介面的配置及螢幕區域的文字檔 layout。如果需要建立客製化的外觀的話,是還蠻簡單的。

-

改變記憶體的大小

-

另一個您可能想要/需要改變的選項就是行動裝置的記憶體大小。預設是 512MB;然而,如果您要模擬的行動裝置的記憶體比較大或小的話,或許對您而言,將記憶體調整成一樣的大小是很重要的,這樣才能確定您的 app 會在您想要執行的基礎裝置上執行。您可以將 -memory 參數的數值修改成您需要的數字(以 MB 為單位),就可以改變執行時的記憶體大小。除了預設的 512MB 之外,您可能會想要以 256MB 和 1024MB 來做測試。

-

而如果想要改變模擬裝置的儲存容量大小的話 (就是 local 資料的儲存空間,像是行動電話的內建快閃記憶體或是電腦的硬碟),可以改變 -partition-size 參數的數值。預設是 512MB,但是您可以改成任何大小 (以 MB 為單位)來模擬想要測試的行動裝置。

-

網路連線

-

如果因為某些原因,您沒辦法將您的模擬器連上網際網路 (internet)的話,您可以從命令提示字元來執行下面的指令 (commandline):

-
adb shell setprop net.dns1 10.0.2.3
diff --git a/files/zh-tw/archive/b2g_os/web_telephony_api/index.html b/files/zh-tw/archive/b2g_os/web_telephony_api/index.html deleted file mode 100644 index c9e0c9516b..0000000000 --- a/files/zh-tw/archive/b2g_os/web_telephony_api/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Web Telephony -slug: Archive/B2G_OS/Web_Telephony_API -translation_of: Archive/B2G_OS/Web_Telephony_API ---- -

WebTelephony API 可透過 JavaScript 程式碼,讓網頁內容處理一般音訊電話。

-

透過 window.navigator.mozTelephony 即可存取此 API。另請參閱下列的完整介面列表:

-

DOM 介面

- -

範例程式碼與介紹

-
- -
-

另可參閱

- diff --git a/files/zh-tw/archive/b2g_os/writing_apps_for_boot_to_gecko/index.html b/files/zh-tw/archive/b2g_os/writing_apps_for_boot_to_gecko/index.html deleted file mode 100644 index a38efda16e..0000000000 --- a/files/zh-tw/archive/b2g_os/writing_apps_for_boot_to_gecko/index.html +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: 寫 Boot to Gecko 的 apps -slug: Archive/B2G_OS/Writing_apps_for_Boot_to_Gecko -translation_of: Archive/B2G_OS/Firefox_OS_apps/Building_apps_for_Firefox_OS ---- -

B2G apps 不外乎是安裝於 B2G 手機的 Open Web apps

- -
- Note: B2G 現在和 Fennec 用相同的 UA (User Agent) 來分辨。例如:"Mozilla/5.0 (Android; Mobile; rv:15.0) Gecko/15.0 Firefox/15.0a1".
diff --git a/files/zh-tw/archive/css3/index.html b/files/zh-tw/archive/css3/index.html deleted file mode 100644 index 85374e3a65..0000000000 --- a/files/zh-tw/archive/css3/index.html +++ /dev/null @@ -1,584 +0,0 @@ ---- -title: CSS3 -slug: Archive/CSS3 -translation_of: Archive/CSS3 ---- -

CSS3層疊樣式表語言的最新版且目標是為了延伸 CSS2.1。它有許多久違的新東西,像是圓角、陰影、漸層、或是動畫, 還有像是多列, 有彈性的盒子或是網格佈局之類的。 實驗的部分會有供應商前綴且應該在生產環境中盡可能地避免,使用那些未來可能會改變的語法或語義都要格外小心。

- -

模組及標準化程序

- -

CSS Level 2 需要 9 年(2002年八月~2011年六月),以達到建議的狀態。 This was due to the fact that a few secondary features hold back the whole specification. In order to accelerate the standardization of non-problematic features, the CSS Working Group of the W3C, in a decision referred as the Beijing doctrine , divided CSS in smaller components called modules . Each of these modules is now an independent part of the language and moves towards standardization at its own pace. While some modules are already W3C Recommendations, other still are early Working Drafts. New modules are also added when new needs are identified.

- -

CSS Modules and Snapshots as defined since CSS3 Formally, there is no CSS3 standard per se . Each module being standardized independently, the standard CSS consists of CSS2.1 amended and extended by the completed modules, not necessary all with the same level number. At each point of time, a snapshot of the CSS standard can be defined, listing CSS2.1 and the mature modules.

- -

The W3 consortium periodically publishes such snapshots, like in 2007 or 2010.

- -

Though today no module with a level greater than 3 is standardized, this will change in the future. Some modules, like Selectors 4 or CSS Borders and Backgrounds Level 4 already have an Editor's Draft, though they haven't yet reached the First Published Working Draft status.

- -

CSS 模組狀態

- -

穩定模組

- -

A few CSS modules are already fairly stable and have reached one of the three recommendation level of the CSSWG: Candidate Recommendation, Proposed Recommendation or Recommendation. These can be used without prefixed and are pretty stable, though a few features can still be dropped at the Candidate Recommendation stage.

- -

These modules extend and amend the CSS2.1 specification which build the core of the specification. Together with it, they are the current snapshot of the CSS specification.

- - - - - - - - - - - -
{{ SpecName("CSS3 Colors", "", "") }}{{ Spec2("CSS3 Colors") }}  自 2011 年 6 月 7 號起
-

增加 {{ cssxref("opacity") }} 屬性,還有 hsl(), hsla(), rgba() 和 rgb() 函式來創造 {{cssxref("<color>")}} 值。它也定義了關鍵字 currentColor 唯有效的顏色。

- -

現在透明色是一個真實的顏色(因為支援了 alpha 通道)。若想要使用透明度,請使用 rgba(0,0,0,0.0)

- -

關鍵字 system-color 不應該繼續使用,因為他已經被棄用。

-
- - - - - - - - - - - -
{{ SpecName("CSS3 Selectors", "", "") }}{{ Spec2("CSS3 Selectors") }} 自 2011 年 9 月 29 號起
-

Adds:

- -
    -
  • Substring matching attribute selectors, E[attribute^="value"] , E[attribute$="value"] , E[attribute*="value"] .
  • -
  • New pseudo-classes: {{ cssxref(":target") }}, {{ cssxref(":enabled") }} and {{ cssxref(":disabled") }}, {{ cssxref(":checked") }}, {{ cssxref(":indeterminate") }}, {{ cssxref(":root") }}, {{ cssxref(":nth-child") }} and {{ cssxref(":nth-last-child") }}, {{ cssxref(":nth-of-type") }} and {{ cssxref(":nth-last-of-type") }}, {{ cssxref(":last-child") }}, {{ cssxref(":first-of-type") }} and {{ cssxref(":last-of-type") }}, {{ cssxref(":only-child") }} and {{ cssxref(":only-of-type") }},{{ cssxref(":empty") }}, and {{ cssxref(":not") }}.
  • -
  • Pseudo-elements are now characterized by two colons rather then one: :after becomes {{ cssxref("::after") }}, :before becomes {{ cssxref("::before") }}, :first-letter becomes {{ cssxref("::first-letter") }}, and :first-line becomes {{ cssxref("::first-line") }}.
  • -
  • The new general sibling combinator ( h1~pre ).
  • -
-
- -

The next iteration of the Selectors specification is already in progress, though it still hasn't reached the First Public Working Draft stage.

- - - - - - - - - - - -
{{ SpecName("CSS3 Namespaces", "", "") }} -

{{ Spec2("CSS3 Namespaces") }} 自 2011 年 9 月 29 日起

-
-

Adds the support for the XML Namespaces by defining the notion of CSS qualified name , using the ' | ' syntax and adding the {{ cssxref("@namespace") }} CSS at-rule.

-
- - - - - - - - - - - -
{{ SpecName("CSS3 Media Queries", "", "") }}{{ Spec2("CSS3 Media Queries") }} 自 2012 年 6 月 19 日起
-

Extends the former media type ( print, screen, ) to a full language allowing queries on the device media capabilities like only screen and (color) .

- -

Media queries are not only used in CSS document but also in some attributes of HTML Elements, like the {{ htmlattrxref("media","link") }} attribute of the {{ HTMLElement("link") }} element.

-
- -

The next iteration of this specification is in the work, allowing to tailor a Web site regarding the input methods available on the user agent, with new media features like hover or pointer. Detection of EcmaScript support, using the script media features is also proposed.

- - - - - - - - - - - -
{{ SpecName("CSS3 Style", "", "") }}{{ Spec2("CSS3 Style") }} 自 2013 年 11 月 7 日起
Formally defines the syntax of the content of the HTML style global attribute.
- - - - - - - - - - - -
{{ SpecName("CSS3 Backgrounds", "", "") }}{{ Spec2("CSS3 Backgrounds") }}
-

Adds:

- -
    -
  • Support, on backgrounds, for any type of {{cssxref("<image>")}}, and not only for uri() defined ones.
  • -
  • Support for multiple background images.
  • -
  • The {{ cssxref("background-repeat") }} space and round values, and for the 2-value syntax of this CSS property.
  • -
  • The {{ cssxref("background-attachment") }} local value.
  • -
  • The CSS {{ cssxref("background-origin") }}, {{ cssxref("background-size") }}, and {{ cssxref("background-clip") }} properties.
  • -
  • Support for curved border corners, with the CSS {{ cssxref("border-radius") }}, {{ cssxref("border-top-left-radius") }}, {{ cssxref("border-top-right-radius") }}, {{ cssxref("border-bottom-left-radius") }}, and {{ cssxref("border-bottom-right-radius") }} properties.
  • -
  • Support for the use of an {{cssxref("<image>")}} as the border with the CSS {{ cssxref("border-image") }}, {{ cssxref("border-image-source") }}, {{ cssxref("border-image-slice") }}, {{ cssxref("border-image-width") }}, {{ cssxref("border-image-outset") }}, and {{ cssxref("border-image-repeat") }} properties.
  • -
  • Support for shadows of the element with the CSS {{ cssxref("box-shadow") }} property.
  • -
-
- -

The CSS4 iteration of the Backgrounds and Borders specification is already in progress, though it still hasn't reached the First Public Working Draft stage, it plans to add the ability to clip a border (with the CSS {{ cssxref("border-clip") }}, {{ cssxref("border-clip-top") }}, {{ cssxref("border-clip-right") }}, {{ cssxref("border-clip-bottom") }}, and {{ cssxref("border-clip-left") }} properties) or to control the shape of the border in a corner (using the CSS {{ cssxref("border-corner-shape") }} property).

- - - - - - - - - - - -
{{ SpecName("CSS3 Multicol", "", "") }}{{ Spec2("CSS3 Multicol") }}
Adds support for easy multi-column layouts using the CSS {{ cssxref("columns") }}, {{ cssxref("column-count") }}, {{ cssxref("column-fill") }}, {{ cssxref("column-gap") }}, {{ cssxref("column-rule") }}, {{ cssxref("column-rule-color") }}, {{ cssxref("column-rule-style") }}, {{ cssxref("column-rule-width") }}, {{ cssxref("column-span") }}, {{ cssxref("column-width") }}, {{ cssxref("break-after") }}, {{ cssxref("break-before") }}, and {{ cssxref("break-inside") }}.
- - - - - - - - - - - -
{{ SpecName("CSS3 Speech", "", "") }}{{ Spec2("CSS3 Speech") }}
Defines the speech media type, an aural formatting model and numerous properties specific for speech-rendering user agents.
- - - - - - - - - - - -
{{ SpecName("CSS3 Images", "", "") }}{{ Spec2("CSS3 Images") }}
-

Defines the {{cssxref("<image>")}} data type.

- -

Extends the url() syntax to support image slices using media fragments.

- -

Adds:

- -
    -
  • The dppx unit to the {{cssxref("<resolution>")}} data type.
  • -
  • The image() function as a more flexible alternative to url() to define an image from an url.
    - At risk : due to insufficient browser support, standardization of the image() function may be postponed to the next iteration of this module .
  • -
  • Support for linear-gradient(), repeating-linear-gradient(), radial-gradient() and repeating-radial-gradient().
  • -
  • The ability to define how a replaced element should fit in its element, using the CSS {{ cssxref("object-fit") }} property.
    - At risk : due to insufficient browser support, standardization of the {{ cssxref("object-fit") }} and property may be postponed to the next iteration of this module .
  • -
  • The ability to override the resolution and orientation of an external image using the CSS {{ cssxref("image-resolution") }} and {{ cssxref("image-orientation") }} properties.
    - At risk : due to insufficient browser support, standardization of the {{ cssxref("image-resolution") }} and {{ cssxref("image-orientation") }} properties may be postponed to the next iteration of this module .
  • -
-
- -

The CSS Image Values and Replaced Content Level 4 which will supersede CSS Image Level 3 is in development and is a {{Spec2("CSS4 Images")}}.

- - - - - - - - - - - -
{{ SpecName("CSS3 Values", "", "") }}{{ Spec2("CSS3 Values") }}
-

Makes initial and inherit keywords usable on any CSS property.

- -

Formally defines the CSS data types of CSS 2.1, that were implicitely defined by their grammar token and some textual precisions.

- -

Adds:

- -
    -
  • Definition for new font-relative length units: rem and ch .
  • -
  • Definition for viewport-relative length units: vw, vh, vmax, and vmin .
  • -
  • Precision about the real size of the absolute length units, which are not really absolute, but defined in relation with the reference pixel .
  • -
  • Definition for {{ cssxref("<angle>") }}, {{cssxref("<time>")}}, {{cssxref("<frequency>")}}, {{cssxref("<resolution>")}}.
  • -
  • Normative value to the definition of {{cssxref("<color>")}}, {{cssxref("<image>")}}, and {{ cssxref("<position>") }}.
  • -
  • Definition for the {{ cssxref("calc", "calc()") }}, {{ cssxref("attr", "attr()")}}, and toggle() functional notations.
    - At risk: due to insufficient browser support, standardization of the calc(), attr(), and toggle() functional notations may be postponed to the next iteration of this module.
  • -
-
- -

Several types definition, like <ident> and <custom-ident>, have been deferred to CSS Values and Units Module Level 4.

- - - - - - - - - - - -
{{ SpecName("CSS3 Flexbox", "", "") }}{{ Spec2("CSS3 Flexbox") }}
Add a flexbox layout to the CSS {{ cssxref("display") }} property and several new CSS properties to control it: {{ cssxref("flex") }}, {{ cssxref("flex-align") }}, {{ cssxref("flex-direction") }}, {{ cssxref("flex-flow") }}, {{ cssxref("flex-item-align") }}, {{ cssxref("flex-line-pack") }}, {{ cssxref("flex-order") }}, {{ cssxref("flex-pack") }}, and {{ cssxref("flex-wrap") }}.
- - - - - - - - - - - -
{{ SpecName("CSS3 Conditional", "", "") }}{{ Spec2("CSS3 Conditional") }}
Adds features for conditional processing of parts of style sheets, conditioned on capabilities of the browser or the document the style sheet is being applied to. It consists mainly in allowing nested at-rules inside {{ cssxref("@media") }} and the adding of a new CSS at-rule, {{ cssxref("@supports") }}, and a new DOM method {{domxref("CSS.supports()")}}.
- - - - - - - - - - - -
{{ SpecName("CSS3 Text-decoration", "", "") }}{{ Spec2("CSS3 Text-decoration") }}
-

Extends:

- -
    -
  • the CSS {{ cssxref("text-decoration") }} property by making it a shorthand for the CSS {{ cssxref("text-decoration-line") }}, {{ cssxref("text-decoration-color") }}, and {{ cssxref("text-decoration-style") }} properties. And adds the {{ cssxref("text-decoration-skip") }}, and {{ cssxref("text-underline-position") }} properties.
  • -
- -

Adds:

- -
    -
  • Support for East-Asian-script emphasis marks with the CSS {{ cssxref("text-emphasis") }}, {{ cssxref("text-emphasis-style") }}, {{ cssxref("text-emphasis-color") }}, and {{ cssxref("text-emphasis-position") }} properties.
  • -
  • Support for script shadows with the CSS {{ cssxref("text-shadow") }} property.
  • -
- -

Precises:

- -
    -
  • The paint order of the decorations.
  • -
- -

At risk: due to insufficient browser support, standardization of the text-decoration-skip, line positioning rules and the ability to place both emphasis marks and ruby above the same base text may be postponed to the next iteration of this module.

-
- - - - - - - - - - - -
{{ SpecName("CSS3 Fonts", "", "") }}{{ Spec2("CSS3 Fonts") }}
-

Amends the CSS2.1 Font matching algorithm to be closer to what is really implemented.

- -

Adds:

- -
    -
  • Support for downloadable fonts via the CSS {{ cssxref("@font-face") }} at-rule.
  • -
  • The control of the contextual inter-glyph spacing via the CSS {{ cssxref("font-kerning") }} property.
  • -
  • The choice of language-specific glyphs via the CSS {{ cssxref("font-language-override") }} property.
  • -
  • The choice of glyphs with specific OpenType features via the CSS {{ cssxref("font-feature-settings") }} property.
  • -
  • The control of the aspect ratio to use when fallback fonts are selected via the CSS {{ cssxref("font-size-adjust") }} property.
  • -
  • The choice of alternative font faces using the CSS {{ cssxref("font-stretch") }}, {{ cssxref("font-variant-alternates") }}, {{ cssxref("font-variant-caps") }}, {{ cssxref("font-variant-east-asian") }}, {{ cssxref("font-variant-ligatures") }}, {{ cssxref("font-variant-numeric") }}, and {{ cssxref("font-variant-position") }} properties. It also extends the related CSS {{ cssxref("font-variant") }} shorthand property and introduces the {{ cssxref("@font-features-values") }} at-rule.
  • -
  • The control of the automatic generation of an oblique or bold face when none are found via the CSS {{ cssxref("font-synthesis") }} property.
  • -
-
- - - - - - - - - - - -
{{ SpecName("CSS3 Syntax", "", "") }}{{ Spec2("CSS3 Syntax") }}
Precises how charsets are determined; minor changes in parsing and tokenization algorithms.
- -

Modules in the refining phase

- -

Specifications that are deemed to be in the refining phase are already fairly stable. Though changes are still expected, they shouldn't create incompatibilities with current implementations; they should mainly define behavior in edge cases.

- - - - - - - - - - - -
{{ SpecName("CSS3 Basic UI", "", "") }}{{ Spec2("CSS3 Basic UI") }}
-

Adds:

- -
    -
  • The ability to tweak the box model using the CSS {{ cssxref("box-sizing") }} property.
    - At risk: due to insufficient browser support, standardization of the padding-box value may be postponed to the next iteration of this module .
  • -
  • Allow the styling of forms according their content using the CSS {{ cssxref(":indeterminate") }}, {{ cssxref(":default") }}, {{ cssxref(":valid") }}, {{ cssxref(":invalid") }}, {{ cssxref(":in-range") }}, {{ cssxref(":out-of-range") }}, {{ cssxref(":required") }}, {{ cssxref(":optional") }}, {{ cssxref(":read-only") }}, and {{ cssxref(":read-write") }} pseudo-classes and the {{ cssxref("::value") }}, {{ cssxref("::choices") }}, {{ cssxref("::repeat-item") }}, and {{ cssxref("::repeat-index") }} pseudo-elements.
    - At risk: due to insufficient browser support, standardization of the pseudo-elements {{ cssxref("::value") }}, {{ cssxref("::choices") }}, {{ cssxref("::repeat-item") }}, and {{ cssxref("::repeat-index") }} may be postponed to the next iteration of this module .
  • -
  • Support for icons, defined by the CSS {{ cssxref("icon") }} property simultaneously with the new icon value of the CSS {{ cssxref("content") }} property.
    - At risk: due to insufficient browser support, standardization of the {{ cssxref("icon") }} property and the icon value may be postponed to CSS4.
  • -
  • Support for the CSS {{ cssxref("outline-offset") }} property giving more control on the position of the outline.
  • -
  • Support for the CSS {{ cssxref("resize") }} property allowing Web authors to control if and how elements should be resized.
  • -
  • Support for the CSS {{ cssxref("text-overflow") }} property defining how text overflows, if needed.
    - At risk: due to insufficient browser support, the 2-value syntax of this property as well as the support for {{cssxref("<string>")}} values may be postponed to the next iteration of this module .
  • -
  • The ability to define the hotspot of a cursor as well as the new none, context-menu, cell, vertical-text, alias, copy, no-drop, not-allowed, nesw-resize, nwse-resize, col-resize, row-resize, all-scroll, zoom-in, zoom-out, extending the {{ cssxref("cursor") }} property.
  • -
  • The ability to specify the sequential navigation order (that is the tabbing order ) using the CSS {{ cssxref("nav-index") }}, {{ cssxref("nav-up") }}, {{ cssxref("nav-right") }}, {{ cssxref("nav-left") }}, {{ cssxref("nav-down") }} properties.
    - At risk: due to insufficient browser support, standardization of the navigation properties may be postponed to the next iteration of this module .
  • -
  • The ability to control the usage of an IME editor, using the CSS {{ cssxref("ime-mode") }} property.
    - At risk: due to insufficient browser support, standardization of the {{ cssxref("ime-mode") }} property may be postponed to the next iteration of this module .
  • -
-
- -

An early list of what could be in the next iteration of the CSS Basic User Interface Module is available.

- - - - - - - - - - - -
{{ SpecName("CSS3 Transitions", "", "") }}{{ Spec2("CSS3 Transitions") }}
Allows the definition of transitions effects between two properties values by adding the CSS {{ cssxref("transition") }}, {{ cssxref("transition-delay") }}, {{ cssxref("transition-duration") }}, {{ cssxref("transition-property") }}, and {{ cssxref("transition-timing-function") }} properties.
- - - - - - - - - - - -
{{ SpecName("CSS3 Animations", "", "") }}{{ Spec2("CSS3 Animations") }}
Allows the definition of animations effects by adding the CSS {{ cssxref("animation") }}, {{ cssxref("animation-delay") }},{{ cssxref("animation-direction") }}, {{ cssxref("animation-duration") }}, {{ cssxref("animation-fill-mode") }}, {{ cssxref("animation-iteration-count") }}, {{ cssxref("animation-name") }}, {{ cssxref("animation-play-state") }}, and {{ cssxref("animation-timing-function") }} properties, as well as the {{ cssxref("@keyframes") }} at-rule.
- - - - - - - - - - - -
{{ SpecName("CSS3 Transforms", "", "") }}{{ Spec2("CSS3 Transforms") }}
-

Adds:

- -
    -
  • the support of bi-dimensional transforms to be applied to any element using the CSS {{ cssxref("transform") }} and {{ cssxref("transform-origin") }} properties. The supported transforms are: matrix(), translate(), translateX(), translateY(), scale(), scaleX(), scaleY(), rotate(), skewX(), and skewY().
  • -
  • the support of tri-dimensional transforms to be applied to any element by adding the CSS {{ cssxref("transform-style") }}, {{ cssxref("perspective") }}, {{ cssxref("perspective-origin") }}, and {{ cssxref("backface-visibility") }} properties and extended the {{ cssxref("transform") }} property with the following transforms are: matrix 3d(), translate3d(), translateZ()scale3d(), scaleZ(), rotate3d(), rotateX() ,rotateY(), rotateZ(), and perspective().
  • -
- -

Note: this specification is a merge of CSS 2D-Transforms, CSS 3D-Transforms and SVG transforms.

-
- - - - - - - - - - - -
{{ SpecName("CSS3 Fragmentation", "", "") }}{{ Spec2("CSS3 Fragmentation") }}
Defines how partitions of a Web page should happen, that is page, column breaks, and widows and orphans handling. -

Adds:

- -
    -
  • Support for defining the behavior of decorations, that is borders and background colors or images, when a box is breaked (at a page, column or line-break) with the CSS {{ cssxref("box-decoration-break") }} property.
  • -
-
- - - - - - - - - - - -
{{ SpecName("CSS3 Text", "", "") }}{{ Spec2("CSS3 Text") }}
-

Extends:

- -
    -
  • the CSS {{ cssxref("text-transform") }} property with the value full-width.
  • -
  • the CSS {{ cssxref("text-align") }} property with the value start, end, start end, and match-parent for a better support of documents with multiple directionalities of text.
  • -
  • the CSS {{ cssxref("text-align") }} property with a {{cssxref("<string>")}} value to align on that character. This is useful to align number on the decimal point.
  • -
  • the CSS {{ cssxref("word-spacing") }} and {{ cssxref("letter-spacing") }} properties with range constraints to control flexibility in justification.
  • -
- -

Adds:

- -
    -
  • Control on how whitespaces are displayed using the CSS {{ cssxref("text-space-collapse") }} and {{ cssxref("tab-size") }} properties.
  • -
  • Control on line breaks and word boundaries using the CSS {{ cssxref("line-break") }}, {{ cssxref("word-break") }}, {{ cssxref("hyphens") }}, {{ cssxref("text-wrap") }}, {{ cssxref("overflow-wrap") }}, and {{ cssxref("text-align-last") }} properties.
  • -
  • Control on how justification is happening, in order to support more type of scripts, using the CSS {{ cssxref("text-justify") }} property.
  • -
  • Control on edge effect using the CSS {{ cssxref("text-indent") }} and {{ cssxref("hanging-punctuation") }} properties.
  • -
-
- -

A few features present in early CSS Text Level 3 draft have being postponed to the next iteration of this module .

- - - - - - - - - - - -
{{ SpecName("CSS3 Variables", "", "") }}{{ Spec2("CSS3 Variables") }}
Defines a mechanism allowing to define variables in CSS.
- -

Modules in the revising phase

- -

Modules that are in the revising phase are much less stable than those in the refining phase. Often the syntax is still under scrutiny and may evolve a lot, in a non-compatible way. Alternative syntax are tested and often implemented.

- - - - - - - - - - - -
{{ SpecName("CSS3 Writing Modes", "", "") }}{{ Spec2("CSS3 Writing Modes") }}
Defines the writing modes of both horizontal and vertical scripts and precises how the CSS {{ cssxref("direction") }} and {{ cssxref("unicode-bidi") }} properties interact with the new CSS {{ cssxref("text-orientation") }} property, and extends them where needed.
- -

Modules in the exploring phase

- - - - - - - - - - - -
{{ SpecName("CSS4 Images", "", "") }}{{ Spec2("CSS4 Images") }}
-

Extends:

- -
    -
  • the image() functional notation to describe the directionality of the image (rtl or ltr), allowing for bidi-sensitive images.
  • -
  • the {{ cssxref("image-orientation") }} property by adding the keyword from-image, allowing to follow EXIF data stored into images to be considered.
  • -
- -

Adds:

- -
    -
  • the image-set() functional notation to allow the definition to equivalent images at different resolution allowing for resolution-negotiated selection of images.
  • -
  • the element() functional notation allowing the use of part of the page as image.
  • -
  • the cross-fade() functional notation allowing to refer to intermediate images when transitioning between two images and defines the interpolation between two images.
  • -
  • the conic-gradient() and repeating-conic-gradient() functional notation describing a new type of gradient.
  • -
  • the {{cssxref("image-rendering")}} property that allow to define how resize of the object should be handled.
  • -
-
- - - - - - - - - - - -
{{ SpecName("CSS3 Device", "", "") }}{{ Spec2("CSS3 Device") }}
Adds a new at-rule, {{ cssxref("@viewport") }}, allowing to specify the size, zoom factor, and orientation of the viewport that is used as the base for the initial containing block.
- - - - - - - - - - - -
{{ SpecName("CSS3 Grid", "", "") }}{{ Spec2("CSS3 Grid") }}
Add a grid layout to the CSS display property and several new CSS properties to control it: {{cssxref("grid")}}, {{cssxref("grid-area")}}, {{cssxref("grid-auto-columns")}}, {{cssxref("grid-auto-flow")}}, {{cssxref("grid-auto-position")}}, {{cssxref("grid-auto-rows")}}, {{cssxref("grid-column")}}, {{cssxref("grid-column-start")}}, {{cssxref("grid-column-end")}}, {{cssxref("grid-row")}}, {{cssxref("grid-row-start")}}, {{cssxref("grid-row-end")}}, {{cssxref("grid-template")}}, {{cssxref("grid-template-areas")}}, {{cssxref("grid-template-rows")}}, and {{cssxref("grid-template-columns")}}.
- - - - - - - - - - - -
{{ SpecName("CSS3 GCPM", "", "") }}{{ Spec2("CSS3 GCPM") }}
Adds the ability to tailor printed version of a document by allowing to control header, footer but also references tables like indexes or tables of content.
- - - - - - - - - - - -
{{ SpecName("CSS3 Exclusions and Shapes", "", "") }}{{ Spec2("CSS3 Exclusions and Shapes") }}
Extends the floats mechanism to define exclusion regions in any positioning scheme. Adds the notion of shapes, in which content must flows.
- - - - - - - - - - - -
{{ SpecName("CSS3 Lists", "", "") }}{{ Spec2("CSS3 Lists") }}
Extends the list counter mechanism so that list markers can be styled and Web developers can define new list counter schemes.
- - - - - - - - - - - -
{{ SpecName("CSS3 Regions", "", "") }}{{ Spec2("CSS3 Regions") }}
Defines a new mechanism allowing content to flow across, eventually non-contiguous, multiple areas called regions.
- -

 

diff --git a/files/zh-tw/archive/index.html b/files/zh-tw/archive/index.html deleted file mode 100644 index 6766a22f6e..0000000000 --- a/files/zh-tw/archive/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: 過時內容的存檔 -slug: Archive -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive ---- -

在 MDN,我們盡量避免直接刪除內容,因為那些內容可能對要找出遺留平台、作業系統、瀏覽器相關資料的人而言很有用:也許你的目標人群在用很老舊的硬體、使他們的瀏覽器無法升級到最新版本;或著因為某些「原因」,你的公司要用非常老舊的軟體、而你建置的網路內容需要在那個軟體上運行;也可能是你對過時的功能或 API 歷史與運行方法感到興趣。

- -

出於很多原因,老文件非常有用。因此,我們開闢了這個地方,用以保存老文件。這裡的內容不該用作建置面向現代瀏覽器的新網站或 apps 參考。這裡存在的目的,只有作為歷史參考。

- -
-

給編者的筆記:我們要盡可能維持子頁面的組織化、而不該把所有東西都丟到一個大資料夾。試著給內容歸類。另外,只把非常老舊的內容移到這裡。若可能有人切實需要還在使用的軟體資訊,就不該移這裡。在你把任何內容移動到這裡以前,最好在 MDN Web Docs 頻道討論。

-
- -

{{SubpagesWithSummaries}}

- -

子頁面

- -

{{ListSubpages("/zh-TW/docs/Archive", 2, 0, 1)}}

diff --git a/files/zh-tw/archive/mdn/index.html b/files/zh-tw/archive/mdn/index.html deleted file mode 100644 index f99cd4e169..0000000000 --- a/files/zh-tw/archive/mdn/index.html +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: MDN Archive -slug: Archive/MDN -tags: - - Archive - - MDN -translation_of: Archive/MDN ---- -

{{MDNSidebar}}

- -
-

Obsolete
- 此文件已過時。

-
- -

The documentation listed below is archived, obsolete material about MDN itself.

- -

{{LandingPageListSubpages}}

diff --git a/files/zh-tw/archive/mdn/persona_sign-ins/index.html b/files/zh-tw/archive/mdn/persona_sign-ins/index.html deleted file mode 100644 index 7c65870878..0000000000 --- a/files/zh-tw/archive/mdn/persona_sign-ins/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: MDN and Persona sign-ins -slug: Archive/MDN/Persona_sign-ins -tags: - - '3081911' -translation_of: Archive/MDN/Persona_sign-ins ---- -
{{MDNSidebar}}
-

Please link your GitHub account to your MDN profile now so you can continue to sign in to MDN.

-
- -

Currently, MDN lets contributors sign in using two different authentication providers: Mozilla Persona and GitHub. Starting on November 1, 2016, we will remove Persona as an option for logging in. Therefore, you must enable Github authentication on your profile to avoid losing login access to MDN.

- -

We recognize that this is an inconvenience, and we do apologize for it. Unfortunately, this is out of our control.

- -

Why is Persona being removed?

- -

Mozilla has shut down the Persona project, and its servers will be turned off in November, 2016. You can learn more about Mozilla's decision to shut down Persona on the Mozilla wiki.

- -

When will Persona be removed?

- -

We will disable Persona as an authentication provider on November 1, 2016; in other words, the last day you'll be able to sign in to MDN using Persona will be October 31, 2016. We will be issuing increasingly frequent and increasingly urgent notifications to add a GitHub account to your MDN profile starting now. Please do this as soon as you can, in order to avoid any risk of losing access to your MDN account.

- -

Will MDN offer another authentication provider?

- -

We would very much like to do so, but have not yet identified another provider which meets our requirements; in addition, we don't currently have the developer resources to integrate another provider. For the time being, your only option to keep contributor access to MDN is to link your MDN profile to your GitHub account.

- -

Keep in mind, of course, that you don't need to sign in to MDN in order to read our content. But if you have an account for contributing, and wish to be able to contribute at any time in the future, be sure to add a GitHub account to your profile as soon as you can, before October 31, 2016.

diff --git a/files/zh-tw/archive/meta_docs/custom_classes/index.html b/files/zh-tw/archive/meta_docs/custom_classes/index.html deleted file mode 100644 index 0aa624f2fd..0000000000 --- a/files/zh-tw/archive/meta_docs/custom_classes/index.html +++ /dev/null @@ -1,189 +0,0 @@ ---- -title: 自訂 CSS 類別 -slug: Archive/Meta_docs/Custom_classes -tags: - - MDC_專案 -translation_of: Archive/Meta_docs/Custom_classes ---- -

 以下是 MDC Wiki 上自行定義的樣式類別,若你也想新增類別,請聯絡 Dria

- -

現有 CSS 類別

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
樣式使用結果
div.tip顯示網頁內容中的小技巧文字。
div.bug顯示網頁內容中的程式錯誤文字。
.float-left製作向左浮動的元素(通常是圖片)。
.float-right製作向右浮動的元素(通常是圖片)。
.figure這個樣式目前還沒有實際作用,是為日後使用準備的。
.standard-table標準的表格樣式。
.standard-table td.header標準表格的標題樣式。
.fullwidth-table寬度設定為 100% 的表格(就像現在這個表格一樣)。
.fullwidth-table td.header寬度設為 100% 之表格的標題樣式。
div.breadcrumbs頁面導覽的樣式。
div.breadcrumbs a.breadcrumbs頁面導覽字串中連結部分的樣式。
div.breadcrumbs span.breadcrumbs頁面導覽字串中目前頁面標題的樣式。
div.side-note-left div.side-note-right用以建立文章內的邊欄。此區域之寬度將佔其母元素(通常就是文件本體)的 50%。若要建立邊欄請使用這個樣式,以確保內容顯示上容易閱讀。
div.highlight在區段左側放上 3 個像素寬的藍色邊框。/td>
.highlightred將文字改以紅色顯示。
.highlightblue將文字改以藍色顯示。
.highlightgreen將文字改以綠色顯示。
- -

範例

- -

標示部分程式碼

- -

通常我們會讓程式碼以特別的區塊顯示,這可以利用 span 搭配 MediaWiki 系統「行前空一格就自動縮排」的功能。須注意的是在 <pre> 區段中不能用 span 元素,因為此時 MediaWiki 會直接把 span 元素當成要顯示的內容而輸出。

- -
<span class="highlightred">這樣是沒用的</span>
-
- -

這種狀況下就應該將程式碼縮排,然後在其中使用 span 元素。如果程式中有空白行,該行也必須縮排,否則系統會認為空白行的前後為分開的兩個區段。

- -
像這樣,
-   程式碼的空白行並沒有縮排,
-
- -
   所以就顯示成兩個區段了。
-
- -

顯然這樣跟我們想要的有所差異,所以你應該這麼做:

- -
像這樣,
-   空白行前也加了個空白字元以示縮排,
-
-   這樣系統就將其顯示為同一個區段。
-
- -

導覽

- -

 

- - - -

table.standard-table

- -

<tr> <td>此為</td> <td>table.standard-table</td> <td>的範例</td> </tr> </table>

- -

table.fullwidth-table

- - - - - - - -
表格標題 1</td> -

<th>表格標題 2</td> <th>表格標題 3</td>

-
- -

<tr> <td>此為</td> <td>table.fullwidth-table</td> <td>的範例</td> </tr> </table>

- -

DIV 區段

- -
小技巧
- -

小技巧區段以 div class="note" 標示,例如:

- -
這就是個小技巧
- -
程式錯誤
- -

已知的程式錯誤可用 div class="bug" 標示參照,內含 bugzilla 上的對應資訊連結,例如:

- -
Bug 176320:彈出視窗 innerWidth 及 innerHeight 的最小值
- -
警告
- -

請使用 div class="warning" 來標示文件中的警告文字,很快我們會為此樣式加上圖示等特殊效果。

- -
此段為警告文字
- -
注釋
- -

請使用 div class="note" 來標示文件中的注釋文字。

- -
這是注釋,雖然沒什麼意思但還是個注釋。
- -
標示區段
- -

以下為 div class="highlight" 的範例:

- -
-

此為以 CSS 標示區段的範例,您可用這個方法讓某個程式碼區段更加顯眼。這個樣式最先是為 XUL 教學而加進 MDC 的。

- -
而這是
-   標示之區段中
-   文字預先格式化的
-      範例
-
-
- - - - - - - -
表格標題 1</td> -

<th>表格標題 2</td> <th>表格標題 3</td>

-
diff --git a/files/zh-tw/archive/meta_docs/index.html b/files/zh-tw/archive/meta_docs/index.html deleted file mode 100644 index 52de2c8447..0000000000 --- a/files/zh-tw/archive/meta_docs/index.html +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: MDN "meta-documentation" archive -slug: Archive/Meta_docs -tags: - - Archive - - MDN - - NeedsTranslation - - TopicStub -translation_of: Archive/Meta_docs ---- -

Here you'll find archived "meta-documentation"; that is, documentation about how to write documentation on MDN. The articles here are obsolete and should no longer be referenced; we are retaining them here for reference while we migrate some content to new places, but very little of this is useful.

-

{{LandingPageListSubpages}}

diff --git a/files/zh-tw/archive/misc_top_level/creating_a_web_based_tone_generator/index.html b/files/zh-tw/archive/misc_top_level/creating_a_web_based_tone_generator/index.html deleted file mode 100644 index 590a003de0..0000000000 --- a/files/zh-tw/archive/misc_top_level/creating_a_web_based_tone_generator/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: 製作一個 Web 上的音調產生器 -slug: Archive/Misc_top_level/Creating_a_Web_based_tone_generator -translation_of: Archive/Misc_top_level/Creating_a_Web_based_tone_generator ---- -

這是一個簡單的音調產生器的範例。requestSoundData() 是產生音頻樣本的函式,這個函式在經過某個特定的時間間隔會透過 setInterval() 被呼叫。mozWriteAudio() 是在被呼叫時,把樣本寫入音頻串流的函式。為了確保總是有可以播放的樣本,這個範例設置了一個 500 ms 的緩衝。mozCurrentSampleOffset() 是一個用來知道正在被播放的樣本所在位置的函式,這的函式被這個範例用來確保我們填進緩衝的總是正在被播放後的 500 ms。

-
<!DOCTYPE html>
-<html>
-  <head>
-    <title>JavaScript 音頻寫入範例</title>
-  </head>
-  <body>
-    <input type="text" size="4" id="freq" value="440"><label for="hz">Hz</label>
-    <button onclick="start()">play</button>
-    <button onclick="stop()">stop</button>
-
-    <script type="text/javascript">
-      function AudioDataDestination(sampleRate, readFn) {
-        // 音頻輸出的初使化
-        var audio = new Audio();
-        audio.mozSetup(1, sampleRate);
-
-        var currentWritePosition = 0;
-        var prebufferSize = sampleRate / 2; // 緩衝 500ms
-        var tail = null;
-
-        // 這個函數會被定期呼叫以填充音頻輸出緩衝
-        setInterval(function() {
-          var written;
-          // 看看之前也沒有留下未被寫入的資料
-          if(tail) {
-            written = audio.mozWriteAudio(tail);
-            currentWritePosition += written;
-            if(written < tail.length) {
-              // 並非所有資料都被寫入了,把剩下的存下來...
-              tail = tail.slice(written);
-              return; // ... 並結束這個函式
-            }
-            tail = null;
-          }
-
-          // 看看是不是有需要再加新資料至音頻輸出
-          var currentPosition = audio.mozCurrentSampleOffset();
-          var available = currentPosition + prebufferSize - currentWritePosition;
-          if(available > 0) {
-            // 從回撥函式(callback)要一些音效資料
-            var soundData = new Float32Array(parseFloat(available));
-            readFn(soundData);
-
-            // 寫這些資料
-            written = audio.mozWriteAudio(soundData);
-            if(written < soundData.length) {
-              // 不是所有資料都被寫入了,存下剩下的部份。
-              tail = soundData.slice(written);
-            }
-            currentWritePosition += written;
-          }
-        }, 100);
-      }
-
-      // 控制並製造聲音
-
-      var frequency = 0, currentSoundSample;
-      var sampleRate = 44100;
-
-      function requestSoundData(soundData) {
-        if (!frequency) {
-          return; // 已被靜音
-        }
-
-        var k = 2* Math.PI * frequency / sampleRate;
-        for (var i=0, size=soundData.length; i<size; i++) {
-          soundData[i] = Math.sin(k * currentSoundSample++);
-        }
-      }
-
-      var audioDestination = new AudioDataDestination(sampleRate, requestSoundData);
-
-      function start() {
-        currentSoundSample = 0;
-        frequency = parseFloat(document.getElementById("freq").value);
-      }
-
-      function stop() {
-        frequency = 0;
-      }
-  </script>
-  </body>
-</html>
-
-

{{ languages( { "en": "en/Creating_a_Web_based_tone_generator"} ) }}

diff --git a/files/zh-tw/archive/misc_top_level/index.html b/files/zh-tw/archive/misc_top_level/index.html deleted file mode 100644 index 0959a3b10b..0000000000 --- a/files/zh-tw/archive/misc_top_level/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Misc top level -slug: Archive/Misc_top_level -translation_of: Archive/Misc_top_level ---- -

In progress. These pages were moved from the top level of MDN in a spate of furious reorganization.

- -

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/archive/misc_top_level/same-origin_policy_for_file_colon__uris/index.html b/files/zh-tw/archive/misc_top_level/same-origin_policy_for_file_colon__uris/index.html deleted file mode 100644 index b0fd952355..0000000000 --- a/files/zh-tw/archive/misc_top_level/same-origin_policy_for_file_colon__uris/index.html +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: '檔案同源政策 (Same-origin policy for file: URIs)' -slug: 'Archive/Misc_top_level/Same-origin_policy_for_file:_URIs' -translation_of: 'Archive/Misc_top_level/Same-origin_policy_for_file:_URIs' ---- -

在 Gecko 1.8 之前,任兩份檔案都會被視為同源(same-origin),換句話說本機端的任一份HTML檔可以讀取任一份檔案。

- -

自 Gacko 1.9 起,檔案讀取檔案開始受到限制:唯有當主檔案父資料夾是被讀取檔案的祖先資料夾 (ancestor directory) 的情況之下,檔案讀取才會被允許,但資料夾載入並非以此規範。

- -

舉例來說,我們從 index.html 進入同一層資料夾的另一個 foo.html 檔,而這個 foo.html 檔想要讀取 bar.html 檔,只有當 bar.html 存放於 index.html 所在資料夾或是 index.html 所在資料夾底下的子資料夾中,foo.html 才能讀取 bar.html。

- -

檔案同源政策會影響到包括 XMLHttpRequest, XSLT, 與 XBL 等同源政策的檢查。

- -

至於跨 window 的 DOM 存取,基本上各檔案都被視為不同源,除了以下例外:若是檔案 B 被另一個檔案 A 載入(例如透過 iframe 或 window.open()),而檔案 A、B 遵照此份檔案同源政策可以被判定屬於同源,那麼當發生跨 window 的 DOM 存取時,也可以視為同源。

- -

比如說 /home/user/subdir/foo.html 是一個 frameset,而它下嵌了 另一個 /home/user/subdir/subdir2/bar.html 的 frame, 那麼 foo.html 和 bar.html 可以視為同源,但如果 bar.html 的位置變成 /home/user/bar.html,那麼 foo.html 和 bar.html 便不可以視為同源。

- -

另外當使用者想要關閉這些檔案同源政策檢查,可以變更 security.fileuri.strict_origin_policy 偏好設定為從預設 true 到 false。

diff --git a/files/zh-tw/archive/mozilla/creating_a_microsummary/index.html b/files/zh-tw/archive/mozilla/creating_a_microsummary/index.html deleted file mode 100644 index 40afef30b6..0000000000 --- a/files/zh-tw/archive/mozilla/creating_a_microsummary/index.html +++ /dev/null @@ -1,214 +0,0 @@ ---- -title: 製作即時摘要 -slug: Archive/Mozilla/Creating_a_microsummary -tags: - - 即時摘要 -translation_of: Archive/Mozilla/Creating_a_microsummary ---- -

- 即時摘要來源(microsummary generator)內含一組從網頁中製出即時摘要的指令,而網頁能在 <head> 元素中放入 <link rel="microsummary"> 以指定適用的摘要來源。即時摘要來源檔案中如含有適用頁面列表,則也可以獨立安裝。

-

- 在這份教學文件中,我們將建立 Spread Firefox 首頁的即時摘要來源,藉以顯示目前 Firefox 的總下載數。 (例: Fx 下載數: 174475447)。

-

- 接下來我們會用一份 XSLT 樣式表將該網頁轉換為即時摘要、指定此摘要來源的適用頁面並了解摘要來源傳佈方式,讓使用者能下載及安裝。在這份文件中每階段新增的程式碼會以粗體顯示,方便您辨識。

-

- 開始

-

- 摘要來源是 XML 文件的一種,而其根元素為 <generator>、名稱空間 (namespace) 需指定為 http://www.mozilla.org/microsummaries/0.1,所以要建立一份摘要來源就先得在空的純文字檔中放入 XML 宣告及空的 <generator> 標籤:

-
<?xml version="1.0" encoding="UTF-8"?>
-<generator xmlns="http://www.mozilla.org/microsummaries/0.1">
-</generator>
-
-

- 命名

-

- 每個即時摘要來源都必須有個名字,該名稱以 name 屬性記載、明確說明此摘要來源所建立的摘要主題。由於我們要建立的摘要來源將顯示 Firefox 總下載數,所以便命名為「Firefox 下載計數」:

-
<?xml version="1.0" encoding="UTF-8"?>
-<generator xmlns="http://www.mozilla.org/microsummaries/0.1"
-           name="Firefox 下載計數">
-</generator>
-
-

- 加上 XSLT 樣式表

-

- 即時摘要來源檔案中必須含有一份 XSLT 樣式表,以便將網頁依樣式表設定轉換為即時摘要。同一份資料碰上不同的 XSLT 樣式便能轉換為「相貌」不同的文件,這便是 XSLT 威力所在。

-

- 以下示範以 <template> 元素在摘要來源中添加 XSLT 樣式表:

-
<?xml version="1.0" encoding="UTF-8"?>
-<generator xmlns="http://www.mozilla.org/microsummaries/0.1"
-           name="Firefox 下載計數">
-  <template>
-    <transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
-    </transform>
-  </template>
-</generator>
-
-

- 即時摘要來源中可以放任何形式的 XSLT,設定為產生超文件也行,但 Firefox 目前只會顯示純文字內容。

-

- 設定輸出格式

-

- 由於 XSLT 樣式表會產岀文字摘要,所以 XSLT 的 <output> 元素需設定如下:

-
<?xml version="1.0" encoding="UTF-8"?>
-<generator xmlns="http://www.mozilla.org/microsummaries/0.1"
-           name="Firefox 下載計數">
-  <template>
-    <transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
-      <output method="text"/>
-    </transform>
-  </template>
-</generator>
-
-

- 使用 XSLT <template>

-

- XSLT 處理器會分別比對 XSLT 樣式表中每組 <template> 元素及文件中的節點。當 <template>match 屬性設定與節點相符,處理器便依設定轉換文件。

-

- 這種處理方式可以循序檢查網頁中每個節點,依據設定條件顯示內容,非常有用。不過本例只是要顯示 Spread Firefox 網站上的即時摘要,僅用一個 <template> 元素來找一回根元素下的內容即可:

-
<?xml version="1.0" encoding="UTF-8"?>
-<generator xmlns="http://www.mozilla.org/microsummaries/0.1"
-           name="Firefox 下載計數">
-  <template>
-    <transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
-      <output method="text"/>
-      <template match="/">
-      </template>
-    </transform>
-  </template>
-</generator>
-
-

- 加上下載次數

-

- 若想將下載次數放到 XSLT 輸出的文件中,我們得在 XSLT 中的 template 元素加上 <value-of> 元素,而此 template 元素的 select 屬性中指定的 XPath 必須指向涵括計數器的節點。

-

- XPath 是用來指定 HTML/XML 文件節點的語言,也有基本的節點內容處理函式。要得知能指向此節點的 XPath 陳述式,最輕鬆的方法就是使用 XPath Checker 擴充套件

-

- 安裝 XPath Checker 並重新啟動 Firefox 之後,先到 Spread Firefox 首頁去,找到 Firefox 下載次數(網頁右邊欄最下方的數字),在上頭按下右鍵,於快捷選單中選擇 View XPath。此時 XPath Checker 會開啟一個新視窗,其中 XPath 欄位包含方才所選節點的 XPath 陳述式: id('download-count')

-

- 在 XSLT 的 <template> 元素中加上一個 <value-of> 元素,其中 select 屬性便設為此 XPath 陳述式,如下:

-
<?xml version="1.0" encoding="UTF-8"?>
-<generator xmlns="http://www.mozilla.org/microsummaries/0.1"
-           name="Firefox 下載計數">
-  <template>
-    <transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
-      <output method="text"/>
-      <template match="/">
-        <value-of select="id('download-count')"/>
-      </template>
-    </transform>
-  </template>
-</generator>
-
-

- 加上文字

-

- 為了在即時摘要中加上 Fx 下載數: 這段文字,我們必須將 <text> 元素放到 <template> 元素中文字該出現的地方。以下範例便放進一個內容為 Fx 下載數:<text> 元素:

-
<?xml version="1.0" encoding="UTF-8"?>
-<generator xmlns="http://www.mozilla.org/microsummaries/0.1"
-           name="Firefox 下載計數">
-  <template>
-    <transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
-      <output method="text"/>
-      <template match="/">
-        <text>Fx 下載數: </text>
-        <value-of select="id('download-count')"/>
-      </template>
-    </transform>
-  </template>
-</generator>
-
-

- 此處須留心 XSLT 標籤之間的空白字元並不會出現在輸出結果中,不像 HTML 會合併顯示為一個空格,所以要在字串後多加上一個空白以便區隔下載次數及字串。

-

- 這麼一來,這個轉換 Spread Firefox 首頁為即時摘要的 XSLT 樣式便完成了。

-

- 指定摘要來源的適用範圍

-

- 摘要來源的轉換樣式已大工告成,接下來要指定此樣式適用的網頁。如果我們是 Spread Firefox 的網站管理員,可以在網頁上的 <head> 元素中直接加入 <link rel="microsummary"> 標籤,以便指定此網頁對應的摘要來源:

-
<head>
-  ...
-  <link rel="microsummary" href="path/to/our/generator.xml">
-</head>
-
-

- 不過,由於我們並非該站網管,所以就得在檔案中規定此摘要來源的適用網頁,然後把摘要來源檔放到網路上供人下載。為了要指定適用網頁範圍,我們在 <generator> 元素中放上 <pages> 元素:

-
<?xml version="1.0" encoding="UTF-8"?>
-<generator xmlns="http://www.mozilla.org/microsummaries/0.1"
-           name="Firefox 下載計數">
-  <template>
-    <transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
-      <output method="text"/>
-      <template match="/">
-        <text>Fx 下載數: </text>
-        <value-of select="id('download-count')"/>
-      </template>
-    </transform>
-  </template>
-  <pages>
-  </pages>
-</generator>
-
-

- <pages> 元素中可以放進多個 <include><exclude> 元素。元素正如其名,<include> 元素能以規則運算式(regular expression)指定適用網頁,而 <exclude> 元素則以規則運算式指定不適用網頁。

-

- 若無另加規定,則摘要來源預設不適用所有網頁。也就是說,你必須明確指定摘要來源之適用範圍,但如無必要可不必以 <exclude> 排除其他網頁。

-

- 此處加上個 <include> 元素指定 Spread Firefox 首頁為適用範圍:

-
<?xml version="1.0" encoding="UTF-8"?>
-<generator xmlns="http://www.mozilla.org/microsummaries/0.1"
-           name="Firefox 下載計數">
-  <template>
-    <transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
-      <output method="text"/>
-      <template match="/">
-        <text>Fx 下載數: </text>
-        <value-of select="id('download-count')"/>
-      </template>
-    </transform>
-  </template>
-  <pages>
-    <include>http://(www\.)?spreadfirefox\.com/(index\.php)?</include>
-  </pages>
-</generator>
-
-

- 不熟悉規則運算式的話,可以參考建立即時摘要的規則運算式一文。

-

- 安裝即時摘要來源

-

- 現在萬事俱備,只差讓人能下載此摘要來源的機制。我們得先將摘要來源檔上傳到網路,接著再以一段 JavaScript 連結呼叫 Firefox 的 window.sidebar.addMicrosummaryGenerator() 方法以便下載安裝。

-

- 舉例而言,如果摘要來源檔的位置在 http://people.mozilla.com/~myk/micro...-generator.xml,而我們希望使用者能從 http://people.mozilla.com/~myk/micro...ial/index.html 上下載安裝,就應該在 index.html 網頁上加上此段程式碼:

-
 <button onclick="window.sidebar.addMicrosummaryGenerator('http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml')">安裝 SpreadFirefox 首頁即時摘要來源!</button>
-
-

- 不過,如果是不支援即時摘要的瀏覽器,按下此按鈕之後會產生 JavaScript 錯誤,所以我們應該幫使用者點忙、檢查他們的瀏覽器是否支援即時摘要,若不支援則顯示說明訊息:

-
<script>
-  const warning = "不好意思ㄋㄟ,你得用支援即時摘要的瀏覽器 (如 Firefox 2.0) 才能安裝這玩意喔!";
-  function addGenerator(url) {
-    if (typeof window.sidebar == "object" &&
-        typeof window.sidebar.addMicrosummaryGenerator == "function")
-      window.sidebar.addMicrosummaryGenerator(url);
-    else
-     alert(warning);
-  }
-</script>
-<button onclick="addGenerator('http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml')">安裝 SpreadFirefox 首頁即時摘要來源!</button>
-
-

- 附帶一提:

- -

- 結語

-

- 現在你應該瞭解怎麼製作能顯示 Firefox 下載次數的即時摘要了。試著將 Spread Firefox 首頁存為書籤,然後在新增書籤對話方塊中按下名稱下拉式選單、選擇即時標題之後的項目即可。

-

- 其他關於即時摘要的相關資訊,可以參考 Microsummaries 主題頁

diff --git a/files/zh-tw/archive/mozilla/drag_and_drop/index.html b/files/zh-tw/archive/mozilla/drag_and_drop/index.html deleted file mode 100644 index b963b08118..0000000000 --- a/files/zh-tw/archive/mozilla/drag_and_drop/index.html +++ /dev/null @@ -1,142 +0,0 @@ ---- -title: Drag and Drop -slug: Archive/Mozilla/Drag_and_drop -tags: - - NeedsTranslation - - TopicStub - - XUL -translation_of: Archive/Mozilla/Drag_and_drop ---- -

{{ Next("Drag and Drop JavaScript Wrapper") }}

-

{{ deprecated_header("gecko1.9.1") }}

-
- As of Gecko 1.9.1 (Firefox 3.5), these APIs are officially deprecated the newer, simpler, portable API should be used in their place.
-

This section describes how to implement objects that can be dragged around and dropped onto other objects.

-

The Drag and Drop Interface

-

Many user interfaces allow one to drag particular objects around within the interface. For example, dragging files to other directories, or dragging an icon to another window to open the document it refers to. Mozilla and XUL provide a number of events that can handle when the user attempts to drag objects around.

-

A user can start dragging by holding down the mouse button and moving the mouse. The drag stops when the user releases the mouse. Event handlers are called when the user starts and ends dragging, and at various points in-between.

-

Mozilla implements dragging by using a drag session. When a user requests to drag something that can be dragged, a drag session should be started. The drag session handles updating the mouse cursor and where the object should be dropped. If something cannot be dragged, it should not start a drag session. Because the user generally has only one mouse, only one drag session is in use at a time.

-

Note that drag sessions can be created from within Mozilla itself or from other applications. Mozilla will translate the data being dragged as needed.

-

The list below describes the event handlers that can be called, which may be placed on any element. You only need to put values for the handlers where you need to do something when the event occurs.

-
-
- ondrag {{ Fx_minversion_inline(3) }}
-
- Called periodically throughout the drag and drop operation.
-
- ondraggesture 
-
- Called when the user starts dragging the element, which normally happens when the user holds down the mouse button and moves the mouse. The script in this handler should set up a drag session.
-
- ondragstart {{ Fx_minversion_inline(3) }} 
-
- An alias for ondraggesture; this is the HTML 5 spec name for the event and may be used in HTML or XUL; however, for backward compatibility with older versions of Firefox, you may wish to continue using ondraggesture in XUL.
-
- ondragover 
-
- This event handler is called for an element when something is being dragged over top of it. If the object can be dropped on the element, the drag session should be notified.
-
- ondragenter 
-
- Called for an element when the mouse pointer first moves over the element while something is being dragged. This might be used to change the appearance of the element to indicate to the user that the object can be dropped on it.
-
- ondragexit 
-
- Called for an element when the mouse pointer moves out of an element while something is being dragged. The is also called after a drop is complete so that an element has a chance to remove any highlighting or other indication.
-
- ondragdrop 
-
- This event handler is called for an element when something is dropped on the element. At this point, the user has already released the mouse button. The element can simply ignore the event or can handle it some way, such as pasting the dragged object into itself.
-
- ondragend {{ Fx_minversion_inline(3) }} 
-
- Called when the drag operation is finished.
-
-

There are two ways that drag and drop events can be handled. This first involves using the drag and drop XPCOM interfaces directly. The second is to use a JavaScript wrapper object that handles some of this for you. The code for this wrapper can be found in a file named {{ Source("toolkit/content/nsDragAndDrop.js nsDragAndDrop.js") }} which is contained in the widget-toolkit (or global) package.

-

XPCOM Drag and Drop interfaces

-

Two interfaces are used to support drag and drop. The first is a drag service, nsIDragService and the second is the drag session, nsIDragSession.

-

The nsIDragService is responsible for creating drag sessions when a drag starts, and removing the drag session when the drag is complete. The function invokeDragSession should be called to start a drag inside an ondraggesture event handler. Once this function is called, a drag has started.

-

The function invokeDragSession takes four parameters, as described below:

-
invokeDragSession(element,transferableArray,region,actions)
-
-
-
- element 
-
- A reference to the element that is being dragged. This can be retrieved by getting the property event.target during the event handler.
-
- transferableArray 
-
- An array of nsITransferable objects, one for each item being dragged. An array is used because you might want to drag several objects at once, such as a set of files.
-
- region 
-
- A region used for feedback indication. This should usually be set to null.
-
- actions 
-
- The actions that the drag uses. This should be set to one of the following constants, or several added together. The action can be changed during the drag depending on what is being dragged over.
-
-
-
- nsIDragService.DRAGDROP_ACTION_NONE 
-
-
-
- Used to indicate that no drag is valid.
-
- nsIDragService.DRAGDROP_ACTION_COPY 
-
- The item being dragged should be copied to its dropped location.
-
- nsIDragService.DRAGDROP_ACTION_MOVE 
-
- The item being dragged should be moved to its dropped location.
-
- nsIDragService.DRAGDROP_ACTION_LINK 
-
- A link (or shortcut or alias) to the item being dragged should be created in the dropped location.
-
-
-
-

The interface {{ interface("nsIDragService") }} also provides the function getCurrentSession which can be called from within the drag event handlers to get and modify the state of the drag. The function returns an object that implements {{ interface("nsIDragSession") }}.

-

The interface nsIDragSession is used to get and set properties of the drag that is currently occuring. The following properties and methods are available:

-
-
- canDrop 
-
- Set this property to true if the element the mouse is currently over can accept the object currently being dragged to be dropped on it. Set the value to false if it doesn't make sense to drop the object on it. This should be changed in the ondragover and ondragenter event handlers.
-
- dragAction 
-
- Set to the current action to be performed, which should be one or more of the constants described earlier. This can be used to provide extra feedback to the user.
-
- numDropItems 
-
- The number of items being dragged. For example, this will be set to 5 if five bookmarks are being dragged.
-
- getData(transfer,index) 
-
- Get the data being dragged. The first argument should be an nsITransferable object to hold the data. The second argument, index, should be the index of the item to return.
-
- sourceDocument 
-
- The document where the drag started.
-
- sourceNode 
-
- The DOM node where the drag started.
-
- isDataFlavorSupported(flavor) 
-
- Returns true if the data being dragged contains data of the specified flavor.
-
-

{{ Next("Drag and Drop JavaScript Wrapper") }}

-
-

Original Document Information

- -
diff --git a/files/zh-tw/archive/mozilla/firefox/index.html b/files/zh-tw/archive/mozilla/firefox/index.html deleted file mode 100644 index c87802d82f..0000000000 --- a/files/zh-tw/archive/mozilla/firefox/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Firefox -slug: Archive/Mozilla/Firefox -translation_of: Archive/Mozilla/Firefox ---- -

In progress. Out-of-date information about the Firefox project.

- -

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/archive/mozilla/firefox/using_microformats/index.html b/files/zh-tw/archive/mozilla/firefox/using_microformats/index.html deleted file mode 100644 index 6e7260a691..0000000000 --- a/files/zh-tw/archive/mozilla/firefox/using_microformats/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Firefox 3 Using Microformat -slug: Archive/Mozilla/Firefox/Using_microformats -translation_of: Archive/Mozilla/Firefox/Using_microformats ---- -

Microfotmats 讓網站可以提供語意化的資料給瀏覽器,這是為了讓瀏覽器不需知道如何剖析(parse)文件就可以呈現網頁資訊的摘要。Firefox 3 實做了一個全域的 microformats 物件(global microformats object) 以提供 microformats 的存取。這個物件與其 API 簡化了尋找、讀取 microfotmats 的工作。

-

載入 microformats API

-

Microformats 物件是用 Firefox 3 新加入的 JavaScript script loader 建立的。要使用這個 API,你首先需要載入這個物件:

-
Components.utils.import("resource://gre/modules/Microformats.js");
-

一旦載入了這個 microformats API,你就可以使用列在這裡的方式來管理 microformats,詳見 Parsing microformats in JavaScript

-

預先定義好的 microformats

-

Firefox 3 實做了好幾種常見的 microformats,以下是其定義:

-
-
- adr
-
- 代表住址 (例如一條街或郵寄住址)。
-
- geo
-
- 代表使用緯度、經度表示的地理位置。
-
- hCard
-
- 代表個人的聯絡方式。
-
- hCalendar
-
- 代表行事曆上的一個約會。
-
- tag
-
- 用於新增標籤給其他 microformats。 -

方式

-

add()

-

新增一個 microformat 到一個 microformat module。

-

如果指定的名稱和現存的 microformat 相同,這個原來存在的 microformat 會被新增的所取代。

-
add(name, definition);
-
Parameters
-

 

-
-
- name
-
- 新增到 microformat module 的 microformat 名稱。
-
- definition
-
- 描述 microformat 的 JavaScript 結構,詳見 Describing microformats in JavaScript
-
-

count()

-

計算文件中符合我們指定的類型的 microformats 的數量

-
numMicroformats = Microformats.count(name, rootElement, recurseFrames)
-
Parameters
-

 

-
-
- name
-
- 要計算的 microformat 名稱。
-
- rootElement
-
- 可加可不加。代表由此開始搜尋的 DOM 元素,預設是 content.document (換句話說,也就是整份文件)。
-
- recurseFrames
-
- 可加可不加。如果是 true,搜尋時會連 child frames 一起搜尋,預設是 true
-
-
回傳值 (Return value)
-

是一個整數值,代表符合指定類型的 microformats 數量。

-

debug()

-

get()

-

getNamesFromNode()

-

getParent()

-

isMicroformat()

-
-
diff --git a/files/zh-tw/archive/mozilla/index.html b/files/zh-tw/archive/mozilla/index.html deleted file mode 100644 index 0acec76e6d..0000000000 --- a/files/zh-tw/archive/mozilla/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Archived Mozilla and build documentation -slug: Archive/Mozilla -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla ---- -

These articles are archived, obsolete documents about Mozilla, Gecko, and the process of building Mozilla projects.

-

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/archive/mozilla/marketplace/apis/index.html b/files/zh-tw/archive/mozilla/marketplace/apis/index.html deleted file mode 100644 index ead011ed63..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/apis/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: 公用程式函式庫與 API -slug: Archive/Mozilla/Marketplace/APIs -translation_of: Archive/Mozilla/Marketplace/APIs ---- -
-

如果要將 Firefox Marketplace 的功能寫進 App 與 Web 頁面之中,就必須透過 Marketplace Utility Libraries、Web API、Marketplace API。本文將說明上述方式、使用時機,並提供進一步的說明文件連結。

-
- -

Marketplace Utility Library

- -

Marketplace Utility Library 可讓開發者避開複雜的 Web API 與 Marketplace API,進而簡化每天的程式撰寫作業。目前雖然只有 1 組函式庫,但隨著 Marketplace 功能不斷擴充,將會陸續提供其他函式庫:

- - - -

Web API

- -

Marketplace App 必須透過 Web API 才能提供特定功能:

- - - -

Marketplace API

- -

針對大多數的一般 App 撰寫需要,其實並用不到 Marketplace API。但某些 Activities (如設立自己的 App 商店) 就需要此 API。但根據開發者自己的需求,也許 Marketplace Utility Library 還是比較好用。

- -

Marketplace API 的相關說明文件,均已置於 readthedocs.org 的這個網址上。如果你需要進一步了解這些 API,亦可加入 dev-marketplace 郵件群組。

- -
-

Marketplace API 說明文件,均記錄了正在開發中的 Marketplace API。所以內含的 API 細節尚未公開於 Marketplace 之上。

-
- -

 

diff --git a/files/zh-tw/archive/mozilla/marketplace/faq/index.html b/files/zh-tw/archive/mozilla/marketplace/faq/index.html deleted file mode 100644 index ba8aa7493a..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/faq/index.html +++ /dev/null @@ -1,154 +0,0 @@ ---- -title: Firefox Marketplace 常見問題 -slug: Archive/Mozilla/Marketplace/FAQ -translation_of: Archive/Mozilla/Marketplace/FAQ ---- -
-

本篇文章將解答 Firefox Marketplace 多個常見的發佈問題。

-
- -

帳戶管理

- -

我該如何變更開發者帳戶的資訊?

- -

進入 Firefox Marketplace 並登入自己的帳戶,將滑鼠游標置於齒輪圖示 (即設定選單) 之上,點選「Edit Account Settings」即可。

- -

我該如何變更開發者付款的資訊?

- -

進入 Firefox Marketplace 並登入自己的帳戶,將滑鼠游標置於齒輪圖示 (即設定選單) 之上。點選「My Apps」之後,找到你想變更付款資訊的 App,再點擊「Set Up Payments」即可。

- -

我該到哪找到自己的銷售報表與對帳資訊?

- -

進入 Firefox Marketplace 並登入自己的帳戶,將滑鼠游標置於齒輪圖示 (即設定選單) 之上。點選「My Apps」之後,找到你需要相關資料的 App 即可。

- -

如果我們是多人組成的開發團隊或公司,該如何管理帳戶資訊?

- -

進入 Firefox Marketplace 並登入自己的帳戶,將滑鼠游標置於齒輪圖示 (即設定選單) 之上。點選「My Apps」之後,找到你想變更團隊細節的 App 即可。

- -

我該如何重新命名 App?

- -

如果你想在 Marketplace 審查之後變更 App 的名稱,就必須再次提交 App 通過審查才行。請參閱更新 App 以進一步了解。

- -

我該如何進入 Firefox Marketplace 除錯設定?

- -

登入之後進入 Firefox Marketplace,在搜尋列中輸入「:debug」。

- -

接著你就會看到自己 Marketplace 帳戶的除錯畫面。你可在此畫面中清除 Marketplace 網站、提交記錄、檢視設定、活動記錄等等相關的 cookies 與 localStorage。

- -

如果我把 App 提交到自己目前所在地以外的地方,我該如何檢視這些 App?

- -

如果你自己目前所在之處或擁有手機 SIM 卡的地區,和你 App 發佈地區並不相同,則可透過下列步驟檢視該 App:

- -
    -
  1. 進入 Firefox Marketplace 除錯設定 (可參閱上一題)。
  2. -
  3. 透過「Region Override」與「Carrier Override」選項,選出自己的所在地區或營運商 (只要選完就會立刻更新這些設定)。
  4. -
  5. 重新整理/載入 Marketplace。
  6. -
- -

你可以先試著為 App 隨便選個分類,確認系統更新過了相關設定。

- -

App 提交與審查程序

- -

我該如何提交新的 App?

- -

可參閱《將 App 提交至 Firefox Marketplace》中的詳細步驟。

- -

App 核准程序為何?

- -

請參閱《Marketplace 審查準則》以了解審查程序的相關準則。

- -

是否有快速審查程序?所採用的準則是否不同?

- -

如果開發者正好有絕佳的商機需求,或必須儘快釋出重要修復檔案,即可申請快速審查 App。若需 Marketplace 進行快速審查,可寄發電子郵件到 mozilla.appreview,或加入 irc.mozilla.org 中的「#app-reviewers」IRC 頻道。我們會儘快完成快速審查,但不保證審查人員能配合任何特定時間。

- -
-

注意:對 App 審查團隊來說,「App 快速審查」也算是額外的工作之一。若你有興趣協助我們的審查作業,歡迎透過 Firefox App 審查者申請表申請。

-
- -

我的 App 需要遵守內容政策嗎?

- -

當然!請參閱《Marketplace 審查準則》中的〈內容〉一章,了解 Mozilla 的內容政策。

- -

如果 App 遭退回或移除,我該如何上訴?

- -

如果想為遭退回的 App 上訴,則可直接回覆 App 退回通知的電子郵件 (所有 Marketplace 通知郵件的末端,均告知開發者可直接回覆該電子郵件以提出問題);或可透過 irc.mozilla.org 上的「#app-reviewers」IRC 頻道向我們溝通。

- -

付款

- -

Firefox Marketplace 如何運作付款作業?

- -

Mozilla 提供多種付款方式,包含付費 App、免費增值 (Freemium) App、App 內部付費機制 (In-app payments)。若需進一步資訊,可參閱《Marketplace Payments guide》。

- -

開發者收益的拆帳方式為何?

- -

開發者將收到預扣增值稅 (Value Added Tax,VAT) 與費用之後金額的 70%。我們先假設美金訂價 $.99 (Tier 10),歐元訂價則為 €.89;而增值稅率為 20% (根據英國標準增值稅率) 為例,則預扣增值稅之後的價格為 €.74,亦約為 $.99 (有時匯兌之後的價格點數可能變高,有時也會變低)。開發者最後將收到 €.74 的七成金額。

- -

若需價格點數與訂價的相關資訊,可參閱《制定 App 的價格》。

- -

Mozilla 也會拆得一部分的帳嗎?

- -

會。為了維持 Firefox Marketplace 的運作、持續強化 App 平台、支付每次購買行為所產生的交易費用。Mozilla 將收取預扣增值稅後金額的三成,再拆分給 Mozilla、行動網路營運商、付款服務供應商 (如 Bango) 共三方收取。

- -

我一定要使用 Firefox Marketplace 的付款系統嗎?

- -

若要讓消費者從 Firefox Marketplace 下載付費 App,就必須使用 Firefox Marketplace 付款系統。我們不會要求 In-app payments 也同樣使用 Marketplace 付款系統,但目前 Firefox OS 中僅建構了 navigator.mozPay() 函式 (用於 In-app payments),而該函式就採用 Firefox Marketplace 付款系統。我們以後會讓開發者針對 In-app payments 選用任何付款系統。

- -

將自己的 App 放上 Firefox Marketplace 後的交易費用?

- -

需支付預扣稅額訂價的 30%。換句話說,因為 Marketplace 提供的含稅價格點數已經納入了增值稅 (針對需課增值稅的地區),所以在完成交易之後隨即扣除增值稅,讓開發者取得訂價金額的 70%。

- -

我需要自行設定銷售稅或增值稅率嗎?

- -

不用。針對需課稅的地區,Marketplace 的價格點數均已包含了增值稅。而銷售稅的部分,均另由付款服務供應商列入帳單之中。

- -

我該如何分開付款?

- -

Firefox Marketplace 目前尚未提供分開付款的功能。

- -

我能提交免費 App 嗎?會向我收費嗎?

- -

當然。歡迎開發者在 Firefox Marketplace 中提交免費 App,且 Mozilla 不會對免費 App 收取任何費用。

- -

付費 App 還能搭配 In-app payments 嗎?

- -

可以。

- -

退款程序為何?

- -

根據付款方式的不同,退款程序可能由電信營運商、信用卡公司,或付款服務供應商 (如 Bango) 進行。若消費者選用電信帳單代繳的方式,則依照電信營運商的退款政策處理。目前尚無營運商提供退款服務。Bango 則是針對信用卡提供前端支援服務。任何退款均將從開發者的收益之中扣除。

- -

服務條款與開發者協議均提供了退款政策。一般來說,Marketplace 不會支付退款,但會要求 Bango 進行退款程序。若消費者選用電信帳單代繳的方式,就必須要求電信營運商退款並修正電信帳單。

- -

如何處理詐騙的購買行為?

- -

尚待完善討論。

- -

Marketplace 如何處理多樣的幣別?

- -

根據消費者所選的所在地區,即顯示該地區的預設幣別。另針對付款作業,若消費者目前身處於原本設定的地區之外,就會根據他們收取帳單的地區 (即 SIM 卡所在地),或根據其所在位置收款。如此可避免詐欺行為。

- -

付款時程為何?開發者多久能收到銷售 App 的應得款項?

- -

根據付款服務供應商而有所不同;而目前仍由 Bango 負責所有地區的付款作業。開發者可直接與 Bango 洽詢,且每個月均會收到自行對帳用的發票。因為行動服務營運商必須向消費者收取並匯出相關款項,所以支付日期也各有差異。各個國家又會有所不同。而消費者如果採用信用卡付款,都能讓開發者迅速收取款項。若選用電信帳單代繳方式,可能需時 30 ~ 90 天不等。

- -

開發者應如何處理退款?

- -

請參閱《Marketplace payments》中的〈Refunds〉一章。

- -

Firefox Marketplace 可進行臨時銷售或變更訂價嗎?

- -

我們正規劃價格點數的變更功能,讓開發者能針對「試用期」或「正式銷售」而設定不同的價格。

- -

開發者能銷售 Firefox 的附加元件 (add-ons) 嗎?

- -

目前 Firefox Marketplace 僅供銷售 App。我們希望很快就能提供其他內容的銷售服務。

- -

技術問題

- -

誰將可托管 App?

- -

開發者可在自己的伺服器上托管 App 的所有檔案。但將 App 提交到 Firefox Marketplace 之後,就必須提供 App 的 manifest 檔案網址,以利 Marketplace 進行讀取並檢驗。開發者另可上傳圖示、截圖等元素,以能順利在 Firefox Marketplace 推銷自己的 App。可參閱《將 App 提交至 Firefox Marketplace》進一步了解。

- -

如何從 App 直接啟動 Marketplace?

- -

開發者可透過 Web Activities,從自己的 App 或網站啟動 Marketplace。而 Marketplace 所支援的 activities 均記錄於 Github 之上

diff --git a/files/zh-tw/archive/mozilla/marketplace/index.html b/files/zh-tw/archive/mozilla/marketplace/index.html deleted file mode 100644 index 5ce3b790b0..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/index.html +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: Firefox Marketplace -slug: Archive/Mozilla/Marketplace -tags: - - Apps - - B2G - - Firefox OS - - Marketplace - - Mobile - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace ---- -
Firefox Marketplace 為開放且非專利的線上商城,針對以 HTML5 所撰寫的 Web App 所建構。若開發者準備在 Firefox Marketplace 上發佈 App,均可於此專區中找到相關資訊。另有其他指南可帶領你成功打造 App、提供其他選項、將自己的心血轉為實質收益、發佈\更新 App,更有函式庫與 API 可確實發揮 Marketplace 的特色。
- -
-
-

透過標準的 Web 技術、語言、工具,Firefox Marketplace 可供你發佈免費\付費的 Open Web App。這些可為封裝式 (Packaged) App,於 Firefox 中執行;或可為托管\架設式 (Hosted) App,置於你自己的伺服器之上。已上架的 App 則可用於 Firefox 桌機版、Android 裝置、Firefox OS 手機。而使用者可透過 App 的精選、分類、搜尋等區塊,輕鬆找到自己喜愛的 App。接著就能立刻安裝免費 App,或透過目前持續成長中的信用卡付款\電信帳單代收的功能,購買付費 App。

- -
-
-

準備發佈 App

- -
-
不論你撰寫 App 是純粹好玩或想創造收益,你都會希望有許多人發現、使用、享受你的作品。本章節將解釋該如何拓展能見度,並建立消費者社群。
-
- -

App 發佈選項

- -
-
到底要用封裝式或托管\架設式 App?了解應如何發表自己 App 的內容。且除了 Firefox OS 之外,亦可讓 App 躍上 Android 裝置與桌上型電腦。
-
建立自己的 App 商城
-
你不一定要透過 Firefox Marketplace 發佈自己的 App。了解應如何建立自己的 App 商城,或為其他開發者的 App 建立商城。
-
- -

轉為實質收益

- -
-
如果你負責撰寫 App,則可透過本章節了解 Open Web App 與 Firefox Marketplace 所提供的收益選項。另亦提供 App 內付款 (In-app payments) 的詳細資訊。
-
-
- -
-

發佈 App

- -
-
快向世界發佈你的 App。了解應如何讓 Firefox Marketplace 發佈 App,包含 App 提交程序、審查程序、更新程序、了解上架後的效益,並觀看消費者的反應意見。
-
- -

App 開發工具

- -
-
Firefox Marketplace 函式庫與 API
-
概略了解目前可用的函式庫與 API,為自己在 Marketplace 上的 App 添增功能。
-
Firefox OS 的「應用程式管理員 (App Manager)」
-
從桌上型電腦為 Open Web App 測試、佈署、除錯的主要工具。
-
App 開發工具
-
完整工具清單,可供你有效率的開發 Open Web App 並樂在其中。
-
-
-
-
-
- - - -
    -
  1. 準備發佈 App - -
      -
    1. 介紹
    2. -
    3. 決定所要撰寫的東西
    4. -
    5. 了解目標消費者
    6. -
    7. 選擇自己的營運模式
    8. -
    9. 撰寫高品質 App
    10. -
    11. 當地語系的 App
    12. -
    13. 推銷自己的 App
    14. -
    15. 建立自己的群組
    16. -
    -
  2. -
  3. 發佈選項 -
      -
    1. 介紹
    2. -
    3. 封裝式 (Packaged) App
    4. -
    5. 托管\架設式 (Hosted) App
    6. -
    7. 要封裝抑或托管?
    8. -
    9. 適合 Android 的 Open Web App
    10. -
    11. 適合桌上型電腦的 Open Web App
    12. -
    13. 自行發佈 App
    14. -
    15. 建立自己的商城
    16. -
    -
  4. -
  5. 產生實質收益 -
      -
    1. 介紹
    2. -
    3. 用自己的 App 創造收益
    4. -
    5. App 付款指南
    6. -
    7. 應用程式內付款 (In-app payments) -
        -
      1. 介紹
      2. -
      3. 透過 mozPay
      4. -
      5. 透過 fxPay
      6. -
      -
    8. -
    9. 驗證收據
    10. -
    11. App 定價表
    12. -
    13. 付款服務狀態
    14. -
    -
  6. -
  7. App 發佈概述 -
      -
    1. 介紹
    2. -
    3. 提交作業檢查清單
    4. -
    5. Marketplace 審查準則
    6. -
    7. 為 App 添增子網域
    8. -
    9. 策略與指南 -
        -
      1. 介紹
      2. -
      3. Marketplace 截圖準則
      4. -
      5. 隱私權政策
      6. -
      7. App 測試與疑難排解
      8. -
      -
    10. -
    -
  8. -
  9. 提交 App -
      -
    1. 概述
    2. -
    3. Step 1:登入
    4. -
    5. Step 2:上傳
    6. -
    7. Step 3:列出細節
    8. -
    9. Step 4:後續步驟
    10. -
    11. Step 5:App 評分
    12. -
    13. Step 6:制定 App 的價格 -
        -
      1. 介紹
      2. -
      3. 付款帳戶
      4. -
      5. Bango
      6. -
      7. Boku
      8. -
      9. 用「升級」的方式推廣
      10. -
      11. fxPay 的 App 產品
      12. -
      -
    14. -
    15. Step 7:定義團隊成員
    16. -
    17. Step 8:檢視列表
    18. -
    19. Step 9:編輯其他本地化的內容
    20. -
    -
  10. -
  11. 管理並更新已發佈的 App -
      -
    1. 介紹
    2. -
    3. App 的狀態
    4. -
    5. 更新 App
    6. -
    7. App 狀態
    8. -
    -
  12. -
  13. 函式庫與 API
  14. -
  15. Firefox Marketplace 常見問題
  16. -
diff --git a/files/zh-tw/archive/mozilla/marketplace/marketplace_apis/index.html b/files/zh-tw/archive/mozilla/marketplace/marketplace_apis/index.html deleted file mode 100644 index 372284a029..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/marketplace_apis/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Firefox Marketplace API -slug: Archive/Mozilla/Marketplace/Marketplace_APIs -translation_of: Archive/Mozilla/Marketplace/Marketplace_APIs ---- -
-

提供 Firefox Marketplace API 的主要參考文章,可協助你進行 App 提交作業、設定 App 的付款帳戶,及其他更多相關重要步驟。

-
-
-
-
-
- Marketplace 公用程式函式庫
-
- 可協助你順利進行 Firefox Marketplace 的相關作業。你可將內含的 JavaScript 函式庫用於自己的 App 之內,以輕鬆處理應用程式內付款 (In-app payments) 並驗證付款收據。
-
- Submission API
-
- Submission API 可讓你檢驗並更新 App,並在安裝之前提取 App 的可用資訊。
-
- Payment API
-
- Payment API 可讓你取得 In-app payments 的資訊,以及不同國家的訂價情形。
-
- 其他 Marketplace API
-
- Firefox Marketplace API 的完整說明文件。
-
-
-
-
Tools for app developers
- -
Technology reference documentation
- -
Getting help from the community
-

If you still aren't sure how to do what you're trying to get done, feel free to join the conversation!

- -

Don't forget about the netiquette...

-
-
-

 

diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/app_payments_guide/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/app_payments_guide/index.html deleted file mode 100644 index a1f464f224..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/app_payments_guide/index.html +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: 建構付費 App -slug: Archive/Mozilla/Marketplace/Monetization/App_payments_guide -translation_of: Archive/Marketplace/Monetization/App_payments_guide ---- -
-

Firefox Marketplace 的消費者有兩種需要付款的情形:
- 1). 購買 App 需付款 (付費 App)
- 2). 在安裝 App 之後另外購買某樣東西需付款;即 App 內付款機制 (In-app payment)
- 本文即提供付費 App 所需的程式碼與作業流程,另外將有另一篇文章說明 In-app payments

-
-

選擇封裝方式 (Packaged Hosted)

-

在了解付款方式之前,先決定自己的 App 應該是封裝式 (Packaged),或架設/托管式 (Hosted)。如果想處理為封裝式 App,就必須遵守內容安全政策 (Content Security Policy,CSP)。可參閱下列說明以進一步了解。

- -

建構付費 App

-
-

任何 App 都能設定為付費 App,也都能是封裝式或架設/托管式 App;完全不需特別的權限。在將 App 提交到 Firefox Marketplace 時,只要勾選使其成為付費 App 即可。但開發者需讓 App 驗證自己的銷售收據,才能確認收到帳款。接下來就是應進行的步驟。

-

installs_allowed_from 添增到 manifest.webapp

-

首先必須將 installs_allowed_from 欄位添增到 App 的 manifest 檔案中。另給予如下的 Firefox Marketplace 網址:

-
"installs_allowed_from": [ "https://marketplace.firefox.com" ]
-

這個步驟屬於收據驗證作業的一部分,才能讓系統確認 App 來自於收款的商店。

-
-

驗證收據

-

只要從 Marketplace 售出 App 之後,隨即會產生該筆銷售的數位收據。開發者應該為自己的 App 植入程式碼,讓 App 執行時能一併驗證銷售收據。我們強烈建議,但不強制驗證收據。此查核作業可避免消費者安裝了 App 卻未付費。

-

Mozilla 另負責維護 JavaScript 輔助函式庫 (Helper),即所謂的 receiptverifier,只要少量程式碼即可驗證收據。只要將下列 receiptverifier 函式庫加入 App 即可:

- -

再將下列程式碼加入 App (更改內文以符合自己的 App),即可驗證收據:

-
mozmarket.receipts.Prompter({
-  storeURL: "https://marketplace.firefox.com/app/your-app",
-  supportHTML: '<a href="mailto:you@yourapp.com">email you@yourapp.com</a>',
-  verify: true
-});
-

正常只要啟動 App 就會開始驗證收據。如果確認收據有效,即可釋放 App 的資源;反之可停止 App 執行。

-
-

注意:若要進一步建立自己的收據驗證器,可參閱驗證收據

-
-

另可參閱

- diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/app_pricing/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/app_pricing/index.html deleted file mode 100644 index 4d7c3fbc32..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/app_pricing/index.html +++ /dev/null @@ -1,3698 +0,0 @@ ---- -title: 制定 App 的價格 -slug: Archive/Mozilla/Marketplace/Monetization/App_pricing -translation_of: Archive/Marketplace/Monetization/App_pricing ---- -
-

本文將為開發者說明在 Firefox Marketplace 中制定 App 價格與收款的方法。因為開發者可能在 Firefox Marketplace 中跨國制定不同的價格,所以定價方式有點複雜。本文即提供相關資訊,如訂價、拆帳、課稅、付款方式、應收帳款、防止詐騙等等。

-
- -

以「價格點數」定價

- -

在 Firefox Marketplace 中,開發者必須透過固定的「價格點數 (Price point)」完成定價。開發者可選擇任一價格點數,而該價格點數隨即套用為各地區通用貨幣的等值定價。針對開發者所選定 App 或應用程式內部付費 (In-app Payments) 的販售地區,當地消費者就能透過系統得知 App 的定價。價格點數範圍從 US$0.10 (點數 1) 到 US$49.99 (點數 140)。Firefox Marketplace 中的 App 與 In-app Payments,均適用價格點數的定價方式。

- -

範例:若 App 設定為「10」價格點數,則在流通美金的地區就是售價 US$0.99 (未含當地銷售稅);流通歐元的地區就是售價 €0.89 (已含歐洲增值稅)。在哥倫比亞的電信帳單代繳售價為 COP$2060.00 (包含哥倫比亞區的增值稅),信用卡繳款的售價則為 US$0.99。

- -

價格點數表

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Price pointAustriaBelgiumBrazilChileColombiaCyprusEstoniaFinlandFranceGermanyGreeceHungaryIrelandItalyLatviaLithuaniaLuxembourgMaltaMexicoNetherlandsPeruPolandPortugalSlovakiaSloveniaSpainUnited KingdomUnited StatesUruguayVenezuelaRest of World
VAT/Tax included in priceunknownunknownnoyes&nbsp;(19%)yes&nbsp;(16%)unknownunknownunknownunknownyes&nbsp;(19%)yes&nbsp;(23%)yes&nbsp;(27%)unknownyes&nbsp;(22%)unknownunknownunknownunknownyes&nbsp;(16%)unknownyes&nbsp;(18%)yes&nbsp;(23%)unknownunknownunknownyes&nbsp;(21%)yes&nbsp;(20%)noyes&nbsp;(22%)yes&nbsp;(12%)no
Tier 0 - - €0 - - - - €0 - - - - $0 - - - - $0 - - - - $0 - - - - €0 - - - - €0 - - - - €0 - - - - €0 - - - - €0 - - - - €0 - - - - Ft&nbsp;0 - - - - €0 - - - - €0 - - - - €0 - - - - €0 - - - - €0 - - - - €0 - - - - $0 - - - - €0 - - - - $0 - - - - 0&nbsp;zł - - - - €0 - - - - €0 - - - - €0 - - - - €0 - - - - £0 - - - - $0 - - - - $0 - - - - $0 - - - - $0 - [1] - -
Tier 1 - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - €0.1 - [2] - - - - €0.1 - [2] - - - - Ft&nbsp;25 - [2] - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - 0.49&nbsp;zł - [2] - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - -
Tier 5 - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - €0.25 - [2] - - - - €0.25 - [2] - - - - Ft&nbsp;70 - [2] - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - $3.75 - [2] - - - - n/a - - - - n/a - - - - 0.98&nbsp;zł - [2] - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - -
Tier 7 - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - €0.4 - [2] - - - - €0.4 - [2] - - - - Ft&nbsp;135 - [2] - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - $7.51 - [2] - - - - n/a - - - - n/a - - - - 1.99&nbsp;zł - [2] - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - - - - n/a - -
Tier 10 - - €0.89 - [1] - - - - €0.89 - [1] - - - - $0.99 - [1] - - - - $0.99 - [1] - - - - $2060 - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - €0.89 - - - - €0.89 - - - - Ft&nbsp;270 - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - $15 - - - - €0.89 - [1] - - - - $0.99 - [1] - - - - 3.99&nbsp;zł - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - €0.89 - [1] - - - - £0.75 - [1] - - - - $0.99 - [1] - - - - $0.99 - [1] - - - - $0.99 - [1] - - - - $0.99 - [1] - -
Tier 20 - - €1.89 - [1] - - - - €1.89 - [1] - - - - $1.99 - [1] - - - - $1.99 - [1] - - - - $4150 - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - €1.89 - - - - €1.89 - - - - Ft&nbsp;545 - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - $30 - - - - €1.89 - [1] - - - - $1.99 - [1] - - - - 7.69&nbsp;zł - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - €1.89 - [1] - - - - £1.5 - [1] - - - - $1.99 - [1] - - - - $1.99 - [1] - - - - $1.99 - [1] - - - - $1.99 - [1] - -
Tier 30 - - €2.79 - [1] - - - - €2.79 - [1] - - - - $2.99 - [1] - - - - $2.99 - [1] - - - - $6240 - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - €2.79 - - - - €2.79 - - - - Ft&nbsp;820 - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - $45 - - - - €2.79 - [1] - - - - $2.99 - [1] - - - - 11.59&nbsp;zł - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - €2.79 - [1] - - - - £2.25 - [1] - - - - $2.99 - [1] - - - - $2.99 - [1] - - - - $2.99 - [1] - - - - $2.99 - [1] - -
Tier 40 - - €3.79 - [1] - - - - €3.79 - [1] - - - - $3.99 - [1] - - - - $3.99 - [1] - - - - $8320 - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - €3.79 - - - - €3.79 - - - - Ft&nbsp;1095 - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - $60 - - - - €3.79 - [1] - - - - $3.99 - [1] - - - - 15.49&nbsp;zł - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - €3.79 - [1] - - - - £3 - [1] - - - - $3.99 - [1] - - - - $3.99 - [1] - - - - $3.99 - [1] - - - - $3.99 - [1] - -
Tier 50 - - €4.69 - [1] - - - - €4.69 - [1] - - - - $4.99 - [1] - - - - $4.99 - [1] - - - - $10420 - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - €4.69 - - - - €4.69 - - - - Ft&nbsp;1360 - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - $75 - [1] - - - - €4.69 - [1] - - - - $4.99 - [1] - - - - 19.5&nbsp;zł - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - €4.69 - [1] - - - - £3.75 - [1] - - - - $4.99 - [1] - - - - $4.99 - [1] - - - - $4.99 - [1] - - - - $4.99 - [1] - -
Tier 60 - - €6.59 - [1] - - - - €6.59 - [1] - - - - $6.99 - [1] - - - - $6.99 - [1] - - - - $14600 - [1] - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - €6.59 - - - - €6.59 - - - - Ft&nbsp;1900 - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - $105 - [1] - - - - €6.59 - [1] - - - - $6.99 - [1] - - - - 26.99&nbsp;zł - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - €6.59 - [1] - - - - £5.25 - [1] - - - - $6.99 - [1] - - - - $6.99 - [1] - - - - $6.99 - [1] - - - - $6.99 - [1] - -
Tier 70 - - €9.49 - [1] - - - - €9.49 - [1] - - - - $9.99 - [1] - - - - $9.99 - [1] - - - - $20840 - [1] - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - €9.49 - - - - €9.49 - - - - Ft&nbsp;2720 - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - $150 - [1] - - - - €9.49 - [1] - - - - $9.99 - [1] - - - - 38.79&nbsp;zł - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - €9.49 - [1] - - - - £7.5 - [1] - - - - $9.99 - [1] - - - - $9.99 - [1] - - - - $9.99 - [1] - - - - $9.99 - [1] - -
Tier 80 - - €11.59 - [1] - - - - €11.59 - [1] - - - - $12.49 - [1] - - - - $12.49 - [1] - - - - $26070 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - €11.59 - - - - €11.59 - - - - Ft&nbsp;3400 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - $185 - [1] - - - - €11.59 - [1] - - - - $12.49 - [1] - - - - 48.49&nbsp;zł - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - €11.59 - [1] - - - - £9.5 - [1] - - - - $12.49 - [1] - - - - $12.49 - [1] - - - - $12.49 - [1] - - - - $12.49 - [1] - -
Tier 90 - - €14.19 - [1] - - - - €14.19 - [1] - - - - $14.99 - [1] - - - - $14.99 - [1] - - - - $31280 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - €14.19 - - - - €14.19 - - - - Ft&nbsp;4080 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - $225 - [1] - - - - €14.19 - [1] - - - - $14.99 - [1] - - - - 57.99&nbsp;zł - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - €14.19 - [1] - - - - £11.25 - [1] - - - - $14.99 - [1] - - - - $14.99 - [1] - - - - $14.99 - [1] - - - - $14.99 - [1] - -
Tier 100 - - €18.99 - [1] - - - - €18.99 - [1] - - - - $19.99 - [1] - - - - $19.99 - [1] - - - - $41720 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - €18.99 - - - - €18.99 - - - - Ft&nbsp;5450 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - $300 - [1] - - - - €18.99 - [1] - - - - $19.99 - [1] - - - - 77.49&nbsp;zł - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - €18.99 - [1] - - - - £15 - [1] - - - - $19.99 - [1] - - - - $19.99 - [1] - - - - $19.99 - [1] - - - - $19.99 - [1] - -
Tier 110 - - €23.59 - [1] - - - - €23.59 - [1] - - - - $24.99 - [1] - - - - $24.99 - [1] - - - - $52160 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - €23.59 - - - - €23.59 - - - - Ft&nbsp;6800 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - $375 - [1] - - - - €23.59 - [1] - - - - $24.99 - [1] - - - - 96.99&nbsp;zł - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - €23.59 - [1] - - - - £18.75 - [1] - - - - $24.99 - [1] - - - - $24.99 - [1] - - - - $24.99 - [1] - - - - $24.99 - [1] - -
Tier 120 - - €28.39 - [1] - - - - €28.39 - [1] - - - - $29.99 - [1] - - - - $29.99 - [1] - - - - $62580 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - €28.39 - - - - €28.39 - - - - Ft&nbsp;8170 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - $450 - [1] - - - - €28.39 - [1] - - - - $29.99 - [1] - - - - 116.49&nbsp;zł - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - €28.39 - [1] - - - - £22.5 - [1] - - - - $29.99 - [1] - - - - $29.99 - [1] - - - - $29.99 - [1] - - - - $29.99 - [1] - -
Last updated: 1519101168023.
- - -

制定自己產品的價格

- -

如果要為自己的 App 或 In-app 產品定價,就必須選擇價格點數與想要銷售的地區。對 App 來說,選擇銷售國家並不會限制其他國家的消費者購買 App,只會決定 App 所將上架的國家 (可能不只一個國家)。即使消費者身處其他國家,只要付款方式亦適用 App 的上架國家,就同樣可購買該 App。

- -

價格點數表如何運作?

- -

Marketplace 將針對各種幣別預先設定匯率,再轉換為美金以外的計價並四捨五入,以更為貼近市場友善的數字。四捨五入的價格與外幣匯率的波動,都代表美金以外的定價不會隨時等值於美金現價。除非需穩定多國換匯之後的相對價格,否則美金以外的定價均將保持不動。Mozilla 也不會刻意常常調整定價,且最快每六個月才會調價一次。價格點數一般均保持在美金定價的 1% ~ 2% 之內。而由於某些國家定價另納入了增值稅,因此可能超出此範圍。

- -

含稅價與未稅價的價格點數

- -

顯示於不同地區的價格可能含稅或未稅。含稅價代表該價格已含稅 (一般為增值稅,VAT) 並顯示給消費者知道。未稅價則代表稅額 (若有對應稅額) 將另外再加至顯示的價格中。

- -

各國家與地區的增值稅略有不同,但一般均依照 App 販售國家 (由電信營運商收取) 的增值稅率而定;或是在英國適用增值稅的地區以信用卡付款,則為 20% 增值稅率。一旦消費者確定付款之後,就會根據其付款資訊中登記地區的幣別,或目前所在地區的幣別計算。

- -

如果消費者所在地區顯示的是未稅價,則當地稅額與費用將再加入 App 售價之中。消費者可能要收到發票,或由銀行/電信營運商寄發對帳單之後,才會看到實際的稅額。

- -

如何拆帳?

- -

在將自己設定為「開發者」的付款帳戶之後,即可選擇往後收款的幣別。目前支援的付款幣別包含美金 ($)、歐元 (€)、英鎊 (£)。若是含稅價格,則開發者在正常情況下會收到「消費者購買 App 金額扣除稅額與特定費用」的 70%。若是未稅價格,則會收到「消費者針對 App 定價表付款」的 70%;應付稅額另再加到消費者實際付款額之中。由於匯率浮動與增殖稅率的差異,各地區的實收金額也有所變動。

- -

而上述金額的另外 30%,將由 Mozilla、電信營運商、第三方支付供應商拆帳。其內包含商業交易程序的相關交易與服務費用。根據目前既定的分配方式,Mozilla 約將收取 5% ~ 7.5%。

- -
-

若選用電信帳單代繳方式,則開發者所能收到的款項可能又有差異。請到付款狀態了解相關細節,進一步了解該國電信營運商的拆帳規定。

-
- -

付款方式:電信帳單代繳與信用卡

- -

透過 Firefox Marketplace 販售自己 App 的絕佳優點之一,就是能直接讓消費者透過行動電話帳單付款。對信用卡尚未普及的新興市場而言,此特色絕對是目前行動付款的重要媒介。

- -

目前為止,電信營運商必須與 Mozilla 簽訂合約之後,才能在所屬地區提供電信帳單代繳的服務。消費者必須申請該電信營運商的 SIM 卡並預繳特定金額,以順利支付 App 或 In-app Payment 的款項。當然,消費者亦可透過信用卡購買 App。

- -

針對客戶透過自己行動電話號碼付費的機制,某些電信營運商另設有最低與最高額度,而且各家營運商均有不同。若 App 定價超出該額度,則款項預設轉為信用卡支付;但又並非所有消費者均擁有信用卡。又有些地區並無法和營運商值接建立帳單服務,而必須透過信用卡付款,如此就限定需以美金、歐元、英鎊購買 App。

- -
-

注意:針對信用卡部分,目前最低收費款項為 10 價格點數 (即美金 $0.99 元整);而最高款項為美金 $30.00 元整。接受 Visa® 與 MasterCard® 信用卡。

-
- -

慎防詐騙

- -

第三方支付供應商應已有多種防止詐騙的方式。為了減少詐騙行為,目前僅限消費者實際所在地銀行發行的信用卡,才能用以支付 App 購買款項。因此,消費者若持巴西境內銀行所發行的信用卡,就只能在巴西國內使用該信用卡,而不能跑到哥倫比亞境內購買 App。

- -

取得自己的收益:設定收款帳戶

- -

開發者若要能確實收到自己 App 或 In-app Payments 所創造的營收,必須先針對自己所選擇的 App 販售地區,開好當地支付供應商所提供的帳戶。各家支付供應商都具備服務條款,與 Mozilla 的服務條款不盡相同。開發者必須同意供應商的條款之後,才能透過 Firefox Marketplace 銷售自己的 App 或取得 In-app Payments 款項。

- -

你也可在 Firefox Marketplace 中設定開發者的收款帳戶。先找到 App 的「Compatibility & Payments」之後,針對你所選擇的販售地區新增收款帳戶即可。

- -
-

注意:Bango 則是 Firefox Marketplace 的支付供應商。

-
- -

收取屬於自己的款項

- -

開發者可直接與支付供應商往來,以順利取得屬於自己的款項。你會收到「自行對帳發票 (Self Billing Invoice,SBI)」,其中將列舉開發者銷售總額、消費者退費總額、開發者實際收取總額。若你的 App 販售地區可退增值稅,則總額也將包含增值稅額。

- -

你可透過自己在 Firefox Marketplace 中的開發者帳戶,找到支付供應商的付款入口網頁。由於各國電信營運商入帳時程各有不同,且消費法規也可能影響退款速度,所以帳戶的收款條件與時程也有所差異。請自行了解第三方支付供應商的相關條件與說明。

- -

稅額

- -

本章節將說明銷售稅的處理方式。

- -

增值稅 (Value Added Tax,VAT)

- -

Bango 可針對當地的稅捐機關,處理增值稅 (VAT) 的退稅問題。根據各個國家與地區的法律規定,相關徵稅與退稅的條件均有不同。開發者可向會計師或稅捐機關諮詢。而自行對帳發票 (SBI) 將根據增值稅稅前金額,開立發票給 Bango。開發者到時候觀看支付清單即可了解運作情形。如果開發者身處不屬於「販售者需支付增值稅」的地區,則應該會收到當地稅捐機關的退稅。相關細節請向會計師諮詢。

- -

預扣稅額與換匯費用

- -

Bango 可支付美金 ($)、歐元 (€)、英鎊 (£),讓開發者自行選擇適合的幣別。Bango 可能會因法條規範,為開發者預扣或繳付當地稅額,因此會從支付帳款中扣除應付稅額。各國的預扣稅率均不相同,也可能必須支付換匯費用。在將當地貨幣換成等值的美金、歐元、英鎊時,就可能產生 1.9% ~ 2.5% 的換匯費用。這項費用對開發者並不友善,而 Mozilla 也正研究是否有替代方案。

- -

開發者的收益

- -

因所在國家、當地貨幣、付款方式的不同,開發者販售 App 所獲得的收益也有所差異。可參閱付款狀態以進一步了解各國的付款細節。

diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/in-app_payments/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/in-app_payments/index.html deleted file mode 100644 index 35e3fe4117..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/in-app_payments/index.html +++ /dev/null @@ -1,332 +0,0 @@ ---- -title: 應用程式內部付費 (In-app payments) -slug: Archive/Mozilla/Marketplace/Monetization/In-app_payments -translation_of: Archive/Marketplace/Monetization/In-app_payments_section/mozPay_iap ---- -
-

navigator.mozPay API 可讓網頁內容執行數位貨品的付款作業,並能接收由付款服務商所傳來的購買確認訊息。我們也針對此 API 建構了 Web 付款服務商,讓你能取得數位貨品的款項。本文將說明該如何使用 navigator.mozPay API 與 Web 付款服務商的服務,以達到應用程式內付款 (In-app payments)。

-
-

另外現正開發「fxPay」付款處理機制。FxPay 不會要求開發者必須架設伺服器以進行購買行為驗證,可算是更完整的付款方式。

-
-
-

In-app payments 概述

-

讓你為自己的 App 添加 In-app payments 機制,與其運作的方法:

- -

navigator.mozPay API 目前限用於 Firefox OS。你同樣可透過 Firefox OS 應用程式管理員 (App Manager) 測試此 API。

-
-

注意:如果是在 Firefox OS 1.2 裝置上測試,只要該裝置內並無 SIM 卡,則 mozPay 呼叫將失敗。但消費者只要裝入 SIM 卡就可解決此問題。目前市面上販售的 Firefox OS 裝置均未安裝 Firefox 1.2。若要進一步了解,可參閱 bug 989022

-
-

逐步設定 In-app payment

-

接著說明該如何設定 In-app payment。

-

取得測試用的付款金鑰 (Payment Key)

-

在登入至 Firefox Marketplace 開發者交流中心時,可前往 In-App Payment Keys 頁面取得應用程式金鑰與安全金鑰以利測試。雖然金鑰只能讓你模擬 In-app payments,但已足以因應相關測試。在將自己的 App 提交至 Marketplace 審核之前,應該先多嘗試相關模擬。請參閱付款模擬的相關說明。

-

取得真正的付款金鑰

-

在將自己的 App 提交至 Firefox Marketplace 開發者交流中心時, 系統將要求你設定付款條件。此時請選擇 App 的價格 (你也可能想免費提供),接著勾選你接受 In-app payments 的選項。在設定自己的銀行帳戶之後,前往「Manage In-App Payments」頁面取得應用程式金鑰與安全金鑰,才能執行真正的付款作業。

-

透過隱私設定或類似檔案,可在自己的 App 伺服器中儲存應用程式安全金鑰。

-
- 重要:請確認沒有任何人可讀取你的應用程式安全金鑰。絕對不要在用戶端披露該項資訊。
-

設定 App

-

先假設你在設計某個 Open Web App 的冒險遊戲,而你想販售「魔力獨角獸」物品,讓玩家能擁有遊戲優勢。你可設定美金 $1.99、歐元 €1.89,或任何幣值均可。接著將說明該如何設定後端伺服器,並撰寫前端程式碼而透過 navigator.mozPay 銷售產品。

-

設定自己的伺服器以簽署 JWT

-

因為用來簽署的應用程式安全金鑰絕對不能公開,所以你必須在伺服端簽署 JSON Web Tokens (JWTs);而非用戶端。回到剛剛冒險遊戲要賣魔力獨角獸的例子,你要在自己的伺服器上建立如 /sign-jwt 的網址。如此可建立 JSON 物件以定義產品名稱、定價等。可參閱 Web Payment API 規格以了解完整的 JWT 格式。範例如下:

-
{
-  "iss": APPLICATION_KEY,
-  "aud": "marketplace.firefox.com",
-  "typ": "mozilla/payments/pay/v1",
-  "iat": 1337357297,
-  "exp": 1337360897,
-  "request": {
-    "id": "915c07fc-87df-46e5-9513-45cb6e504e39",
-    "pricePoint": 10,
-    "name": "Magical Unicorn",
-    "description": "Adventure Game item",
-    "icons": {
-      "64": "https://yourapp.com/img/icon-64.png",
-      "128": "https://yourapp.com/img/icon-128.png"
-    },
-    "productData": "user_id=1234&my_session_id=XYZ",
-    "postbackURL": "https://yourapp.com/payments/postback",
-    "chargebackURL": "https://yourapp.com/payments/chargeback",
-    "defaultLocale": "en",
-    "locales": {
-      "de": {
-        "name": "Magisches Einhorn",
-        "description": "Adventure Game Artikel"
-      }
-    }
-  }
-}
-

Web Payment API 規格將詳細解釋格式。此處列出幾個重點:

- -

在 Python (使用 PyJWT) 程式碼中,你可簽署並編碼上述的請求路徑如下:

-
import jwt
-signed_request = jwt.encode(request_dict, application_secret, algorithm='HS256')
-

此程式碼將為 JWT (使用應用程式安全金鑰) 進行簽章,並使用 HMAC SHA 256 演算法。在編碼過後就如下列:

-
eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.IntcImF1ZFwiOiBcIm1hcmtldHBsYWNlLm1vemlsbGEub3JnXCIsIFwiaXNzXCI6IFwiQVBQLTEyM1wiLCBcInJlcXVlc3RcIjoge1wiY3VycmVuY3lcIjogXCJVU0RcIiwgXCJwcmljZVwiOiBcIjAuOTlcIiwgXCJuYW1lXCI6IFwiVmlydHVhbCAzRCBHbGFzc2VzXCIsIFwicHJvZHVjdGRhdGFcIjogXCJBQkMxMjNfREVGNDU2X0dISV83ODkuWFlaXCIsIFwiZGVzY3JpcHRpb25cIjogXCJWaXJ0dWFsIDNEIEdsYXNzZXNcIn0sIFwiZXhwXCI6IFwiMjAxMi0wMy0yMVQxMTowOTo1Ni43NTMxNDFcIiwgXCJpYXRcIjogXCIyMDEyLTAzLTIxVDEwOjA5OjU2LjgxMDQyMFwiLCBcInR5cFwiOiBcIm1vemlsbGEvcGF5bWVudHMvcGF5L3YxXCJ9Ig.vl4E31_5H3t5H_mM8XA69DqypCqdACVKFy3kXz9EmTI
-

如上面章節所述,在 JWT 經過編碼/簽章之後,即可透過其用戶端碼而供你的 App 所使用。

-

設定購買按鈕

-

現在你已經有後端可為自己的產品產生 JWT 了。接著透過 navigator.mozPay 提供前端程式碼的撰寫範例。請確實在自己的 App 中提供按鈕,以利消費者購買產品。例如:

-
<button id="purchase">Purchase Magical Unicorn</button>
-

點選購買按鈕之後,你的 App 應會簽署 JSON Web Token (JWT) 並呼叫 navigator.mozPay。下列為 jQuery 使用範例:

-
$('#purchase button').click(function() {
-  // The purchase is now pending...
-  $.post('/sign-jwt', {})
-    .done(function(signedJWT) {
-      var request = navigator.mozPay([signedJWT]);
-      request.onsuccess = function() {
-        waitForPostback();
-      };
-      request.onerror = function() {
-        console.log('navigator.mozPay() error: ' + this.error.name);
-      }
-    })
-    .fail(function() {
-      console.error('Ajax post to /sign-jwt failed');
-    });
-});
-
-function waitForPostback() {
-  // Poll your server until you receive a postback with a JWT.
-  // If the JWT signature is valid then you can dispurse the Magical Unicorn
-  // product to your customer.
-  // For bonus points, use Web Sockets :)
-}
-

上列程式碼將送出 Ajax 請求至你伺服器上的 /sign-jwt 網址。該網址所簽署的 JSON blob 將包含產品/價格資訊,並以純文字檔回傳 JWT。而 Ajax 處理器 (Handler) 將傳送該 JWT 進入 navigator.mozPay 並等待,直到付款服務商將購買確認訊息送至你的伺服器上。若送過來的 JWT 簽章通過驗證為有效,你就可將虛擬商品交付給消費者。

-

於伺服器上處理 Postback

-

在正式販售出出自己的 App 產品之前,必須先等待 Marketplace 回傳購買確認訊息;此及所謂的「Postback」。此由 marketplace.firefox.com 傳送出「POST」確認通知 (即 1 組 JWT),至原始付款請求所指定的 request.postbackURL

-

而此「POST」具備 application/x-www-form-urlencodedContent-Type,且亦可於 notice 參數中找到此 JWT。在你的伺服器框架中,你可透過如 request.POST['notice'] 來存取此 JWT。

-

此 JWT 通知具備所有的付款請求欄位與 1 組交易 ID,並以 Firefox Marketplace 開發者交流中心取得的應用程式安全金鑰而完成簽章。當你收到 Postback 並驗證簽章之後,隨即完成購買程序。若你無法辨別 JWT 的簽章,就可能不是 Marketplace 所傳送的 JWT,你可逕行忽略。

-

Web Payment API 規格即解釋了 Postback 的細節。Postback 內含原始請求,且添增的新反應參數亦包含 Mozilla 的特定交易 ID。範例如下:

-
{
-  "iss": "marketplace.firefox.com",
-  "aud": APPLICATION_KEY,
-  "typ": "mozilla/payments/pay/postback/v1",
-  "exp": 1337370900,
-  "iat": 1337360900,
-  "request": {
-    "id": "915c07fc-87df-46e5-9513-45cb6e504e39",
-    "pricePoint": 10,
-    "name": "Magical Unicorn",
-    "description": "Adventure Game item",
-    "icons": {
-      "64": "https://yourapp.com/img/icon-64.png",
-      "128": "https://yourapp.com/img/icon-128.png"
-    },
-    "productData": "user_id=1234&my_session_id=XYZ",
-    "postbackURL": "https://yourapp.com/payments/postback",
-    "chargebackURL": "https://yourapp.com/payments/chargeback",
-    "defaultLocale": "en",
-    "locales": {
-      "de": {
-        "name": "Magisches Einhorn",
-        "description": "Adventure Game Artikel"
-      }
-    }
-  },
-  "response": {
-    "transactionID": "webpay:84294ec6-7352-4dc7-90fd-3d3dd36377e9",
-    "price": {"amount": "0.99", "currency": "CAD"}
-  }
-}
-

列出 Postback 的幾項重點:

- -

回應 Postback

-

App 必須透過純文字的 HTTP 回應 (其內僅含交易 ID),對 Postback 做出回應。例如:

-
HTTP/1.1 200 OK
-Content-Type: text/plain
-
-webpay:84294ec6-7352-4dc7-90fd-3d3dd36377e9
-

於伺服器上處理 Chargeback

-

如果交易過程發生問題 (如消費者帳戶的餘額不足),則 Marketplace 將傳送退款通知 (即 POST 過的 JWT)。Chargeback 與 Postback 同樣都會傳送到 App,但 Chargeback 送達的時間較晚。該 POST 具備 application/x-www-form-urlencodedContent-Type,且可於 notice 參數中找到該 JWT。下列為解碼後的 Chargeback 通知範例:

-
{
-  "iss": "marketplace.firefox.com",
-  "aud": APPLICATION_KEY,
-  "typ": "mozilla/payments/pay/chargeback/v1",
-  "exp": 1337370900,
-  "iat": 1337360900,
-  "request": {
-    "id": "915c07fc-87df-46e5-9513-45cb6e504e39",
-    "pricePoint": 10,
-    "name": "Magical Unicorn",
-    "description": "Adventure Game item",
-    "icons": {
-      "64": "https://yourapp.com/img/icon-64.png",
-      "128": "https://yourapp.com/img/icon-128.png"
-    },
-    "productData": "user_id=1234&my_session_id=XYZ",
-    "postbackURL": "https://yourapp.com/payments/postback",
-    "chargebackURL": "https://yourapp.com/payments/chargeback",
-    "defaultLocale": "en",
-    "locales": {
-      "de": {
-        "name": "Magisches Einhorn",
-        "description": "Adventure Game Artikel"
-      }
-    }
-  },
-  "response": {
-    "transactionID": "webpay:84294ec6-7352-4dc7-90fd-3d3dd36377e9",
-    "reason": "refund"
-  }
-}
-

此 JWT 和 Postback 類似,可於 Web Payment API 規格中參閱其定義細節。此處列出幾項重點:

- -
-

注意:目前 in-app payments 尚未支援退款作業。

-
-

App 必須透過純文字的 HTTP 回應 (其內僅含交易 ID),對 Chargeback 做出回應。舉例來說:

-
HTTP/1.1 200 OK
-Content-Type: text/plain
-
-webpay:84294ec6-7352-4dc7-90fd-3d3dd36377e9
-

Postback/chargeback 錯誤

-

若 App 伺服器是以不成功的狀態碼回應 HTTP 請求,則 Mozilla 的 Web Payment Provider 將重新嘗試 URL 數次。若仍未能接收成功回應,則 App 開發者就會收到通知,且該 App 將暫時停用。若 App 伺服器未能以交易 ID 回應 Postback 或 Chargeback,就會將該伺服器處理為錯誤並會重新嘗試。

-

使用 HTTPS Postback/chargeback 網址

-

於正式環境中執行 App 時,可依需要而嘗試使用安全的 HTTPS 網址。如此一來,在將 Postbacks 從 Mozilla 伺服器傳輸至自己的 App 伺服器時,可避免 Postback 資料遭他人讀取。目前並未強制使用 HTTPS 來保護付款請求,其實 JWT 簽章即可達到相同效果。

-
-

注意:若你並未使用安全的 HTTPS Postback 網址,則請確認自己的付款請求並未包含個人識別資訊,以免遭第三方所攔截。舉例來說,需確認自己的 productData 值並未揭露任何高敏感性的使用者資料。Mozilla 預設的付款請求亦未包含任何個人識別資訊。

-
-

Postback/chargeback IP

-

如果你依照上述方式而確實檢查了 JWT 簽章,就不需為 Firefox Marketplace 伺服器 (傳送 postback/chargeback 通知給你) 的 IP 設定許可清單。但如果你想再另加額外保險 (例如防止鍵盤側錄),則 Marketplace 也能從下列 IP 位址寄發 postback/chargeback 通知給你。只要這些 IP 位址變更,都會發佈到 dev-marketplace 郵件群組之中。

-
63.245.216.100
-

模擬付款

-

上面的「概述」部分提到,你可從 Firefox Marketplace 開發者交流中心取得特殊的應用程式金鑰 (Application Key) 與應用程式安全金鑰 (Application Secret),進而模擬 In-app payments。而這個安全金鑰亦可簽署如下的客製 JWT:

-
{
-  "iss": APPLICATION_KEY,
-  "aud": "marketplace.firefox.com",
-  "typ": "mozilla/payments/pay/v1",
-  "iat": 1337357297,
-  "exp": 1337360897,
-  "request": {
-    "id": "915c07fc-87df-46e5-9513-45cb6e504e39",
-    "pricePoint": 10,
-    "name": "Magical Unicorn",
-    "description": "Adventure Game item",
-    "icons": {
-      "64": "https://yourapp.com/img/icon-64.png",
-      "128": "https://yourapp.com/img/icon-128.png"
-    },
-    "productData": "user_id=1234&my_session_id=XYZ",
-    "postbackURL": "https://yourapp.com/payments/postback",
-    "chargebackURL": "https://yourapp.com/payments/chargeback",
-    "simulate": {
-      "result": "postback"
-    }
-  }
-}
-

額外的 request.simulate 屬性可要求 Payment Provider 模擬相關結果,而不會真正收費。使用者介面亦不會要求登入或 PIN 碼。在開發 App 時,可透過此屬性而確認「購買」鈕已正確掛上 navigator.mozPay,且自己的伺服器可正確運作 Postbacks 與 Chargebacks 的網址。

-

下列範例將模擬 1 筆成功的購買作業,並傳送簽署過的通知至你的 Postback 網址:

-
{
-  ...
-  "request": {
-    ...
-    "simulate": {
-      "result": "postback"
-    }
-  }
-}
-

下列則模擬 1 筆 Chargeback 退款:

-
{
-  ...
-  "request": {
-    ...
-    "simulate": {
-      "result": "chargeback",
-      "reason": "refund"
-    }
-  }
-}
-

將如同真正的購買作業一般,將有 1 筆 JWT 通知傳送到你的處理器,但不會有隨機產生的 transactionID。模擬作業亦可使用 non-HTTPS 網址。

-
-

注意:模擬的付款 JWT 不該用於正式的服務環境中,否則你的消費者將免費取得產品。

-
-

除錯

-

如果你並未正確使用 in-app payment API,則付款畫面將顯示錯誤訊息,以協助使用者進行後續步驟。付款畫面亦將提供錯誤程式碼,協助開發者找出相關錯誤。你可透過 Mozilla 的 Error Legend API,在自己慣用的程式語言中觀看錯誤代碼。舉例來說,錯誤代碼 INVALID_JWT 即表示 JWT 簽章無效,或 JWT 格式混亂。

-

保護應用程式安全金鑰

-
-

警告:請確認沒有任何人可讀取你的應用程式安全金鑰。絕對不要在用戶端披露該項資訊

-
-

撤銷遭盜用的應用程式安全金鑰

-

雖然遭盜用的機率極低,但你的安全金鑰仍可能外洩或遭盜用,這時應儘快進行下列撤銷步驟:

-
    -
  1. 登入 Firefox Marketplace
  2. -
  3. 前往「My Submissions」並找到自己的 App。
  4. -
  5. 前往「Manage In-App Payments」頁面;就是產生自己所屬憑證 (Credentials) 的相同頁面。
  6. -
  7. 點擊「Reset Credentials」按鈕。
  8. -
-

在重設自己的憑證之後,其他人就無法以舊憑證處理付款作業。你會看到新的應用程式金鑰與安全金鑰,並可立刻用來處理自己 App 中的付款流程。

-

若要回報任何安全性問題,請填寫 Payments/Refunds 分類下的錯誤

-

程式碼函式庫

-

下列為 Mozilla 的 navigator.mozPay 專屬函式庫:

- -

Here are some generic JSON Web Token (JWT) libraries for encoding/decoding and signature verification:

- -

範例程式碼

- -

尋求協助

- -

類似的付款系統

- diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/index.html deleted file mode 100644 index ed0b227445..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: 讓 App 產生實質收益 -slug: Archive/Mozilla/Marketplace/Monetization -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Marketplace/Monetization ---- -
-

你努力打造出自己的 App,又該如何在發佈之後取得實質收益呢?不論你選用 Marketplace 付款或應用程式內部付費機制 (In-app payments),本頁將提供所有相關的 App 付款資訊。

-
-
-
-
-
- 用自己的 App 獲益
-
- 透過自己 App 獲益的相關要素介紹,包含所需的工具。
-
- Marketplace 付款
-
- 了解 App 將如何搭配 Firefox Marketplace,以強化自己的銷售模式 (如果你的是付費 App,更能提升自己的收入)。
-
- In-app payments
-
- 說明應如何在自己的 Web App 中建構 In-app payments
-
- 檢驗收據
-
- 檢驗自己 App 購買收據的時機與方式。
-
- App 定價列表
-
- 內有價格點數 (Price point),可讓開發者為自己的付費 App 設定售價,並根據不同的幣別各對應不同的價格點數;另有處理 App 付款的相關資訊。
-
- 付款狀態
-
- 提供目前有哪些國家已經設定 Marketplace 的 App 付款服務完畢,基本上也代表這些國家已可銷售付費 App。
-
-
-
-
Tools for app developers
- -
Technology reference documentation
- -
Getting help from the community
-

If you still aren't sure how to do what you're trying to get done, feel free to join the conversation!

- -

Don't forget about the netiquette...

-
-
-

 

diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/introduction_monetization/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/introduction_monetization/index.html deleted file mode 100644 index 1c5993a876..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/introduction_monetization/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: 介紹 ─ 應如何讓 App 創造收益 -slug: Archive/Mozilla/Marketplace/Monetization/Introduction_Monetization -translation_of: Archive/Marketplace/Monetization/Introduction_Monetization ---- -
-

你努力打造出自己的 App,又該如何在發佈之後取得實質收益呢?不論你選用 Marketplace 付款,或是應用程式內部付費機制 (In-app payments),本頁將提供所有相關的 App 付款資訊。

-
-
-
-
-
- 用自己的 App 創造收益
-
- 將說明該如何用自己的 App 創造收益,包含付費式 App、定價、付款作業處理。
-
- App 付款指南
-
- 說明付費式 App 的相關技術。
-
- 應用程式內付款 (In-app payments)
-
- 說明該如何在自己的 Web App 中建構 In-app payments 功能。
-
- 檢驗收據
-
- 檢驗自己 App 購買收據的時機與方式。你可自行建構檢驗機制,亦可使用現有的函式庫。
-
- 制定 App 的價格
-
- 可為自己的 App 選擇固定的「價格點數 (Price points)」,且價格點數跨不同幣別也有所差異。本文將提供 App 付費資訊。
-
- 付款服務狀態
-
- 總結目前有哪些國家已經支援我們的 App 付款服務。另提供可發佈 App 上架的國家列表。
-
-
-
-
Tools for app developers
- -
Technology reference documentation
- -
Getting help from the community
-

If you still aren't sure how to do what you're trying to get done, feel free to join the conversation!

- -

Don't forget about the netiquette...

-
-
-

 

diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/payments_status/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/payments_status/index.html deleted file mode 100644 index 25726a4fb5..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/payments_status/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 付款服務狀態 -slug: Archive/Mozilla/Marketplace/Monetization/Payments_Status -translation_of: Archive/Marketplace/Monetization/App_pricing ---- -
-

Firefox Marketplace 付款服務均以「國家」為單位進行,且各國有不同的定價與付款方式。本文列出已開始 Marketplace 付款服務的國家,並附上進一步資訊的連結。

-
-
-

注意:另請參閱《制定 App 的價格》以了解價格點數,並可透過 API 取得

-
-

各國的付款服務

-

下列為 Marketplace 目前提供付款服務的國家。我們亦隨時努力於更多國家提供付款服務。若需要現已支援付款服務的國家清單,可參閱《制定 App 的價格》。

-

App 支付

-

下列頁面將提供各國的付款服務資訊。另請注意,目前出帳作業僅支援當地貨幣;信用卡付款僅接受英鎊、美金、歐元計價。

- -

進一步了解收費費率

-

若要進一步了解收費費率,請至 Firefox Marketplace 找到你自己的 App 頁面。點擊「相容性與付款 (Compatibility & Payments)」→「新增、管理或檢視您的付款帳號中的交易 (Add manage or view transactions for your payment account)」→「檢視交易 (View Transactions)」連結,即如下所示。

-

Transactions link

diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/profiting_from_your_app/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/profiting_from_your_app/index.html deleted file mode 100644 index b66295dcee..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/profiting_from_your_app/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: 用自己的 App 創造收益 -slug: Archive/Mozilla/Marketplace/Monetization/Profiting_from_your_app -translation_of: Archive/Marketplace/Monetization/Profiting_from_your_app ---- -
-

開發 Web App 不只有趣,也是將自己熱情轉為實質收益的絕佳方式!本篇文章將介紹 App 付款的相關主題、說明目前已經建構的付款類型 ─ 包含付款購買 App 與應用程式內部付費 (In-app payments),以及該如何處理不同國家內所發生的交易。

-
- -

Firefox Marketplace 是專為 Web App 開發者所設計的絕佳市集,可支援付費/免費 App 與 In-app payments、多款裝置平台的 App,還有更多特色。Firefox Marketplace 具備高競爭力的定價系統,讓消費者能選用自己喜歡的付款方式。並由付款服務供應商處理付款程序,可透過消費者的信用卡或行動電話帳單收取款項。

- -
-

注意:可參閱《Marketplace 常見問題》的〈付款〉一章,了解 Marketplace 付款方面的常見問題。

-
- -

設定付費 App

- -

完全可由開發者自行決定 App 收費與否,而且將 App 提交至 Firefox Marketplace 的程序極為相似。Firefox Marketplace 目前支援二種 App 付款模式:

- - - -

若將 App 定位為付費 App,則開發者會有不同的選擇並需制定價格;消費者也會在開始下載時完成付費。另請注意,因為必須經過 Marketplace 驗證並正確安裝 App,所以目前僅有 Firefox OS 才支援付費 App。在建構付費 App 時,可參閱《App 付款指南》進一步了解其內部的必要程式碼。

- -

如果開發者是透過 Marketplace 收款,則消費者付款之後即可收到電子收據。開發者必須負責查驗電子收據,確認自己的 App 已正確收款。一般只要啟動 App 時就完成了查驗作業。可參閱《查驗收據》以進一步了解。

- -

Mozilla 強烈建議開發者應在收費之前,讓消費者能預覽/試用 App 的功能。只要同時提供單一 App 的免費與付費版本,或透過 In-app payments 都能達到上述目的。

- -

In-app payments

- -

In-app payments 讓消費者可在 App 中付款,亦即透過 App 而靈活收取多樣數位版商品與服務的款項。且 In-app payments 讓開發者強化現有 App 即可獲得更高收益;而消費者也不需再另外購買新的 App。

- -

舉例來說,In-app payments 可用於:

- - - -

Mozilla 與 Google 的 In-Apps Payments 系統運作模式極為相似。Firefox Marketplace 系統如下:

- - - -

Firefox Marketplace 另提供 JavaScript 公用程式函式庫,可協助完成購買程序。

- -

免費增值 (Freemium) App

- -

若開發者想將付費版本的 App 拿掉數項功能而成為免費版本,以供消費者可預覽/試用該 App,則 Mozilla 也同樣支援此一需求。開發者可在「免費版 App」的「詳細資訊」區塊中,找到「upsell」加入付費升級的功能,即可銜接免費與付費版本的 App 並簡化此「免費增值」模式。

- -

退款

- -

一旦消費者要求退款,則可能由 Mozilla、付款服務供應商,或電信營運商授權退款作業。根據各地的消費規範、信用卡退款政策、電信營運商退款政策等的差異,退款授權方式亦有所不同。此外,Mozilla 並無法處理 In-app payments 的退款作業。

- -

一旦 App 購買行為退款完畢,所對應的收據也隨即失效。因此,開發者應隨時查驗收據以確保 App 是否正確授權批准。若任何 App 發生不尋常的大量退款要求,將由 Mozilla 進一步查驗。

- -
-

注意:應用程式內部付費 (In-app payments)》提供 In-app payments 作業的豐富訊息與範例程式碼。目前 In-app payment 程序尚在實測階段,請隨時參閱更新訊息。

-
- -
-

注意:若 App 使用 In-app payments 機制,則 Mozilla 建議該 App 可設定為免費下載 App。當然付費 App 同樣可使用此機制。

-
- -

定價與款項給付

- -

App 內部應使用正確的程式碼,且最好透過 Marketplace 檢驗 App 較為穩當。但你心裡可能還是會想著系統是如何跨國處理這些款項。

- -

Firefox Marketplace 所列出的 App,都是由付款服務供應商負責販售。這些付款服務供應商將負責處理交易、收取營業稅與增值稅 (VAT)、確認符合當地消費法規、相關出納/退款作業,以及其他應盡的零售作業。Mozilla 則是提供買家 (即 App 使用者) 與賣家 (App 開發者) 的交流場所,但完全不參與交易活動。而 Bango 則是 Firefox Marketplace 的付款服務開發商。

- -

付款處理商另負責買家 (即 App 使用者) 與賣家 (App 開發者) 之間的交易過程,包含信用卡處理在內的大小事。付款處理商一般會逐筆交易收取服務費用。開發者必須透過 Firefox Marketplace 開發者交流中心 (Firefox Marketplace Developer Hub),於各家付款處理商建立自己的帳戶。

- -

為了維持 Firefox Marketplace 的運作、不斷提升 App 平台、實踐我們的使命,Mozilla 與合作夥伴將針對各筆交易拆帳,並另外支付交易費用。目前,若開發者是透過 Marketplace 進行交易,則每筆 App 或 In-app 銷售活動均可獲得 70% 的銷售金額 (此為必要費用與稅後總額,均已包含於消費者所看到價格之中)。而 Mozilla 與合作夥伴則收取 30%。

- -

Firefox Marketplace 未來將支援更多國家、語言、幣別。我們亦將設法提供多個語系的 Marketplace,並搭配各國所適用的付款方式。

- -

進一步了解:

- - diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/validating_a_receipt/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/validating_a_receipt/index.html deleted file mode 100644 index 8ad877280b..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/validating_a_receipt/index.html +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: 驗證收據 -slug: Archive/Mozilla/Marketplace/Monetization/Validating_a_receipt -translation_of: Archive/Marketplace/Monetization/Validating_a_receipt ---- -
-

如果你的是付費 App,就應該檢查消費者的收據是否有效。如果開發者完全不檢查,則可能會有消費者購買 App 之後立刻退款,就變成免費取得 App 了;或可能直接從你的網站參照 manifest 檔案,就能安裝 App。如果開發者要建構收據驗證機制,可參閱本文提供的程式碼與作業流程。

-
-

收據 (Receipt) 即為消費者的 App 購買證明。收據將經由付款處理機制 (由消費者完成的交易) 產生確認資料 (Affirmation),以取得特定的數位產品。在消費者付費購買 Firefox Marketplace 上的 App 之後,收據就隨即傳送到消費者的裝置之中。位於消費者裝置上的收據,將用在 mozApps.install() 函式的第二組參數之上。Firefox Marketplace 將使用該筆收據資料,進而呼叫 install() 以完成 App 的安裝。

-

驗證收據的時機

-

開發者必須決定 App 該何時驗證收據。一般都是在消費者啟動 App 時開始驗證。如果是屬於長時間執行 App,則可以定時/定期進行驗證。例如影片串流 App 就可以每隔 20 分鐘檢查收據 1 次。

-

另請注意,如果消費者為離線狀態,App 也就無法驗證收據。開發者可決定 App 在離線時所進行的作業。為了避免打擾某些消費者,開發者可停止強制的收據驗證作業 (消費者可能進入隧道而暫時離線),只要等消費者上線時再次檢查即可。

-

如何驗證收據

-

最簡單就是使用 Firefox Marketplace 的驗證服務即可。如果你的 App 屬於「HTML-only」,也就是伺服器只會提供靜態檔案,則可使用 Mozilla 的「receiptverifier」JavaScript 函式庫。此函式庫基本上只會將 receiptverifier.js 指令碼加入 App 之中,並使用 verifyReceipts() 函式。可參閱上述連結以進一步了解。

-

收據內容

-

Open Web App 所使用的收據,均為可攜式、可驗證的「Token」購買證明,即所謂 JSON Web Token (JWT) 的數位簽署 JSON 資料架構,且此格式可讓所有用戶端與伺服器讀取。許多程式語言均提供 JWT 函式庫。

-

應接受的收據

-

收據就是付款的證明,但 App 開發者可決定自己想要的收據類型。以下是你該檢查的要項:

- -

receipt verifier 函式庫可進行其中數項檢查。

-

測試用收據

-

在開發期間,Firefox Marketplace 即可協助發出測試用收據,以供完整測試 App 的相關付款程序。可透過 Firefox 開發者交流中心 (Firefox Developer Hub) 的公用程式頁面產生測試用收據。此種收據將具備「test-receipt」的 typ。且 App 只會在開發期間接收這類收據,一旦上架之後就停止接收;否則消費者可略過 App 銷售程序,直接使用測試用收據。

-

receipt verifier 函式庫預設不會接收 test-receipts

-

收據驗證

-

在沒有 JWT 函式庫的情況下,開發者也能在收據的 verify 欄位中,找到驗證服務的對應網址,並將收據傳送給驗證服務。各個 App 均具備不同的 Firefox Marketplace 驗證服務網址。

-

下列範例程式碼可於收據中顯示 verify 網址。該程式碼將用於 Firefox 的「網頁主控台 (Web console)」開發者工具。

-
var request = navigator.mozApps.getSelf();
-request.onsuccess = function() {
-  // Get the app's receipt and decode it
-  console.log(atob(request.result.receipts[0].split('~')[1].split('.')[1]));
-};
-

為了取得 verify 網址,此範例將近行下列作業:

- -

接著是上述程式碼結果的完整範例。此即為扣除 JWT 部分的完整收據。

-
{
-  "product": {
-    "url": "http://example.com",
-    "storedata": "id=111111"
-  },
-  "iss": "https://marketplace.mozilla.org",
-  "verify": "https://receiptcheck.marketplace.mozilla.org/verify/111111", // The verify URL
-  "detail": "https://marketplace.mozilla.org/en-US/purchases/111111",
-  "reissue": "https://marketplace.mozilla.org/en-US/app/example/purchase/reissue",
-  "user": {
-    "type": "directed-identifier",
-    "value": "1234-abcd99ef-a123-456b-bbbb-cccc11112222"
-  },
-  "exp": 1353028900,
-  "iat": 1337304100,
-  "typ": "purchase-receipt",
-  "nbf": 1337304100
-}
-

在開發者取得 verify 網址之後,就可透過 POST 函式,在訊息主體之內傳送完整的 JWT。驗證服務的回應即如上方所述。下列程式碼片段 (snippet),將從上列範例中取得 App 第一筆收據的完整 JWT。

-
request.result.receipts[0]
-

請注意,上述程式碼並不會處理 JWT 的加密部分。如果你要透過 Marketplace 驗證收據,則收據將檢查本身的加密簽章。

-
-

注意:可在 Kumar McMillan 提供的 Private Yacht 範例中,找到其他更高擴充性的收據驗證範例。

-
-

App 盜版問題

-

即使你驗證了自己付費 App 的收據,還是可能有人繞過收據機制而盜用 App。上列的收據驗證函式並無法避免此問題。

-

如果想要更好的防盜版機制,就必須設定代理伺服器,將之作為 App 與 Firefox Marketplace 之間的媒介。代理伺服器可檢查收據、IP 位址,還有更多物件。如果單一收據來自於不同的 IP 位址,且能一樣執行正確動作,則伺服器就可進行類似通知的作業。如果是大型、複雜、使用伺服器處理功能的 App,就能達到更適當、更正確的設定。

-

此 Python 程式碼仍是開發中的專案,可提供某些代理伺服器的靈感。Django Receipts 則是測試用的代理伺服器,可驗證收據。開發者最好不要直接將之作為正式運行的代理伺服器,但可進行測試以了解相關機制。另可參閱更多資訊,讓自己了解收據驗證作業。

-

收據欄位

-

收據應包含下列欄位:

-
-
- typ
-
- 可供識別收據類型的字串,必為以下之一: -
    -
  • purchase-receipt ─ 交易完成之後隨即發出的收據。這類收據應隨時能由 App 接收。
  • -
  • developer-receipt ─ 由 App 開發者所發出的收據。一般是開發者交由自己使用的 App 商店所發出。這類收據有效期較短。
  • -
  • reveiwer-receipt ─ 由 App 審查者所發出的收據。一般是 App 審查者透過其所位於的商店發出。這類收據只需要在審查期間接收即可,有效期較短。
  • -
  • test-receipt ─ 在開發期間用以測試 App 所發出的收據。只要是開發期間以外,均不應該接收這類收據,有效期較短。
  • -
-
-
- product
-
- JSON 物件在識別產品時,包含收據所囊括的範圍,以及任何特定商店的資料。包含下列欄位: -
    -
  • url ─ 代表該網址的根網域 (root of a domain),且沒有最後的斜線 (例如「https://someapp.com」)。一般這樣就代表了 Web App。如果是以根網域開頭的其他網址,則代表「App 內購買」。只要開發者或收據開立者覺得方便,則可使用各種路徑規則 (Path scheme)。
  • -
  • storedata ─ 此字串為 App 所獨有,將提供給收據驗證器 (Verifier) 所用。
  • -
-
-
- user
-
- 針對完成購買作業的消費者,此 JSON 物件包含了使用者 ID,並包含下列欄位: -
    -
  • type ─ 此字串內有「directed-identifier」值。
  • -
  • value ─ 此字串即為消費者的專屬 ID。消費者每次購買 App,都會擁有不同的 ID。
  • -
-
-
- iss
-
- 發出收據的商店,其所屬之網域。
-
- nbf
-
- 完成購買程序之後,顯示「Not-before」的時間戳記。時間戳記是從 1970-01-01T00:00:00Z (UTC, RFC 3339) 開始的秒數。
-
- iat
-
- 發出收據之後,顯示「Issued-at」的時間戳記。此時間戳記的格式如同 nbf。可透過此數值決定收據的存在時間。
-
- exp
-
- (選填) 代表收據過期的時間戳記。此時間戳記的格式如同 nbf
-
- detail
-
- (選填) 網址包含額外人、機均可讀取的購買細節。如果另提供購買行為的交易記錄或退款功能,則本頁亦應包含相關函式。
-
- verify
-
- (選填) 由經過授權的 App 使用此網址,以驗證收據。另請注意,Firefox Marketplace 一定會為 App 提供此欄位。如果開發者想自己建立 App 的商城,就可能不需使用此欄位。
-
- reissue
-
- (選填) 網址可重新發出新收據。
-
diff --git a/files/zh-tw/archive/mozilla/marketplace/options/hosted_apps/index.html b/files/zh-tw/archive/mozilla/marketplace/options/hosted_apps/index.html deleted file mode 100644 index 69614f7cf4..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/options/hosted_apps/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: 托管\架設式 (Hosted) App -slug: Archive/Mozilla/Marketplace/Options/Hosted_apps -translation_of: Archive/Mozilla/Marketplace/Options/Hosted_apps ---- -
-

托管\架設式 (Hosted) App 即為 Open Web App,將其所有資源 (HTML、CSS、JavaScript、manifest 檔案等) 儲存於 Web 伺服器上。本文將簡介托管\架設式 App,另有相關連結讓你從開發者的角度進一步了解相關資訊。

-
- -

與一般網站相同,托管的 Open Web App 亦透過 Web 伺服器提供其所有內容,另於 App 的根目錄中提供 App 的 manifest 檔案。manifest 檔案則具備 App 的詳細資料,如相關說明、代表 App 的圖示等等。且不論是 Firefox OS 裝置、Android 裝置,或桌上型電腦,這些詳細資料都會用於 App 的安裝作業。一旦安裝完畢,App 就會從原本的托管伺服器動態載入其內容,並可存取 Web 上的其他資源,如 Web 伺服器上的資料庫。

- -

Firefox OS 安全模型中,托管式 App 均定義為 Web App,意即這類 App 無法利用 Privileged 與內部 (即 Certified) API。若要利用這些 API,則必須以封裝式 (Packaged) App 的方式來提供 App。

- -
-

注意:Firefox Marketplace 僅支援 Firefox OS 的付費托管式,以及 Firefox OS、Firefox for Android、Firefox 的免費托管式 App。目前正開發所有平台的付費 App 支援功能。

-
- -

App 托管選擇

- -

開發者可自行選擇 App 的托管之處。如果你還沒選擇托管方式,則可考慮本段說明的常見托管選擇。

- -

GitHub

- -

如果你的 Open Web App 為靜態內容 (HTML/CSS/JavaScript,但無伺服器端的處理作業),那GitHub Pages 應該是你的不二選擇。如果你的 manifest 檔案是 .webapp 為附檔名,則 GitHub 就能用 correct MIME type 提供 manifest 檔案。

- -

一般托管解決方案

- -

動態的 Open Web App 需要伺服器端的處理作業,所以你可用任何常見的托管選擇 (像是你自己架設或可存取的 Web 伺服器)。你必須先確認 Web 伺服器具備相關功能。另有許多托管服務供應商已針對托管式 App 的需求 (如 HerokuGoogle App EngineAmazon App Hosting),量身打造出 Web 伺服器。

- -
-

注意:之前在安裝 Open Web App 時,必須滿足「一組來源僅能提供一個 App」的安全規範。但這項條件到 Firefox 34/Firefox OS 2.1 (可參閱此 FAQ 以獲得更多資訊) 已經移除。如果你仍要支援較舊版本,則可試試看在不同來源托管不同的 App (如測試\正式版本)。其中一個方法就是為 App 建立不同的子網域,或可透過 WebIDE 測試 App。可參閱〈manifest 檔案常見問題〉以進一步了解。

-
- -

測試托管式 App

- -

若要將托管式 App 安裝至 Firefox OS 模擬器或實體裝置上,以利進行測試,請參閱《應用程式管理員 (App Manager)》。你也可觀看《自行發佈 App》中所說明的步驟,透過 Web 伺服器將 App 安裝到裝置之上。

- -

發佈托管式 App

- -

現有 2 種方式可發佈托管式 App:1). 透過 Firefox Marketplace 或 2). 自行發佈。

- -

發佈於 Firefox Marketplace

- -

你可參閱《App 發佈流程》,了解應如何將托管式 App 提交到 Firefox Marketplace 之上。

- -

在你提交自己的托管式 App 之後,Marketplace 隨即根據你放在 Web 伺服器上的 manifest 檔案,產生新的「mini-manifes」檔案。只要消費者決定要安裝 App,則 mini-manifest 就會傳送到 Apps.install() 函式以安裝該 App。mini-manifest 僅會用於 App 的安裝與更新作業,並不會用於 App 執行期間。

- -

自行發佈

- -

你當然也能在 Firefox Marketplace 以外發佈托管式 App,也就是透過自己架設的 Web 伺服器。可參閱《自行發佈 App》。

- -

更新托管式 App

- -

共有 2 種方式可更新托管式 App:

- - - -

若要進一步了解在 Firefox Marketplace 上更新 App 的方法,可參閱《更新 App》;若是自行發佈的 App,則可參閱《自行發佈 App》。

- -

另請參閱

- - diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/adding_a_subdomain/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/adding_a_subdomain/index.html deleted file mode 100644 index 27d7c108df..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/adding_a_subdomain/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: 為 App 添增子網域 -slug: Archive/Mozilla/Marketplace/Publishing/Adding_a_subdomain -translation_of: Archive/Mozilla/Marketplace/Publishing/Adding_a_subdomain ---- -
-

一組來源網域僅限容納一個 App。但若要打破此限制,則可為 App 新增子網域。每個子網域就代表不同的來源,例如 app1.example.com 或 app2.example.com。建立子網域很簡單,而且大多數的網域托管服務供應商也都不額外收費。服務供應商一般會免費提供特定數量的子網域。以下即為子網域的新增範例。

-
-

新增子網域的常見步驟

-
    -
  1. 登入托管服務供應商的管理介面,找到自己所使用的網域。
  2. -
  3. 找到設定網域的頁面。
  4. -
  5. 找到可新增子網域的功能。
  6. -
  7. 新增子網域、指定子網域檔案的儲存路徑、儲存你所完成的變更。
  8. -
  9. 將自己的 App 檔案放進你在上個步驟所指定的伺服器路徑中。
  10. -
  11. 實際以瀏覽器開啟該路徑,檢驗新的子網域已確實產生。
  12. -
-

接著將說明該如何透過特定托管工具新增子網域。

-

以 cPanel 新增子網域

-

這裡提供 cPanel 建立子網域的範例。cPanel 是 Web 托管控制台,已有多家托管服務供應商採用。每個開發者的 cPanel 頁面可能因設定方式而略有不同。這裡僅提供整個介面的基本概念。

-
    -
  1. 登入 cPanel。
  2. -
  3. 往下捲動找到「Domains」區塊。 -

    -
  4. -
  5. 點擊「Subdomains」即開啟「Subdomains」頁面。 -

    -
  6. -
  7. 在「Subdomain」文字框中輸入子網域名稱。我們這裡先以「newsubdomain」為例。
  8. -
  9. 再點入「Document Root」文字框。隨著顯示的路徑,就是儲存新子網域檔案的路徑。我們這裡先以「/public_html/newsubdomain」為例。如果開發者想把 App 檔案儲存到其他位址,亦可依自己需要更改。假設你的 App 檔案位於「public_html/gamedev_com/games/coolgame/」,則可於「Document Root」文字框中鍵入該路徑。Document root
  10. -
  11. 點擊「Create」按鈕,即可收到確認訊息。
  12. -
  13. 將 App 檔案放進你指定的子網域路徑中。我們這裡先使用名為「index.html」的簡單 HTML,將顯示「This is on a new subdomain!」。
  14. -
  15. 確認新的子網域現已存在。開啟瀏覽器並輸入新的網域名稱。根據我們所使用的範例,即如下圖所示: -

    New subdomain in browser

    -
  16. -
-

以 Go Daddy 新增子網域

-

可觀看此影片,為 Go Daddy 所托管的網域添增子網域。

-
-  
diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/creating_a_store/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/creating_a_store/index.html deleted file mode 100644 index 968dce2720..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/creating_a_store/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: 設立自己的 App 商店 -slug: Archive/Mozilla/Marketplace/Publishing/Creating_a_store -translation_of: Archive/Marketplace/Options/Creating_a_store ---- -
-

任何 Web 網站若具備豐富的圖片與互動經驗,則 Web 瀏覽器可透過Mozilla 的 App 專案平台,將這類網站識別為「Web App」,進而能跨裝置安裝並同步這些網站。開發者現可透過此項特性,將已發佈的 App 整理到目錄與商店中。接著說明相關步驟。

-
-

與瀏覽器整合

-

App 平台即提供「navigator.mozApps」這個 JavaScript 物件,可作為商店與瀏覽器之間的溝通橋樑。

-

Web App 是根據其網域所辨識而得。而一個來源網域就只會有一個 App。針對目錄或商店,開發者可透過 App Installation API 與 App Management API,讓瀏覽器觸發 apps.install 函式並提示 App 的安裝作業,另提供 App 的 manifest 檔案網址,以及任何想要補充的後設資料 (metadata)。開發者可存取此筆後設資料,以查閱消費者的購買資訊、確認單一登入狀態 (SSO),或其他服務。

-

使用 getInstalled()

-

只要 App 是根據你的網域而安裝於目前的瀏覽器上,均可透過 navigator.mozApps.getInstalled() 函式取得此類 App 的清單。另請注意,開發者不會看到其他網域所安裝的 App,只會看到放在自己網域中的 App。

-

開發者可透過此函式而了解消費者安裝的 App 是否符合你的預期。即使消費者是以新帳戶登入你的網站,亦可透過「resync」功能而再次安裝既有的 App。

-

到底該不該托管?

-

針對托管式 App,商店只需該網站的 manifest 網址,即可觸發 App 的安裝作業 (apps.install)。該 App 檔案不一定要儲存於商店或目錄之下。

-

如果 App 沒有伺服器的邏輯元件 (也就是完全以用戶端 JavaScript、HTML、CSS 所建構的 App),開發者就可能會想建構出托管功能。此時必須為各 App 指派不同的網域名稱,並針對各 App 的 manifest 檔案建構伺服邏輯,才能使用托管功能。

-

如果你現在正自行托管 App 邏輯,則可輕鬆維護和消費者之間的會話 (Session),進而追蹤消費者的喜好、購買證明,或其他服務。如果你要針對遠端網站提供服務,就必須完成額外作業,才能支援分散式的認證系統。

-
-

注意:Firefox Marketplace API 內含的功能,讓開發者只耗費最小程度的心血,即可迅速設立自己的 App 商店。

-
-

 

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/index.html deleted file mode 100644 index 280345b59e..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Publishing -slug: Archive/Mozilla/Marketplace/Publishing -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Publishing/Introduction ---- -

Marketplace publishing

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/introduction/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/introduction/index.html deleted file mode 100644 index 0cdc397b2e..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/introduction/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: 介紹 — App 發佈流程 -slug: Archive/Mozilla/Marketplace/Publishing/Introduction -translation_of: Archive/Mozilla/Marketplace/Publishing/Introduction ---- -
- 你到這裡應該已經知道該如何打造成功的 App、選擇 App 發佈平台 (甚或發佈到 Firefox OS 以外的平台)、撰寫並側試過自己的程式碼。現在應該著手將 App 發表給全球的使用者知道,並於 Firefox Marketplace 上發佈。本文將引導你完成相關程序,讓你順利於 Firefox Marketplace 上發佈自己的 Open Web App,並能隨時更新檔案及有用的附加資訊。
-
-  
-
-
-

發佈指南

-
-
- 提交作業檢查清單
-
- 提交 App 前的準備工作。
-
- Marketplace 審查
-
- 審查 App 時的程序與準則。
-
- 設定付費 App 與應用程式內付款 (In-app payment)
-
- Marketplace 的相關功能,可設定付費式 App 與應用程式內的付款項目。另將說明 Firefox Marketplace 是如何使用第三方的付費服務,並建立廠商的帳戶。
-
-

策略與指南

-
-
- 圖示 (應用程式中心)
-
- 根據 Firefox OS 的不同版本,取得詳細的圖示尺寸。
-
-
-
- 圖示設計 (Mozilla 風格指南)
-
- 你的 App 或 In-app 產品圖示,必須符合圓形或方形設計。進一步參閱 Mozilla 風格指南。
-
-
-
- 隱私權政策
-
- 如果你的 App 會取得使用者的個人資料,就必須另外具備隱私權政策。指南內所提供的資訊,均必須納入你的 App 隱私權政策之中。
-
-
-
- 擷圖指南
-
- 若要讓自己的 App 在 Marketplace 順利上架,所提供的擷圖必須符合相關規範。
-
- App 測試與疑難排解
-
- 帶領你設定測試環境、實際測試  App,並解決你所發現的問題或錯誤。
-
-
-
-

提交 App

-
-
- App 提交程序指南
-
- 你已經準備好發佈第一個 App;也可能要以自己沒用過的方式封裝/發佈 App。到這裡了解該如何將 App 提交到 Firefox Marketplace 之上。
-
-

更新 App

-
-
- 更新 App
-
- 不論是要添增新功能或是修正錯誤 (當然最好不要是錯誤),定期提供 App 更新檔,才能保持 App 的能見度。本文將說明應如何透過 Firefox Marketplace 遞交 App 的更新檔案。
-
-

管理已發佈的 App

-
-
- App 管理指南
-
- 在發佈 App 之後,你可能想更改某個地方,或了解消費者對該 App 的接受度為何。本文將帶領你變更 App 的狀態、檢視統計資料、檢查於 Firefox Marketplace 上所獲得的評價。
-
-

更多工具

-
-
- 為自己的 App 添增子網域
-
- 如果要從自己的網站上提供超過 1 個的架設/托管式 (Hosted) App,就必須逐一建立子網域。本文將說明添增子網域的方式。
-
-
-
diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/managing_your_apps/app_statistics/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/managing_your_apps/app_statistics/index.html deleted file mode 100644 index 6454ca8f31..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/managing_your_apps/app_statistics/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: App 統計資料 -slug: Archive/Mozilla/Marketplace/Publishing/Managing_your_apps/App_Statistics -translation_of: Archive/Mozilla/Marketplace/Publishing/Managing_your_apps/App_Statistics ---- -
-

Firefox Marketplace 可提供 App 的多樣統計資料。本文將說明應如何取得自己 App 在 Firefox Marketplace 上的統計資料、報表資料的呈現方式,另可審閱報表內的特定資訊、可用的報表,並使用已匯出的報表資料。

-
- -

取得 App 的狀態

- -

若要取得任何已發佈 App 的狀態,須先到 Firefox Marketplace 點擊「開發者交流中心 (Developer Hub)」,再進入「我的提交 (My Submissions)」。所有已發佈的 App 都能看到 (1)「統計資訊 (Statistics)」連結。

- -

In My Submissions, for each published app you will find a link to the app's stats page

- -

報表介紹

- -

在開啟了 App 的統計資訊之後,就會進入下方的統計資料表。此頁將摘要呈現目前可用的統計報表資料。

- -

The stats dashboard provides a visual summary of your app's stats and links to the 5 reports

- -

開發者可在此頁看到下列報表:

- - - -

每組報表均為相同的基礎架構,如下所示:

- -

All reports follow the same basic structure with date selector, region selector (Installs report only) graph, JSON export option and daily summary.

- -
    -
  1. 日期選擇 — 可設定報表應顯示的開始\結束日期。
  2. -
  3. 地區選擇 (僅 Installs 報表) — 可設定報表應顯示全世界活動資料,或個別國家\地區的資料。 -
    在本文撰寫期間,此功能因資料加總功能的問題,先予以關閉。可參閱 Bug 1028448
    -
  4. -
  5. 「更新」按鈕 — 依照目前日期與地區設定,重新整理報表內容。
  6. -
  7. 按每日顯示的活動圖表。
  8. -
  9. JSON 匯出選項。
  10. -
  11. 其他按每日顯示的活動圖表。
  12. -
- -

使用匯出的資料

- -

你可能想在其他試算表應用中使用匯出的資料。目前尚無主流的試算表應用程式 (Microsoft 的 Excel、Apple 的 iWorks Numbers、OpenOffice 的 Calc) 能支援 JSON 格式的資料匯入功能。解決方案就是將 JSON 轉檔為 CSV 格式。此檔案格式可用於大多數的試算表應用程式。目前有許多 JSON to CSV 的線上轉檔功能:

- - - -

此外還有下列資源提供程式碼,讓你能針對不同的試算表應用程式,建立自動匯入功能:

- - diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/marketplace_screenshot_criteria/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/marketplace_screenshot_criteria/index.html deleted file mode 100644 index 76f2576eff..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/marketplace_screenshot_criteria/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: Marketplace 截圖準則 -slug: Archive/Mozilla/Marketplace/Publishing/Marketplace_screenshot_criteria -translation_of: >- - Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Marketplace_screenshot_criteria ---- -
-

在將 App 提交至 Firefox Marketplace 時,開發者必須提供 1 幅或更多截圖以供使用。Marketplace 另提供此類截圖的非硬性規範,可作為開發者截圖時的準則。如果 App 截圖均未能符合本篇文章所載明的規範,則可能會要求開發者提交新的截圖。

-
-

截圖概述

- -

截圖重點

- -

總而言之,截圖應該以 App 為重點,而不是 App 周圍的情境。

-

尺寸與格式

-

截圖可為 JPG 與 PNG 格式。若是較能保有原來解析度的 PNG-24 最好。如果是 JPG 格式,則應儘量使用最小幅度的壓縮並設定為最高圖像品質。

-

建議尺寸

- - - - - - - - - - - - - - - - - - - - - -
裝置規格建議的解析度
手機 -

320x480 的倍數、720x1280 的倍數;或 480x320 的倍數、1280x720 的倍數

-
平板電腦1024x768 的倍數、1280x800 的倍數
桌上型電腦1280x800 的倍數、1440x900 的倍數
-

範例

-

不要出現與 App 無關的圖素,如廣告或商標。

-

-

不要提供「手拿著裝置」的照片,或將截圖編輯到實體裝置之上。

-

-

截圖不需使用/添加裝置的邊框、不必要的文字、其他不必要的特色。

-

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/packaged_apps/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/packaged_apps/index.html deleted file mode 100644 index cf9937c110..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/packaged_apps/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: 封裝式 (Packaged) App -slug: Archive/Mozilla/Marketplace/Publishing/Packaged_apps -translation_of: Archive/Mozilla/Marketplace/Options/Packaged_apps ---- -

封裝式 (Packaged) App 屬於 Open Web App,即以 ZIP 壓縮檔納入其 HTML、CSS、JavaScript、manifest 檔案等所有資源,不像之前必須將資源置於網路伺服器之中。本篇文章將為開發者提供封裝式 App 的相關說明 。

-

封裝式 App 為 ZIP 壓縮檔,內含 Open Web App 能夠運作的所有資源,並將 manifest 檔案置於其根目錄之下,且此 manifest 檔案將提供 App 本身的說明、圖示等資訊,以利辨識出已安裝的 App。此封包接著可將 App 安裝到 Firefox OS 裝置、Android 裝置桌機之中。一旦在裝置上安裝 App 之後,仍可存取 Web 上的資源,如伺服器上的資料庫。

-

封裝式 App 另可分為三類:Web App、Privileged App、Certified App。封裝式 App 可作為任何形式的 Open Web App;Privileged 與 Certified App 則是透過數位簽章的方式,啟動 Privileged 與 Certified API。Privileged App 簽章之後即成為 Marketplace 審查流程的一部分;Certified App 則是由裝置製造商或電信營運商進行簽章。

-

封裝式 App 除了能使用 Privileged 與 Certified API 之外,也能在安裝之後更快取得裝置的資源,達到更快的首次啟動速度。基於這些特色,我們也針對 Firefox OS 裝置、Android 裝置桌機,均建議以封裝式 App 的形式提供 Open Web App。

-
-

注意:目前 Firefox Marketplace 上所支援的付費封裝式 App,僅限為 Firefox OS App。而免費封裝式 App 已可支援 Firefox OS、行動版 Firefox (Firefox for Android)、桌面版 Firefox。現正開發可支援所有平台的付費 App。

-
-
-

注意:你會在 Firefox 開發者工具的「應用程式管理員 (App Manager)」看到「manifest」中文翻譯為「安裝資訊檔」。

-
-

App 的類型

-

封裝式 App 可分為 Web App、Privileged App、Certified App,且均可對應 Firefox OS 不同程度的 App 安全性模式。接著將提供進一步資訊。

-

Web app

-

Web App 不會使用 Privileged 或 Certified API。在提交到 Marketplace 之後,App 的封包隨即簽章完成,但仍尚未執行 Privileged 或 Certified App 所使用的特殊授權程序。也因此 Web App 不能使用 Privileged 或 Certified API。這些 App 也不需要 Privileged 與 Certified App 所必備的內容安全政策 (CSP)。

-

這種封裝式 App 的 manifest.webapp 檔案中,不需要 type 欄位。其 type (web) 的預設值就是正確的值。

-

Web App 可自行發佈,或可透過 Firefox Marketplace 發佈。Web App 亦可透過架設/托管式 App 的機制對外提供。

-

Privileged app

-
-
-  
-
- Privileged app 是由 Firefox OS Marketplace 以特殊程序核准之後發出。如果任一 App 要存取裝置上的特定 Sensitive API,則可為使用者提供更高的安全性。此種 App 即等同 iOS 或 Android 平台上的原生 App。若要指定為 Privileged App,必須在其 manifest.webapp 檔案中添增 type 欄位並設定為 privileged。App 所要存取的 privileged API,均必須加入 manifest 檔案的 permissions 欄位中。
-
- Firefox OS、Web runtimes for Android、桌機,將針對 Privileged App 強制使用下列 CSP
-
-
-
-
"default-src *; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'"
-

Privileged App 僅能透過 Firefox Marketplace 發佈。

-
-
-  
-
-

Certified app

-
-
-  
-
-
-

一般第三方開發者並不會接觸到 Certified App;且 Certified App 也不會透過 Firefox Marketplace 發佈。這類 API 的長遠目標,就是要讓本身的憑證更完善、更具公信力,進而也能作為 Privileged API。如果你不是很想架構特定的 API,也可直接在 dev-webapps 郵件群組中反應。

-
-
-
- Certified App 將透過 Certified API 而存取重要的系統功能,如智慧型手機上預設的撥號鍵盤,或系統設定 App。與 Privileged App 相較,並不會用於第三方 App,所以大多數的 App 開發者可忽略此類 App。除了所有的裝置許可均為隱式許可 (Implicit permission,意即不需要外部的使用者許可) 之外,Certified 與 Privileged App 大部分均屬於相似的封裝式 App。而 Certified App 必須取得 OEM 裝置或電信營運商裝置的許可,才能讓此隱式 App 使用重要 API。若要將 App 指定為 Certified App,則需於其 manifest.webapp 檔案中添增 type 欄位並設定為 certified
-
- Firefox OS 則針對 Certified App 建構了下列 CSP: -
"default-src *; script-src 'self'; object-src 'none'; style-src 'self'"
- 與 Certified App 相較,Privileged App 則是針對 inline CSP 的影響而稍微放寬了限制。進一步了解其原因,可參閱預設 CSPBug 768029
-
- OEM 廠商與電信營運商均已將 Certified App 安裝到裝置之上。
-
-  
-
-

測試封 App

-

如果要透過 Firefox OS 模擬器 (Firefox OS Simulator),測試 Firefox OS 裝置在安裝封裝式 App 的情形,可參閱《應用程式管理員 (App Manager)》。開發者也能透過《App 發佈方式》中的步驟,從一般網頁伺服器上安裝該 App 到裝置上。另請注意,如果你要自己發佈 App,就只能安裝封裝式 Web App。

-

發佈封裝式 App

-

有兩種方式可發佈封裝式 App:透過 Firefox Marketplace 或自行發佈。

-

透過 Firefox Marketplace 發佈

-

可參閱 App Publishing,將封裝式 App 提交到 Firefox Marketplace 之上。

-

在提交封裝式 App 時,其 zip 檔案即儲存於 Marketplace 伺服器之上,且 Marketplace 將根據封裝式 App 的 zip 檔案中的 manifest,產生新的「mini-manifest」檔案。在消費者安裝 App 時,隨即將 mini-manifest 傳送至 Apps.installPackage() 函式以安裝該 App。僅安裝與更新程序才會使用 mini-manifest。App 執行期間並不會使用此檔案。

-

自行發佈

-

當然也能在 Firefox Marketplace 之外,也就是自己的網路伺服器上發佈封裝式 App。可參閱《自行發佈 App》。

-

更新封式 App

-

若要進一步了解更新作業,請參閱《更新 App》。

-

更多資訊

- diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/index.html deleted file mode 100644 index d914835648..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Policies and Guidelines -slug: Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines -tags: - - NeedsTranslation - - Structure - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines ---- -

This section contains Firefox Marketplace policies and guidelines

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/introduction/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/introduction/index.html deleted file mode 100644 index 230c5d714a..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/introduction/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: 簡介 ─ 政策與指南 -slug: Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Introduction -translation_of: Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Introduction ---- -
本文將提供 Firefox Marketplace 所用的多項政策與指南。
- -
下列政策與指南均為 Firefox Marketplace 所用:
- -
 
- -
-
-

政策

- -
-
隱私權政策
-
如果 App 需用到消費者的個人資料,就必須提供隱私權政策。
-
-
- -
-

指南

- -
-
隱私權政策
-
如果 App 需用到消費者的個人資料,則相關指南可提供 App 隱私權政策中所需的資訊。
-
- -
-
截圖指南
-
為 App 截圖的相關指南,且截圖亦可用於 Marketplace 上架展示。
-
App 測試與疑難排解
-
相關資訊將說明測試環境的設定方式,以利測試 App 並解決可能發現的問題。
-
-
-
- -

 

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/introduction/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/introduction/index.html deleted file mode 100644 index 6c505166dd..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/introduction/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: 簡介 — 制定 App 的價格 -slug: Archive/Mozilla/Marketplace/Publishing/Pricing/Introduction -translation_of: Archive/Marketplace/Publishing/Pricing/Introduction ---- -
-

本文將陸續新增相關內容,請隨時注意更新資訊。

-
- -
要讓自己的 App 透過 Firefox Marketplace 獲得收益很簡單:為自己的帳戶設定 1 或更多的付款服務供應商,再設定 App 價格與發售國家 (免費 App 也能讓消費者升級為付費版本)。如果你要使用「應用程式內付款 (In-app payment)」功能,就必須取得 API 金鑰並定義 App 內販售的產品。本文將帶領你在 Firefox Marketplace 中設定付費的Open Web App 及其內部販售產品,另提供有用的相關資訊。
- -
 
- -
-
-

設定付費 App

- -
-
付費帳戶
-
設定帳戶的付款服務供應商,才能收取 App 售出及其內部付款的收益。
-
訂價 (敬請期待)
-
設定 App 價格與銷售國家等選項。
-
以「升級」方式推廣
-
免費 App 亦可升級為付費 App。
-
- -

更多資訊

- -
-
 
-
檢驗收據
-
該如何檢查消費者是否付款購買 App。
-
價格點數
-
依國家訂價的相關資訊。
-
-
- -
-

設定應用程式內付款

- -
-
取得自己的 API 金鑰 (敬請期待)
-
為自己的 App 取得 API 金鑰。
-
定義應用程式內販售的產品
-
於 Marketplace 上設定 fxPay 的應用程式內產品。
-
- -

更多資訊

- -
-
檢驗收據
-
該如何檢查消費者是否付款購買 App 內販售的產品。
-
-
-
- -

 

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/payment_accounts/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/payment_accounts/index.html deleted file mode 100644 index e6938f4336..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/payment_accounts/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: 付款帳號 -slug: Archive/Mozilla/Marketplace/Publishing/Pricing/Payment_Accounts -translation_of: Archive/Marketplace/Publishing/Pricing/Payment_Accounts ---- -
-

如果要在 Firefox Marketplace 設定付款 App 或應用程式內付款 (In-app payment) 產品,首先就是設定 1 家或更多的付款服務供應商。本文將說明 Firefox Marketplace 搭配多家供應商的理由、提交程序中所應完成的設定,另提供各家供應商的帳號資訊。

-
- -

付款服務供應商

- -

目前配合 Firefox Marketplace 活躍中的付款服務供應商就是「Bango」,當然 Firefox Marketplace 未來將支援其他供應商。付款服務供應商可新增其他付款選項,如付款類型、電信營運商、收款國家等。另間「Boku」供應商很快就會加入 Marletplace。供應商另可透過 Marketplace 讓消費者選用其服務;但目前尚未有供應商支援此一選項。

- -
-

在交易付費 App 時,均必須透過  Firefox Marketplace 中的付款服務供應商之一。如果 App 亦提供應用程式內付款的產品,也可配合其他供應商,但開發者必須自行滿足必要的推銷與技術需求。

-
- -

供應商的功能

- -

所有的付款服務供應商必須達到下列:

- - - -

設定自己的付款帳號

- -

 Marketplace 提交程序的「相容性與付款 (Compatibility & Payments)」頁面上,找到「付款帳號 (Payment Accounts)」區塊並設定付款服務供應商。

- -

The Payment Accounts section of the Compatibility and Pricing page

- -

在設定付款帳號與供應商兩者時,所需的資訊有所不同。但同樣必備的資訊如下:

- - - -
-

在大多數的情況下,付款服務供應商也有在其他國家運作,因此會透過某些形式的國際銀行轉帳作業支付款項給開發者。這類交易都會需要收款銀行的識別代碼。常用的代碼有:

- - - -

其實只要透過 Google 查詢自己開戶的銀行名稱與匯款代碼 (可能是 SWIFT 或 BIC 或 IBAN),往往都能找到銀行的相關資訊。可在你開戶銀行的網站上尋找「跨國轉帳」、「收取海外匯款」或類似字眼。此外還有某些工具可協助你找到相關代碼:

- - -
- -

以下連結可找到付款服務供應商的設定資訊:

- - diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/promote_as_upgrade_to_free_version/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/promote_as_upgrade_to_free_version/index.html deleted file mode 100644 index d0eb6c32a4..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/promote_as_upgrade_to_free_version/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: 建議升級 App 的免費版本 -slug: >- - Archive/Mozilla/Marketplace/Publishing/Pricing/Promote_as_upgrade_to_free_version -translation_of: Archive/Marketplace/Publishing/Pricing/Promote_as_upgrade_to_free_version ---- -
-

談到 App 的相容性與付款選項時,可讓 App 的免費版本升級為付費版本,並透過 Firefox Marketplace 提出此一推銷建議。此一選項可供消費者先體驗功能有所限制的 App,在決定是否購買完整功能的版本。或是免費版本會顯示廣告,付費版本則無廣告;或可為其他類似的組合。本文章說明設定方式,並讓 Firefox Marketplace 顯示升級資訊。

-
- -

在「相容性與訂價 (Compatibility & Pricing)」頁面底部,可看到「以升級至免費版本促銷 (Promote as upgrade to free version)」區塊。而在「這個付費版本升級此附加元件 (This is a paid upgrade of)」方塊中,你可選擇要哪些免費 App 可升級為付費 App。一旦選擇對應的免費版本 App 之後,就點擊「儲存變更 (Save Changes)」。

- -

Promote as upgrade to free version section of the Compatibility & Pricing page

- -

一旦 App 通過審查並發佈於 Firefox Marketplace 之上,則免費 App 列表中就會出現下列附加資訊:

- - - -

若要進一步了解 App 的銷售方式,可參閱〈選擇自己的商業模式〉。

- -

 

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/privacy_policies/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/privacy_policies/index.html deleted file mode 100644 index 80c1bc6b62..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/privacy_policies/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: 隱私權政策制定指南 -slug: Archive/Mozilla/Marketplace/Publishing/Privacy_policies -translation_of: >- - Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Privacy_policies ---- -

隱私權極難以界定,且牽涉到法律、社會規範、使用者期望等複雜的概念。不論是 App、網站、網頁、附加元件的開發者,都必須謹慎對待使用者的隱私權以獲得信賴。Mozilla 集結相關指南並制定極佳的隱私權政策,以協助開發者建構出注重隱私權的 App。但請注意,本文並無法取代真正律師所提供的實質法律服務。

-

隱私權政策

-

隱私權政策用以闡述你對資料的處理方式。關鍵在於開發者蒐集使用儲存共用揭露個人資訊的方法。Mozilla 則集結成隱私權政策範本,讓開發者能簡單說明自己的隱私權政策。

-
https://github.com/flamsmark/privacy-policy-template
-
-

首先請參閱 README。此範本僅可協助你制定部分的隱私權政策。Mozilla 前提是協助開發者能更輕鬆制定隱私權政策,但無法保證此範本已經面面俱到。至少此範本能讓你注意到主要的隱私權問題並進一步思考。敬請使用該範本並自行強化不足的部份。

-

此範本也是很好的實作機會 (某些情況下必須兼顧適法性的問題)。開發者可透過隱私權政策讓消費者知道自己的資訊將何去何從。全世界有這麼多不同的國家,對使用者資料的蒐集、使用、儲存、揭露方式的要求也有所差異。開發者應透過律師了解不同的隱私權政策,並確實讓消費者得知自己應熟悉的要點。

-

Mozilla Marketplace 的隱私權要求

-

如果任一 App 或附加元件 (Add-on) 將蒐集消費者的資料,則開發者就必須提供隱私權政策並將之列於 Mozilla Marketplace 之中。

-

設計 App 的隱私權要點

- diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/publish_options/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/publish_options/index.html deleted file mode 100644 index c7b213c18c..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/publish_options/index.html +++ /dev/null @@ -1,145 +0,0 @@ ---- -title: 自行發佈 App -slug: Archive/Mozilla/Marketplace/Publishing/Publish_options -translation_of: Archive/Mozilla/Marketplace/Options/Self_publishing ---- -
-

開發者可能不想透過 Firefox Marketplace 發佈 App,例如你只想提供給組織內的成員、執行測試版 App,或只是自己試好玩的。本篇文章將說明開發者如何在 Firefox Marketplace 之外自行發佈 App。

-
-

 

-

Open Web App 可透過 {{ domxref("Apps.install") }} 或 {{ domxref("Apps.installPackage") }},安裝到 Firefox OS、執行 Firefox for Android 的裝置,或是執行桌面版 Firefox 的桌機之上。而這些 API 均會送出 manifest 檔案的網址,其內將敘述所將安裝的 App。因此要自行發佈 App 就必須滿足下列基本要求:

-
    -
  1. 伺服器必須裝載 App 的 manifest 檔案
  2. -
  3. 伺服器必須裝載 (架設/托管式) App,或 (封裝式) App 的 ZIP 檔案
  4. -
  5. 置於網站上的程式碼必須觸發合適的 {{ domxref("Apps.install") }} 或 {{ domxref("Apps.installPackage") }}
  6. -
-

限制

-

在自己發佈 Open Web App 之前,必須注意下列限制:

- -

自行發佈封裝式 App

-

只要在伺服器上架設/托管 ZIP 檔案與其 mini-manifest,就能自行發佈封裝式 App。而 mini-manifest 必須置於 ZIP 相同的目錄之下,以利安裝程序能識別 App。接著可建立指令碼以觸發 {{ domxref("Apps.installPackage") }},送出 mini-manifest 的細節。可參閱下方以了解:

-
    -
  1. -

    將 App 的內容壓縮為 ZIP 並命名為 package.zip。 此檔案應容納 App 的所有資源檔案,並包含 (主要) manifest 檔案。

    -
    -

    重要:請注意封裝式 App 所要壓縮的內容,不要包含檔案本身的目錄。如果你連母目錄都壓縮進去,則 manifest 檔案就位於錯誤地方,整個封裝式 App 隨即無效。

    -
    -
  2. -
  3. 建立名為 manifest.webapp 的檔案,並加入以下內容。此檔案即所謂的 mini-manifest,也是封裝式 App 壓縮檔內的精簡版 manifest 檔案。而 {{ domxref("Apps.installPackage") }} 將使用 mini-manifest,以進行 App 的安裝程序。若要進一步了解細節,可參閱下方的 Mini-manifest 欄位
    -
    {
    -    "name": "My sample app",
    -    "package_path" : "http://my-server.com/my-app-directory/package.zip",
    -    "version": "1",
    -    "developer": {
    -        "name": "A. Developer",
    -        "url": "http://my-server.com"
    -    }
    -}
    -
  4. -
  5. 建立可安裝 App 的指令碼。這裡我們使用了名為「index.html」的簡易 HTML 檔案。但你也可將指令碼新增至按鈕,或使用任何適當的函式,以於自己的網站上觸發作業。此頁面上的 JavaScript 將呼叫 Packaged App installer API ({{ domxref("Apps.installPackage") }}),並針對安裝作業的成功與否進行回呼 (Callback)。 -
    <html>
    -  <body>
    -    <p>Packaged app installation page</p>
    -    <script>
    -      // This URL must be a full url.
    -      var manifestUrl = 'http://my-server.com/my-app-directory/manifest.webapp';
    -      var req = navigator.mozApps.installPackage(manifestUrl);
    -      req.onsuccess = function() {
    -        alert(this.result.origin);
    -      };
    -      req.onerror = function() {
    -        alert(this.error.name);
    -      };
    -    </script>
    -  </body>
    -</html>
    -
  6. -
  7. 將「package.zip」、「package.manifest」、「index.html」複製到你指定的目錄中 (此範例則為 my-app-directory),即可在自己的伺服器或網站上設定檔案。
  8. -
  9. 以相容設備 (如 Firefox OS 手機) 安裝 App。只要開啟 index.html 檔案 (此範例的路徑為 http://my-server.com/my-app-directory/index.html)  就會看到系統詢問是否要安裝該 App。繼續執行安裝步驟直到完畢,接著網頁指令就會顯示安裝作業是否成功。
  10. -
-
-

秘訣:你可於本端架設/托管 1 個封裝式 App,並於裝置中進行測試。伺服器與裝置必須位於同一個網路之上,而伺服器必須能接收本端網路的請求。你只要在 mini-manifest 檔案的 package_path 中加入絕對路徑即可。只要用相同的方式,正常情況就已經納入絕對路徑 (可參閱下方)。如果要使用非標準通訊埠,例如 http://10.10.12.1:8080/package.zip,則記得應納入通訊埠的資訊。

-
-

Mini-manifest 檔案的欄位

-

如果要在 Firefox Marketplace 發佈 App,就不需擔心該如何建立 mini-manifest 檔案;Firefox Marketplace 可為開發者代勞。Marketplace 將使用 manifest 檔案中的相關資訊。可參閱《App 的 manifest 檔案》一文。

-

如果要自行發佈 App,也就必須自行建立 mini-manifest 檔案。最好就是複製「主要」的 manifest 檔案,並依需求將之更新。先複製完整內容就能輕鬆建立 mini-manifest 檔案,因其內的 nameversiondeveloperlocales 欄位必須完全相同。開發者亦可添增其他內容。mini-manifest 檔案專屬的欄位則包含 package_pathrelease_notessize

-
-
- package_path (必填)
-
- 儲存 App 壓縮檔的絕對路徑 (需為完整的網址,如  http://my-server.com/my-app-directory/manifest.webapp)
-
- release_notes (選填)
-
- App 版本資訊。在 Firefox Marketplace 的提交過程中,就必須提供此項資訊。
-
-
-
- size (選填)
-
- 以 byte 計算的 App 壓縮檔容量。而 {{ domxref("Apps.installPackage") }} 將使用此項資訊,才能在安裝過程中顯示安裝進度。
-
-

以下提供範例:

-
{
-  "name": "My app",
-  "package_path": "http://thisdomaindoesnotexist.org/myapp.zip",
-  "version": "1.0",
-  "size": 172496,
-  "release_notes": "First release",
-  "developer": {
-    "name": "Developer Name",
-    "url": "http://thisdomaindoesnotexist.org/"
-  },
-  "locales": {
-    "fr-FR": {
-      "name": "Mon application"
-    },
-    "se-SE": {
-      "name": "Min balla app"
-    }
-  },
-  "icons": {
-    "16": "/icons/16.png",
-    "32": "/icons/32.png",
-    "256": "/icons/256.png"
-  }
-}
-

此範例中的其他欄位包含:

-
-
- name (必填)
-
- App 的名稱,最長 128 個字元。
-
- version (選填)
-
- App 的目前版本。
-
- developer  (選填)
-
- 開發者的資訊,內含 nameurl 欄位。而 mini-manifest 與 manifest 檔案中的開發者資訊必須相同。
-
- locales (選填)
-
- 語系資訊,必須為 xx-YY 格式。
-
- icons (選填)
-
- App 所使用的圖示。
-
-

若要進一步了解 manifest 檔案,可參閱《App 的 manifest 檔案》。

-

自行發佈架設/托管式 App

-

與封裝式 App 相較,如果你建立內容的方式,就與 Firefox Marketplace 發佈的方式相同,則自行發佈架設/托管式 (Hosted) App 就更簡單了。基本上就是為自己的 App 建立 manifest 檔案。接著加入程式碼以觸發 {{ domxref("Apps.install") }}。此程式碼必須與上述封裝式 App 所用的相同。唯一不同點在於,你可對 manifest 檔案設立相對的參考位置。

-

另請參閱

- -

 

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submission_checklist/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submission_checklist/index.html deleted file mode 100644 index 5f029ca0c3..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submission_checklist/index.html +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: 提交作業檢查清單 -slug: Archive/Mozilla/Marketplace/Publishing/Submission_checklist -translation_of: Archive/Mozilla/Marketplace/Publishing/Submission_checklist ---- -
-

在將自己的 App 提交到 Firefox Marketplace 之前,當然該確認是否已經掌握了所有必要資源。本文則提供檢查項目與相關資訊的連結。

-
-

提交作業檢查清單

-

要完成 Firefox Marketplace 的提交程序,你需要:

-

針對封裝式 (Packaged) App

- -

針對架設/托管式 (Hosted) App

- -
-

在將 App 提交到 Firefox Marketplace 之前,可使用「測試應用程式驗證」工具來測試 manifest 檔案的正確性。

-
-
-

注意:你會在「應用程式管理員 (App Manager)」看到「manifest」中文翻譯為「安裝資訊檔」。

-
-

針對所有 App (必備)

-

架設/托管式、封裝式 App 的共通必要條件:

- -

針對付費 App 或應用程式內付款 (In-app payments)

- -

針對所有 App (非必備)

-

架設/托管式、封裝式 App 的建議條件:

- -

另外還有......

-

......你應該:

- diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/enter_your_apps_details/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/enter_your_apps_details/index.html deleted file mode 100644 index 88211b4b18..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/enter_your_apps_details/index.html +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: 輸入 App 上架時所顯示的詳細資訊 -slug: Archive/Mozilla/Marketplace/Publishing/Submit/Enter_your_apps_details -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Enter_your_apps_details ---- -
-

在將 App 上傳到 Firefox Marketplace 之後,應更新 App 的詳細資訊以利於 Marketplace 頁面上顯示。

-
- -
-

此步驟將針對 App 的預設語系版本 (英文),編輯相關細節 (如網址與說明等)。如果你有其他語系版本,或是要針對其他國家\語系而修改詳細資訊,仍必須透過標準的「編輯資訊 (Edit Listing)」選項 (可參閱 step 9)。

-
- -
-

注意:你可能會看到「manifest 檔案」的正體中文翻譯為「安裝資訊檔」。

-
- -

現在進入「提交 App、編輯 App 詳細資訊」的頁面。

- -

Edit app details page header

- -

如頁面中所示,你在 manifest 檔案中提供的 App 詳細資訊,會由系統預先填入大部分的頁面空格之中。

- -

App 圖示與網址

- -

在 manifest 檔案中提供的 App 圖示與說明,再加上檔案儲存網頁的網址,都已經列於此頁面的第一區塊內。Marketplace 將根據 App 名稱而自動產生網址,並逕行修改以成為專屬網址。你可以點擊 (1)「開啟詳細資訊頁面 (Open details page)」以檢視 Marketplace 的細節頁面,也能點擊 (2)「編輯 (Edit)」以編輯圖示與Marketplace 的網址。

- -

When the page first loads your app name and icon are displayed (based on the manifest content) along with the URL generated by Marketplace

- -

若要更改 App 的圖示,就點擊 (1) 的圖示就能瀏覽電腦上的其他圖檔。若要更改 App 詳細資訊的頁面名稱,可於 (2) 的 App 網址方塊中輸入新的值。如果你輸入目前已存在的頁面名稱,就會出現警告訊息,直到你修改完畢並點擊「繼續 (Continue)」為止。而且必須修改成有效的 App 詳細資訊頁面網址,否則就無法離開此頁面。

- -

You can (1) change the app's icon and (2) enter your own page name for the app

- -

App 說明

- -

接著下個區塊則顯示 App 的相關說明,也是直接取自於 manifest 檔案而來。你也可以依照自己需要而在「說明 (Description)」方塊中編輯說明。只要拖曳方塊右下角,就能拉大整個編輯方塊的面積。此為必填欄位。

- -

You can create a description over 1024 characters and include some HTML tags to improve formatting.

- -

與 manifest 檔案所提供的說明不同,這裡讓你編輯的說明內容可以:

- - - -

App 分類

- -

Marketplace 是以「分類 (Category)」提供 App 完整列表。開發者必須為自己的 App 勾選至少一項分類,當然也可以視需要而勾選他項適合的分類。舉例來說,如果 App 可擷取、編輯、分享照片,你當然可以勾選「Photo & Video」與「Social」兩種分類。

- -

You must pick one, but can pick 2, categories that match your app'scontent

- -

隱私權政策

- -

開發者必須提供 App 的隱私權政策,即使 App 聲稱不會蒐集個人資料,也同樣必須提供。如果 App 會蒐集消費者的個人詳細資訊,就必須提供詳盡的政策 (網頁連結或純文字均可)。你可到《隱私權政策指南》 找到的撰寫資訊。而上述「說明」欄位所支援的 HTML 標籤,也同樣可用在政策撰寫時的格式。這裡一樣拖曳 (1) 方塊的右下角,能拉大編輯方塊的面積空間。

- -

A privacy policy must be provided, even if its only to say that no personal data is collected by the app

- -

App 資訊與支援服務連結

- -

如果有 App 首頁與支援服務頁面的網址,亦可一併提供。但你至少須提供電子郵件位址,以利消費者聯絡後續支援服務。

- -

Link can be provided to any information or support pages for the app, however a support email address must be provided

- -
-

支援服務的電子郵件位址,即納入 App 於 Marketplace 上架時的公開清單中。建議你應提供專屬的電子郵件位址,而不要使用一般的免費郵件位址。

-
- -

是否支援 Flash

- -

如果你針對 Adobe Flash 而開發 Web App 的內容,則請在這裡點選「Yes」代表使用了 Adobe Flash。反之則點選「No」。

- -

Indicate whether your app has need for Flash support

- -

截圖與影片

- -

現在可為自己的 App 加上截圖與影片了。點擊 (1)「新增螢幕截圖或影片 (Add a screenshot or video)」,就能瀏覽電腦的檔案,找到對應的檔案並點選即可。若添增超過 1 支以上的檔案,就能拖曳 (2) 檔案以變更 Marketplace 中呈現的順序。亦可點擊 (3) 的刪除圖示,移除你不想要的檔案。

- -

截圖可為 PNG 或 JPG 格式,影片則為 WebM 格式。建議手機截圖為 320 x 480 px 尺寸。另可參閱《Marketplace 截圖準則》,以及《Promoting your app》的〈Videos〉進一步了解。

- -

Click Add a screenshot or video to add a new item. reorder added items and delete any unwanted items

- -

設定發佈方式

- -

你可決定在 App 通過 Firefox Marketplace 的審查之後,是要立刻上架 (發佈 App 並讓任何人都能在 Marketplace 中看到,另將納入搜尋結果),或是暫時不要發佈 (不發佈App。提醒開發者可稍後調整 App 上架情形)。

- -

Selected whether your app will be added to Marketplace as soon as it's been approved or whether you will set its visibility after approval

- -

點選「不要自動發佈我的程式 (Do not publish my app)」將可:

- - - -

「不要自動發佈我的程式」將有更多詳細資訊供你選擇,敬請期待。

- -
-

在你完成這一步驟之後,就無法編輯此選項。往後若要修改此選項,就必須提供 App 的更新檔才行。

-
- -

給審查人員看的註記

- -

最後,你可提供額外資訊給 App 審查人員觀看。特別一提,如果 App 所搭配的 Web 服務需要消費者登入才可使用,則你應提供暫時性的帳戶給審查人員試用此服務。只要拖曳方塊右下角,就能拉大整個編輯方塊的面積。

- -

Add comments to assist the reviewer review your app

- -
-

在你完成這一步驟之後,就無法編輯此選項。往後若要修改此選項,就必須提供 App 的更新檔才行。

-
- -

下一步

- -

點擊「繼續 (Contiune)」即可進到下個程序:下一步

- -

Click Continue to proceed to the next step

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/index.html deleted file mode 100644 index a6e3468169..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Submit -slug: Archive/Mozilla/Marketplace/Publishing/Submit -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit ---- -

This section describes the process for submitting an app to Firefox Marketplace

-

Residual details: https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Submitting_an_app

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/load_your_app/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/load_your_app/index.html deleted file mode 100644 index 7c657ed720..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/load_your_app/index.html +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: 將 App 上傳到 Firefox Marketplace -slug: Archive/Mozilla/Marketplace/Publishing/Submit/Load_your_app -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Load_your_app ---- -
-

在登入自己的開發者帳戶並同意開發者協定之後,就能輸入 App 的細節,再讓  Firefox Marketplace 識別其 manifest 檔案。

-
- -
-

注意:你可能會看到「manifest 檔案」之正體中文翻譯為「安裝資訊檔」。

-
- -

概述

- -

現在你進入「提交 App (Submit an App )」頁面,可進行:

- - - -

收益方式

- -

你首先應對 App 所提供的資訊,就是其收益方式。

- -
    -
  1. 針對自己的 App,點選 (1)「免費 (Free)」或「付費/應用程式內付款 (Paid / in-app)」分頁。
  2. -
  3. Select either Free if the app is free to download and use, or Paid / In-app of the app has to be purchased or contains any in-app payment options
  4. -
- -
-

如果你想先讓消費者免費下載 App,再透過 App 內部付費產品獲得收益,請點選「付費 / 應用程式內付款」。

-
- -
-

只要你點選「付費/應用程式內付款」並完成提交程序之後,就無法再將該 App 改回免費提供。但原本就點選「免費」的 App 可隨時更改為付費形式。

-
- -

平台相容性

- -

在選擇了免費\付費 App 之後,就該定義 App 所將賴以執行的作業系統與瀏覽器。

- -
    -
  1. 選擇 App 相容的平台
    - Select the OS and browser implementations the app is designed to work on.
  2. -
- -

各個平台所支援的收益方式如下。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 FreePaid /In-app
Firefox OS
Firefox for Desktop 
Firefox Mobile
- (Firefox for Android on screen 7" or less)
 
Firefox Tablet
- (Firefox for Android on screen over 7")
 
- -

上傳 App

- -

現在為 Firefox Marketplace 說明 App 類型:

- -
    -
  1. 如果為托管\架設式 App,(1) 須先輸入 App 的 manifest 檔案所在之伺服器位址 (須為完整的 URL),再點擊 (2)「驗證 (Validate)」。
    - Enter the URL for the manifest of a Hosted App
    -
    - Marketplace 就會驗證你的 manifest 檔案。 -
      -
    • 驗證完畢,點擊「繼續 (Continue)」。
    • -
    • 若 manifest 檔案的驗證結果出現錯誤或警告,也會提供完整報告的連結。請看過報告之後修正錯誤,再重新提交 manifest 檔案進行驗證。
      - If there are errors or warning as a result of validating the app's manifest a link is provided to a full report
    • -
    -
  2. -
  3. 如果為封裝式 App,則點擊「封裝 (Packaged)」分頁並點選「選擇檔案... (Select a file...)」。接著就會開啟電腦的檔案瀏覽功能,找到 App 的 zip 檔案並上傳。
    - Click Select a file to upload a packaged app's ZIP file
    - Marketplace 現已可驗證 App 的封包。 -
      -
    • 驗證完畢,點擊「繼續 (Continue)」。
    • -
    • 若封包 (ZIP) 的驗證結果出現錯誤或警告,也會提供完整報告的連結。請看過報告之後修正錯誤,再重新封包檔案之後提交以利驗證。
      - If there are errors or warning as a result of validating the app's manifest a link is provided to a full report
    • -
    -
  4. -
- -

了解 App 最低限度的 API 需求

- -

在 App 驗證完成之後,就會出現「應用程式最低需求 (App Minimum Requirements)」頁面。一開始將顯示最常用的 API 需求清單。如果有找不到的 App 需求,則點擊 (1)「檢視全部 (View all)」,再 (2) 勾選所要的需求方塊。

- -
-

消費者的裝置若不支援本頁中所選的需求,則 Marketplace 將隱藏你的 App。

-
- -

An automatically populated list of app requirements displays, click View all and add any that have been missed

- -

下一步

- -

接著可點擊「繼續 (Continue)」完成下個程序。

- -

When the details have been added to the page, clicking Continue moves onto the next step.

- -

若要了解接下來的步驟,可繼續閱讀:輸入 App 的細節

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/next_steps/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/next_steps/index.html deleted file mode 100644 index 47ef08f0d5..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/next_steps/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: App 提交程序的下一步 -slug: Archive/Mozilla/Marketplace/Publishing/Submit/Next_steps -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Next_steps ---- -
-

現在你已經上傳了自己的 App,也更新了詳細資訊。接著讓你先了解接下來將完成的步驟。

-
- -

an interface screen on the Firefox Marketplace at the start of stage 4, where you are told you can enter some more information, starting with submitting a content rating for your app.

- -

如果你的 App 有其他語言版本,你可能想在繼續下一步之前,再補充 Marketplace 上的其他詳細資訊。這時可點擊「編輯資訊 (Edit Listing)」,或參閱《Edit other localizations》進一步了解。不論如何,當然還是跟著流程一步步完成比較簡單。

- -

下一步

- -

這時可點擊「繼續 (Continue)」以進到下一步驟:《取得 App 內容分級》。

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/overview/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/overview/index.html deleted file mode 100644 index 8c00d35b23..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/overview/index.html +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: Firefox Marketplace 概述 -slug: Archive/Mozilla/Marketplace/Publishing/Submit/Overview -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Overview ---- -
-

若要讓自己的 App 在 Firefox Marketplace 上架,就必須將 App 提交到 Marketplace 並通過審查。本頁將簡述 App 提交程序。另可參閱其他頁面以了解其他步驟。

-
- -
-

若要進一步了解各個步驟,請逐一參閱各個步驟之連結,並從 Step 1 開始整個程序。而此頁下方亦提供步驟關係圖。

-
- -

另可觀看提交程序影片:http://vid.ly/8k2n4w

- -

提交程序

- -

接著就開始將 App 提交到 Firefox Marketplace 之上:

- -
-
Step 1 - 登入自己的開發者帳戶
-
- -
-
Step 2 - 上傳 App
-
「提交應用程式」頁面上: -
    -
  • 設定免費\付費 App。
  • -
  • 選擇 App 對應的平台。
  • -
  • 選擇該 App 為托管\架設式 (Hosted) 或是封裝式 (Packaged): -
      -
    • 若為托管\架設式 App,應在其 manifest 檔案中提供連結。
    • -
    • 若為封裝式 App,請上傳 package.zip 檔案,且在驗證完畢之後,確認是否符合最低 API 需求。
    • -
    -
  • -
  • 點擊「繼續」
  • -
- -
-

注意:你可能會看到「manifest 檔案」之正體中文翻譯為「安裝資訊檔」。

-
-
-
Step 3 - 輸入 App 的詳細資訊
-
-

「編輯 App 詳細資訊」頁面:

- -
    -
  • 依自己需要而修改 App 網址。
  • -
  • 依自己需要而修改 App 相關說明 (manifest 檔案中所載)。
  • -
  • 選擇 1 到 2 種分類。
  • -
  • 提供隱私權政策。
  • -
  • 若有首頁與支援服務網站,亦請提供。
  • -
  • 提供支援服務的電子郵件位址。
  • -
  • 說明該 App 是否須 Flash 支援功能。
  • -
  • 上傳至少 1 張畫面截圖或影片。
  • -
  • 提供額外說明\註記給 App 審查人員看 (如果 App 需要登入細節,應另外說明其理由)。另請注意,只有在你提交新版本 App 時,才能修改這些註記。
  • -
  • 設定 App 是否在通過審查之後立刻上架。另請注意,只有在你提交新版本 App 時,才能修改此項設定。
  • -
  • 點擊「繼續」
  • -
-
-
Step 4 - 參閱「下一步」的細節
-
「下一步 (Next Steps)」頁面上點擊「繼續」
-
Step 5 - 取得內容分級
-
「內容分級」頁面: -
    -
  • 點擊「建立 IARC 分級憑證 (Create an IARC Ratings Certificate)」以取得新的分級,另於 IARC 網站上完成分級問卷。
  • -
  • 若要進入已取得之分級,須提供 Submission IDSecurity Code
  • -
-
-
Step 6 - 更新 App 目前對應的販售國別與付款細節
-
Step 6a - 若為免費 App (且無 In-app purchases):
-
在左側選單中點擊「相容性 (Compatibility)」。依自己需要而更改 App 即將販售的國別。
-
Step 6b - 若為付費 App (或免費 App 但有 In-app payments):
-
在左側選單點擊「相容性與付款 (Compatibility & Payments)」 -
    -
  • 設定你的付款服務供應商帳戶,如 Bango 與 Boku。
  • -
  • 設定 App 價格。確認 App 是否提供應用程式內付款的產品,並選擇即將販售 App 的國別。
  • -
  • 如果本為免費 App,須付費之後才能升級為較完整功能的「專業版」App,請先設定為免費 App。
  • -
-
-
Step 6c - 若 App 包含應用程式內付款的產品:
-
-
    -
  • 在左側選單點擊「應用程式內付款 (In-App Payments)」,取得 API 金鑰與安全金鑰。(請注意,只要為 App 添增 API 金鑰與安全金鑰之後,就必須為 App 提交更新檔。可參閱 In-app payments 進一步了解)
  • -
  • 如果你使用 fxPay,則在左側選單點擊「In-App Products」,並逐一定義你的應用程式內付款產品。
  • -
-
-
Step 7 - 設定開發團隊成員 (選填)
-
在左側選單點擊「團隊成員 (Team Members)」,並依自己的需要添增團隊成員資訊。
-
Step 8 - 檢視清單 (選填)
-
在左側選單點擊「檢視清單 (View Listing)」,檢視自己在 Marketplace 上的 App 清單。
-
Step 9 - 編輯其他本地化清單 (選填)
-
在左側選單點擊「編輯清單 (Edit Listing)」,針對 App 的本地化內容而修改 App 的網址、說明、分類,或新增 Firefox Marketplace 所支援任何語系的細節。
-
- -

到此為止,你的 App 已進入審查程序。在左側選單點擊「狀態與版本 (Status and Version)」即可了解目前的審查進度。只要 App 提供應用程式內付款的產品,就必須加入 API 金鑰,且須在發佈 App 之前提交更新檔案。

- -

流程圖

- -

 

- -

- -

下一步?

- -

提交 App 完畢之後,你可能會需要:

- - diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/sign-in_to_your_developer_account/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/sign-in_to_your_developer_account/index.html deleted file mode 100644 index e46dbad938..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/sign-in_to_your_developer_account/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: 登入 Firefox Marketplace 上的開發者帳戶 -slug: >- - Archive/Mozilla/Marketplace/Publishing/Submit/Sign-in_to_your_developer_account -translation_of: >- - Archive/Mozilla/Marketplace/Publishing/Submit/Sign-in_to_your_developer_account ---- -
-

在將 App 提交到 Firefox Marketplace 之前,必須先申請開發者帳戶,登入之後再接受開發者協定。

-
- -

開啟開發者交流中心 (Developer Hub)

- -
    -
  1. 以瀏覽器開啟 Firefox Marketplace
  2. -
  3. 到 Firefox Marketplace 頁面底部點擊 (1) 開發者交流中心Footer of the Firefox Marketplace home page showing the link to the Developer Hub
  4. -
- -

開始 App 提交程序

- -
    -
  1. 在交流中心的首頁上,找到 (1) 提交您的應用程式至 Marketplace (Submit your app to the Marketplace)。
    - Developer Hub home page showing the Submit your app to the Marketplace button
  2. -
  3. 這時會出現「請登入」對話框,點擊 (1) 登入 / 註冊 (Sign in / Sign up)。
    - The Developer Hub please sign in dialog displayed over the Marketplace Developer Agreement
  4. -
  5. 接下來就看你是否註冊過 Mozilla Persona: -
      -
    • 如果你沒用過 Persona,建議你註冊:
      - The first dialog of the Create Persona process你可到這裡進一步了解 Persona -
        -
      1. 輸入電子郵件位址並點擊「Next」。
      2. -
      3. 輸入新的密碼並再次確認,點擊「Done」。
      4. -
      5. 到你剛剛提供的電子郵件信箱收取確認信。此郵件內含「Confirm your account now」的確認連結,點擊此連結。
      6. -
      7. 在接下來的頁面 (跟上述 step 2 顯示的頁面相同) 上點擊「登入 / 註冊」。
      8. -
      -
    • -
    • 如果你已經註冊過 Persona,就請確認你想登入為開發者帳戶的電子郵件位址。
      - Sign in with an existing Persona identity
      - 點擊「Sign in」。
    • -
    -
  6. -
  7. 就會看到開發者協定 (Developer Agreement)。
    - Read the developer agreement, select the option to receive information by email if you wish and agree to the agreement -
      -
    1. 請閱讀過開發者協定。
    2. -
    3. 同意往後接收 App Developer 新聞與問卷 (當然還是看你本身意願)
    4. -
    5. 點擊「同意並繼續 (Agree and Continue)」。
    6. -
    -
  8. -
- -

接著就能進到下一步:上傳你的 App

diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/updating_apps/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/updating_apps/index.html deleted file mode 100644 index 57fb423374..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/updating_apps/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: 更新 App -slug: Archive/Mozilla/Marketplace/Publishing/Updating_apps -translation_of: Archive/Mozilla/Marketplace/Publishing/Updating_apps ---- -
-

本篇文章將針對已發佈的 App (自行發佈或於 Firefox Marketplace 上發佈),說明相關更新步驟。

-
-
-

注意:如果 App 已通過 Marketplace 審查,而開發者想更改 App 的名稱,就必須再次提交 App 並重新審查。

-
-

更新托管式 (Hosted) App

-

托管式 App 本質就是網頁,因此同樣依 Web 快取的常規而運作。但開發者亦可選用如 HTML5 AppCache 的進階機制以加快啟動速度。先了解這二點之後,更新 App 所使用的一般資源大概就沒有需要特別注意的地方了。

-

但 Open Web App 在處理 manifest 檔案時就不太一樣了。某些 manifest 的變動必須經過使用者許可。但根據 Web runtime 實作的不同,較難以確定是否會啟動更新作業。

-

如果要能確實解決此問題,開發者可於 manifest 檔案中添加「version」欄位。只要檢查 navigator.mozApps.getInstalled() 函式所回傳的值,即可了解目前的版本。如果消費者並未安裝最新版本,則可透過 navigator.mozApps.install() 觸發更新作業。

-

Web runtime 並不會使用 version 的值,所以開發者可使用任何喜歡的版號設定格式。

-

另請注意,如果因更改 manifest 檔案而發生錯誤或毀損,則一旦將 manifest 檔案提交到 Firefox Marketplace 就會發現。嚴重錯誤將導致 App 無法出現在 Marketplace 之中。若是較不嚴重的錯誤,就可能會自動標定該 App 需要重新審查。

-

更新封裝式 (Packaged) App

-

封裝式 App 與托管式 App 的更新程序有所不同。在更新封裝式 App 時,開發者必須將 App 的新版 zip 檔案上傳至 Firefox Marketplace。更新過的 App 同樣要先通過審查,才能再發佈至 Marketplace 之上。如此將於 Firefox OS 手機上觸發更新作業。消費者亦可透過「Settings」App 要求進行更新。

-

若想進一步了解封裝式 App 的更新程序,可參閱下一章節。

-

更新封裝式 App 相關細節

-

接著提供封裝式 App 更新時的相關細節。如果你打算建構 App 商城,就可能必須特別注意。

- diff --git a/files/zh-tw/archive/mozilla/marketplace/submission/index.html b/files/zh-tw/archive/mozilla/marketplace/submission/index.html deleted file mode 100644 index 2ac47dd745..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/submission/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Submission -slug: Archive/Mozilla/Marketplace/Submission -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Submission ---- -

Marketplace submission

diff --git a/files/zh-tw/archive/mozilla/marketplace/submission/marketplace_review_criteria/index.html b/files/zh-tw/archive/mozilla/marketplace/submission/marketplace_review_criteria/index.html deleted file mode 100644 index efabe33036..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/submission/marketplace_review_criteria/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: Marketplace 審查準則 -slug: Archive/Mozilla/Marketplace/Submission/Marketplace_review_criteria -translation_of: Archive/Mozilla/Marketplace/Publishing/Marketplace_review_criteria ---- -
-

開發者若要透過 Firefox Marketplace 發佈 App,則必須先滿足本篇文章的所有條件。相關條件是為了均衡 Firefox Marketplace 開發者與消費者的需求所設計。開發者需要公平、一致、審查嚴格但不嚴苛的平台,以安心作為 App 的開發基礎;消費者希望 App 安全無虞、可在裝置上順利運作、確實進行 App 本身所載明的功能。下方所列的 App 條件,就是為了兼顧相關需求所設計。

-
-

先列出 Mozilla 的 App 審查原則:

- -

安全性

-

可到這裡參閱 App 安全架構的相關細節:https://wiki.mozilla.org/Apps/Security

- -

隱私性

- -

內容

- -

內容指南

-

Firefox Marketplace 將不會接受涉及下列內容的 App。且下方均為說明性的列表而非絕對的定義。Mozilla 亦將視情況而隨時更新。若 App 違反本內容指南所提及的任何內容,Mozilla 均有權立刻將該 App 自 Firefox Marketplace 中撤除。

- -

功能性

- -

使用性

- -

黑名單政策

-

Mozilla 希望永遠都不會動用到黑名單機制,但仍保留將 App 撤除下架的權利。但只要發現已發佈的 App 違反安全性、隱私性、內容規範,或是嚴重影響系統/網路效能,我們將立刻撤除該 App。在將 App 列入黑名單之前,Mozilla 均將通知該 App 的開發者 (除非我們握有特定證據,否則會假設所有開發者都是善良好公民),並由 App 審查團隊提供完整協助,妥善溝通我們所發現的錯誤並儘力解決。以下特定情況絕對會將 App 列入黑名單並撤除下架:

- diff --git a/files/zh-tw/archive/mozilla/marketplace/submission/pre-submission_checklist/index.html b/files/zh-tw/archive/mozilla/marketplace/submission/pre-submission_checklist/index.html deleted file mode 100644 index 3299054ee5..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/submission/pre-submission_checklist/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: App 測試與疑難排解 -slug: Archive/Mozilla/Marketplace/Submission/Pre-submission_checklist -translation_of: >- - Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Testing_and_troubleshooting ---- -
-

本文將說明 App 測試與疑難排解時的注意事項。

-
-

設定自己的測試環境

-

開發者可安裝多種工具,針對 Firefox OS/Open Web App 執行真正有效的測試。我們建議至少安裝下列工具:

- -

最理想的情況,當然是能用實際裝置測試自己的 App。可參閱開發者手機指南

-

測試

-

雖然 Open Web App 與網頁,均使用相同的技術和發佈方式,但因為 App 環境並不具備如 Chrome 瀏覽器的網址列或返回按鈕;且 Firefox OS 裝置也不像 Android 有實體的退回按鈕,所以使用者經驗是截然不同。以下步驟可讓開發者確保 App 達到絕佳的使用者經驗。

-
    -
  1. 安裝 App。確認 App 的圖示有出現在主畫面上,且 App 的名稱完整未遭截斷。
  2. -
  3. 啟動 App。確認能正確偵測、顯示螢幕尺寸與方向。
  4. -
  5. 確認消費者可馬上看到你的 App,而不是看到你的首頁。請記住,若消費者是從 Firefox Marketplace 上安裝你的 App,也就是購買了 App 的功能。不需再次傳送 App 功能的登錄頁面給消費者才對。理想的 App 應該讓消費者能第一眼就看到「Getting Started」或「Login」頁面。
  6. -
  7. 從頭到尾執行過 App 的主要功能。特別注意瀏覽作業的最末端,還有內容縮放時的問題。
  8. -
  9. 確認內容連結將導向 App 之外 (如連至其他網頁或 Twitter)。若要開啟新的視窗或框架,也要讓消費者能順利返回你的 App。
  10. -
  11. 在桌面版瀏覽器中,可使用適應性設計 (Responsive Design) 檢視模式檢查 App 在不同螢幕尺寸中的情況。建議檢查 320x480 ~ 1260x800 的解析度。
  12. -
-

疑難排解

- diff --git a/files/zh-tw/archive/mozilla/marketplace/submission/rating_your_content/index.html b/files/zh-tw/archive/mozilla/marketplace/submission/rating_your_content/index.html deleted file mode 100644 index 0446f0240f..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/submission/rating_your_content/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: 取得 App 內容分級 -slug: Archive/Mozilla/Marketplace/Submission/Rating_Your_Content -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Rating_Your_Content ---- -
-

Mozilla 與國際年齡分級聯盟 (International Age Rating Coalition,IARC) 合作,將所有 App 均納入適用年齡分級規範。Mozilla 關心使用者,並認為使用者應能自行選擇適合自己的內容。凡 Firefox Marketplace 內的所有 App 均必須完成 IARC 分級。Mozilla 絕對在乎、愛護所有的 App,也必須要求所有 App 或遊戲完成內容分級。在 2014 年 5 月 15 日之後,只要是未完成內容分級的 App 均將強制從 Marketplace 下架。 而 IARC 另提供免費工具讓開發者進行內容分級。

-
- -

有關 IARC 分級工具

- -

IARC 是由多間國際級的分級委員會合力運作,針對以數位方式發佈於全球的 App 與遊戲,提供了相關工具作為內容分級的基準。只要填寫簡單表格,就會立刻收到所有分級委員會所制定的分級規範。此份規範不僅可協助消費者了解 App 的內容,亦可讓開發者不需個別取得各國的內容分級,進而大幅縮減成本與不便。

- -

所支援的國際分級系統

- -

透過單一的分級精靈功能,即可產生不同系統、國家、所在地區的內容分級。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
分級系統支援國家
Classificação Indicativa Brazil
ESRBCanada, Mexico, United States
PEGIAustria, Denmark, Hungary, Latvia, Norway, Slovenia, Belgium, Estonia, Iceland, Lithuania, Poland, Spain, Bulgaria, Finland, Ireland, Luxembourg, Portugal, Sweden, Cyprus, France, Israel, Malta, Romania, Switzerland, Czech Republic, Greece, Italy, Netherlands, Slovak Republic, United Kingdom
USKGermany
通用其他所有國家適用
- -

內容分級包含哪些項目?

- -

分級系統將提供消費者三種資訊:

- - - -

分級程序僅需幾分鐘且完全免費,並已整合至 Firefox Marketplace 提交程序與開發者主控頁 (Developer Dashboard) 中。任何 App 均必須先完成分級,Mozilla 才能進行後續審查作業。消費者可在 App 說明頁面上看到 App 對應所在地區的分級,並取得自己想進一步了解的相關資訊。

- -

讓自己的 App 取得內容分級

- -

IARC 即提供免費的遊戲分級工具,且大多數的 App 都能輕鬆又快速的完成分級。接著來看看分級程序。

- -
-

注意:Mozilla 並不接受其他系統的分級認證。即使 App 已經完成其他系統的內容分級,開發者仍需要完成 IARC 認證程序。

-
- -
    -
  1. 登入 Firefox Marketplace 開發者網站。你必須以開發者的身分登入,才會看到分級工具。
  2. -
  3. -

    在 App 提交程序期間,就會進入 IARC 分級工具:

    - -

    Demonstrates where in the app submission flow where ratings can be entered.

    - -

    或可從開發者主控頁中找到分級工具:

    - -

    -
  4. -
  5. -

    開始分級程序:

    - -

    - -

    或可輸入現有分級的資訊:

    - -

    -
  6. -
  7. -

    填寫簡單的問卷:

    - -

    -
  8. -
  9. -

    添加 App 額外資訊:

    - -

    -
  10. -
  11. -

    預覽並確認分級資訊:

    - -

    -
  12. -
  13. -

    回到開發者主控頁就會看到分級資訊。接著就可準備上架!

    -
  14. -
- -
-

注意:開發者接著會收到電子郵件,內含分級認證與安全碼。請自行保留相關記錄備查。

-
- -

更多資訊

- -

如果開發者對分級程序、分級問卷填寫方式,或對分級結果有任何疑問,請寄發電子郵件至 dev-questions@globalratings.com 向 IARC 團隊詢問。另可前往全球分級網站獲得更多資訊。

- -

其他任何問題,可聯繫 Mozilla 的 App 審查團隊 mozilla.appreview

diff --git a/files/zh-tw/archive/mozilla/migrate_apps_from_internet_explorer_to_mozilla/index.html b/files/zh-tw/archive/mozilla/migrate_apps_from_internet_explorer_to_mozilla/index.html deleted file mode 100644 index 857b8f22eb..0000000000 --- a/files/zh-tw/archive/mozilla/migrate_apps_from_internet_explorer_to_mozilla/index.html +++ /dev/null @@ -1,1070 +0,0 @@ ---- -title: 轉換網頁程式:從 IE 到 Mozilla -slug: Archive/Mozilla/Migrate_apps_from_Internet_Explorer_to_Mozilla -tags: - - 待翻譯 -translation_of: Archive/Mozilla/Migrate_apps_from_Internet_Explorer_to_Mozilla ---- -

這篇文章描述 IE 與 Mozilla 瀏覽器之間在程式上的差異,協助您將 IE-only 網頁改寫為 Mozilla 通用網頁。

-

簡介

-

Netscape 當初決定要製作 Mozilla 瀏覽器時刻意決定要支援 W3C 標準,因此 Mozilla 並不能完全回溯相容 Netscape Navigator 4.x 及 Microsoft Internet Explorer 的自有程式。舉例來說,Mozilla 不支援稍候會討論的 <layer> 標籤。此外,有些在 W3C 標準觀念尚未普及前製作的瀏覽器(如 Internet Explorer 4)內含各式怪異的花招,我們稱為怪癖(Quirk),而為了相容這些舊瀏覽器的模式便稱為 Quirks 模式。本文稍後也會討論 Mozilla 的 Quirks 模式。

-

我也會闡述其他 Mozilla 支援、但還沒有 W3C 相關規格的非標準技術,如 XMLHttpRequest 及 Rich-text 編輯功能。此處指的 W3C 規格包括:

- -

跨瀏覽器程式小技巧

-

雖然這世上有所謂的 Web 標準,但不同的瀏覽器作法依然大不相同(即使是同一個瀏覽器,也可能因為作業系統差別而相異)。許多瀏覽器(如 Internet Explorer)在 W3C 規格形成前便提供某些功能,卻在標準制訂後忘了修改既有支援程式以符合標準。

-

在我闡述 Mozilla 與 Internet Explorer 相異之處前,我會先講點小技巧,讓你的 Web 應用程式容易擴充、在未來略事修改便能相容新瀏覽器。

-

不同瀏覽器下的某相同功能,往往也有不同的 API,所以在某些程式中你會發現不少 if() else() 程式區段,以便區分不同的瀏覽器。以下程式是寫給 Internet Explorer 用的:

-
. . .
-
-var elm;
-
-if (ns4)
-  elm = document.layers["myID"];
-else if (ie4)
-  elm = document.all["myID"]
-
-

上面這段程式稱不上容易擴充,如果你要多相容一種瀏覽器就得改寫一次。

-

要排除遇到新的瀏覽器就要重寫網頁碼的情形,最容易的方法,就是把功能「抽」出來。與其使用一堆 if() else(),不如將常用的程式片段獨立為一個函式以提高效率。如此一來不但程式易讀,要支援更多瀏覽器也方便些:

-
var elm = getElmById("myID");
-
-function getElmById(aID){
-  var element = null;
-
-  if (isMozilla || isIE5)
-    element = document.getElementById(aID)
-  else if (isNetscape4)
-   element = document.layers[aID]
-  else if (isIE4)
-    element = document.all[aID];
-
-  return element;
-}
-
-

以上的程式仍得處理瀏覽器偵測的問題,通常這要靠 useragent 字串來解決,例如:

-
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031016
-
-

雖然 useragent 字串提供瀏覽器的詳細資訊,但處理這段字串的程式碰上新瀏覽器時還是有可能出錯,此時便需修改程式。

-

如果瀏覽器種類無關緊要(好比你已經把不支援的瀏覽器全都擋在門外了),那麼依據瀏覽器的能力來判別會比較好一點。通常可以用 JavaScript 來測試必備的功能,舉例來說,與其使用這樣的程式碼:

-
if (isMozilla || isIE5)
-
-

還不如換條路走:

-
if (document.getElementById)
-
-

這樣也可以讓其他支援此方法的瀏覽器(如 Opera 或 Safari)正常使用,無須更動程式。

-

而依據 useragent 字串辨識瀏覽器也並非一無是處,例如在檢查瀏覽器是否符合最低需求或除錯時都有其用途。

-

JavaScript也允許順序條件語言(inline conditional statements)以助於代碼的可讀性:

-

JavaScript 也支援判斷句簡寫法,協助你將程式寫得更易讀:

-
var foo = (condition) ? conditionIsTrue : conditionIsFalse;
-
-

舉例而言,要取用某元素,可以寫為:

-
-function getElement(aID){
-  return (document.getElementById) ? document.getElementById(aID)
-                                   : document.all[aID];
-}
-
-

Mozilla 與 Internet Explorer 的差別

-

首先,我要討論Mozilla和IE在表現HTML行為上的差別。

-

工具提示(tooltips)

-

老牌的瀏覽器透過在超連結和利用 alt 屬性值的 HTML 中導入工具提示來作為工具提示的內容。 最新的 W3C HTML specification 建立了 title 這個屬性,它包含超連結的詳細說明。 現代的瀏覽器會使用 title 的屬性來顯示工具提示,而且 mozilla 只支援 title 屬性,並不支援 alt 屬性。

-

HTML 特殊字元(entities)

-

HTML 標籤可以是一些在 W3 standards body 中已定義的字元。 您可以利用它們的數值或字符來代替字元。 舉例來說,您可以利用 &#160; 或等同的字符參考資料 &nbsp; 來代替空白鍵。

-

有一些很老很老的瀏覽器,像是 Internet Explorer ,它們允許在特殊字元後面拿走;(分號(:

-
&nbsp Foo
-&nbsp&nbsp Foo
-
-

Mozilla 依然會把 &nbsp 當作空白鍵,既使這樣違反了 W3C 標準(W3C specification)。 但如果 &nbsp 後面直接跟上一些其他的字元,瀏覽器就不會轉換它。 範例:

-
&nbsp12345
-
-

這行程式碼在 Mozilla 中就不會被執行,因為它違反了 W3 標準(W3 standard)。請使用正確的格式(&nbsp;)來避免瀏覽器與瀏覽器之間的差異性。

-

DOM 差異

-

文件物件模型(The Document Object Model,簡稱DOM)是一個裝載著文件元素的樹狀結構。你可以熟練地透過已成為 W3C 標準的 JavaScript API 來操作 DOM。然而在 W3C 標準建立以前, Netscape 4 和 IE 4 實作了一些類似的 API。 Mozilla 僅在使用 W3C 標準無法達成這些 API 的效果時才予以實作。

-

存取元素

-

如果你想以跨瀏覽器的方式來取得某個元素的參考,請使用document.getelementById(aID) 方法,這個方法不僅可以在 IE 5.0+ 和 Mozilla 上正常運作,它還是 DOM Level 1 的規範。

-

Mozilla 不能夠以 document.elementName 或是元素名稱來存取元素,而 IE 可以(名為全域名稱污染)。 Mozilla 也不支援 Netscape 4 的 document.layers 和 IE 的 document.all。 而 document.getElementById 可以讓你取得某個元素,你還可以使用 document.layersdocument.all 指定一個 tag 名稱來取得一串文件元素,像是全部的 <div> 元素。

-

在 W3C DOM Level 1 的規範中,JavaScript 應透過 getElementsByTagName() 取得相同標籤(tag)下的元素。這個方法會傳回一個陣列,同時這個方法也可以呼叫 document 或其他節點下的元素。如果你想取得,你可以透過 getElementsByTagName("*") 來取得整個 DOM 下的元素陣列。

-

就如下面表格一,DOM Level 1 經常被用來移動或者隱藏元素。當一個 HTML 元素可以隨意移動時,Netscape 4 所使用的 <layer> 標籤就不被 Mozilla 支援,你可以使用如同 Internet Explorer 的 <div>。根據 HTML 規範,這個標籤可以在 Mozilla 正常運行的。

-

 

-

表格一 - 用於存取元素的方法

- - - - - - - - - - - - - - - -
方法描述
document.getElementById( aId )回傳文件中 ID 值為 aId 元素的。
document.getElementsByTagName( aTagName )回傳文件中標籤名稱為 aTagName 的元素
-

縱橫 DOM

-

Mozilla 支援透過 JavaScript 存取 DOM 樹狀圖的 W3C DOM APIs (詳見表格二)。透過他可以讀取文件中的任何一個節點。Internet Explorer 也支援這個 APIs,同時也支援一些過時的方法,像是 children

-

 

-

表格二 - 縱橫 DOM 的方法

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
屬性/方法描述
childNodes回傳一個該元素下所有子節點的陣列。
firstChild回傳該元素下的第一個子節點。
getAttribute( aAttributeName )回傳 aAttributeName 的值。
hasAttribute( aAttributeName )回傳一個關於節點 aAttributeName 是否有屬性的布林值。
hasChildNodes()回傳一個關於該節點下是否仍含有子節點的布林值。
lastChild回傳該元素下的最後一個子節點。
nextSibling回傳當下節點後的下一個節點。
nodeName回傳一個當下節點名稱的字串。
nodeType回傳該節點的類型。 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
數值描述
1元素節點(Element Node)
2屬性節點(Attribute Node)
3文字節點(Text Node)
4CDATA 段落節點(CDATA Section Node)
5實體參引節點(Entity Reference Node)
6實體節點(Entity Node)
7處理指令(Processing Instruction Node)
8註解節點(Comment Node)
9文件節點(Document Node)
10文件型別(Document Type Node)
11文件片段(Document Fragment Node)
12記法節點(Notation Node)
-
-     *譯注:目前參照 中央研究院計算中心曾士熊先生提供 SGML 名詞部份的翻譯內容,其中並不包含「文件片段(Document Fragment Node)」
-
-
nodeValue回傳當下節點的值。當節點中存在文字或文段,如文字和註解節點時,此方法會回傳他們的字串值。當節點為屬性節點(attribute node)時,此方法將會回傳屬性值。除此之外,其餘的節點類型都會回傳 null。 
ownerDocument回傳存在於當下節點的 document 物件。
parentNode回傳當前節點的父節點。
previousSibling回傳在該節點之前的節點。
removeAttribute( aName )從當前的節點中移除 aName 屬性。
setAttribute( aName, aValue )將 aName 屬性的值更改為 aValue。
-

在 Internet Explorer 中有個不正常的怪癖(quirk),上表中有許多方法會略過自動產生的空白文字節點。請注意,在 Mozilla 中這些並不會略過,所以有時候你必須區別開這些節點。每一個節點都有它的 nodeType 屬性。舉例來說,元素節點的類型是 1;而文字節點是 3、註解節點是 8(詳見表格二 - nodeType)。最好區別開這些空白文字節點的辦法就是指處裡節點類型為 1 的子節點:

-
HTML部分:
-  <div id="foo">
-    <span>Test</span>
-  </div>
-
-JavaScript部分:
-  var myDiv = document.getElementById("foo");
-  var myChildren = myXMLDoc.childNodes;
-  for (var i = 0; i < myChildren.length; i++) {
-    if (myChildren[i].nodeType == 1){
-      // 元素節點
-    }
-  }
-
-

內容建立及處理

-

Mozilla 支援一些比較舊的動態增加 DOM 內容的方法,像是

-
document.writedocument.open 和 document.close。
-
-

Mozilla 也支援 Internet Explorer 的 innerHTML 方法,這個方法可以用來處理所有的節點。即使這個方法無效,Mozilla 還支援 outerHTML (這個方法包含該元素,它與 innerHTML 有一定的差異) 和 innerText (用於存取或修改節點的文字,功能與 Mozilla 裡的 textContent 差不多)。

-

Internet Explorer 中存在著許多不規範也不被 Mozilla 的內容處理方法,包括回傳參數、插入數值和插入元素到節點中。像是 getAdjacentElementinsertAdjacentHTML 等。表格三中敘述了 W3C 定義的內容處理方法,它們適用於所有的 DOM 節點。

-

 

-

表格三 - Mozilla 使用的內容處理方法

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
方法描述
appendChild( aNode )建立一個新的子節點,並回傳新子節點的參照值。
cloneNode( aDeep )複製該節點並且傳回複製後的節點。如果 aDeep 的值「成立」,那個這個方法會把該節點下所有的子節點複製到新的節點。
createElement( aTagName )建立並回傳一個沒有母節點(即上層沒有節點)的節點。該節點的名稱為 aTagName 。
createTextNode( aTextValue )建立並回傳一個沒有母節點的文字節點,該節點值為 aTextValue。
insertBefore( aNewNode, aChildNode )把 aNewNode 插入到 aChildNode 之前。(兩者都必須在當前的節點下)
removeChild( aChildNode )移除 aChildNode 並回傳一個參照值。
replaceChild( aNewNode, aChildNode )用 aChildNode 替代 aNewNode,並且回傳一個移除節點的參照值。
-

文件片段

-

因為效能的緣故,你可以在記憶體中創建 document 而非在現存的 DOM 上做動作。 DOM Level 1 Core 引入了 document fragments,這是一個輕量化的 document 且支援了部份既有可用的 document interface。舉例來說,他雖不支援 getElementById 但卻支援 appendChild 。你可以很容易的按照現存的的 document 來創建  document fragments 。

-

在 Mozilla 中,要創造新的 document fragments 只需要使用 document.createDocumentFragment(),之後你便可取得一個空的 document fragment。

-

Internet Explorer 在實做 document fragment 上並未按照標準的 W3C standard 。倘若你在 IE 中調用此功能,只能拿回一個 regular document 而非 document fragment。

-

JavaScript 差異

-

Mozilla 與 Internet Explorer 之間最大的差別就是 JavaScript。 這些問題通常存在於瀏覽器所公佈的 JavaScript APIs,像是 DOM hooks。 這兩種瀏覽器各自佔有一部份 JavaScript 核心的差異性;這些遇到的問題通常也和時間有關。

-

JavaScript 日期差異

-

getYear 這個函數是唯一 Date 中的不同點。根據 ECMAScript specification(JavaScript 也遵循這個 specification),這個函式不是 Y2k-compliant 。假設在 2004 年時執行 new Date().getYear(),它會回傳 "104" 。根據 ECMAScript specification , getYear 會回傳年份減去 1900,原意是回傳 "98" 來表示 1998。getYear 在 ECMAScript Version 3 時被 getFullYear() 所代替。 當 mozilla 繼續遵循規範時,Internet Explorer 已經把 getYear() 修改成像 getFullYear() 的工作方式,使它成為Y2k-compliant。

-

JavaScript 執行差異

-

不同的瀏覽器使用不同的方法執行 JavaScript。舉例來說,下面的程式碼假設當 script 執行的時候 div 節點已經存在於 DOM:

-
...
-<div id="foo">Loading...</div>
-
-<script>
-  document.getElementById("foo").innerHTML = "Done.";
-</script>
-
-

無論如何,這都不能夠確定元素(elements)是否存在。要確認所有的元素都存在,您應該將 onload 事件擺在 <body> 標籤:

-
<body onload="doFinish()">
-
-<div id="foo">Loading...</div>
-
-<script>
-  function doFinish() {
-    var element = document.getElementById("foo");
-	  element.innerHTML = "Done.";
-  }
-</script>
-...
-
-

像這樣與時間相關的問題也和硬體有關-較慢的系統可以顯示出較快的系統中隱藏的臭蟲(bugs)。 window.open 是一個具體的例子:  

-
<script>
-  function doOpenWindow(){
-    var myWindow = window.open("about:blank");
-    myWindow.location.href = "http://www.ibm.com";
-  }
-</script>
-
-

這段程式碼的問題是: window.open 的時程是非同步的-它不會阻擋 JavaScript 的執行,直到所有的新視窗載入完畢。 因此,您應該在在載入新視窗完畢後才執行 window.open 。 您可以透過 在新視窗中利用 onload 執行 window.opener 來回到原本開啟新視窗的視窗(母體)。

-

JavaScript 產生之 HTML 差異

-

  在 JavaScript 中,我們可以透過 document.write 來從字串產生 HTML 程式碼。但這有個值得注意的地方在於,要是你的內嵌碼中中含有 <script> tag 會發生什麼事?當你的目標頁面處於 <a href="#html_modes">strict rendering mode</a> 下時,它將會解析位於  <script> 和  </script>  中的內容。讓我們看個例子:

-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-...
-<script>
-  document.write("<script>alert("Hello")</script>")
-</script>
-
-

  因為目前處於 strict mode 下,Mozilla 的解析器 (parser) 將會查看介於 <script> 和 </script>中的內容。這是因為在 strict mode 下解析器並不認得任何語言。但假如處在 quirks mode 下,解析器卻識得 JavaScript 語法。而事實上,Internet Explorer 總是處於 quirks mode 下 - 它並不真正之支援 XHTML。一個比較兩全其美的作法是將該內容分割成兩個部份:

-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-...
-<script>
-  document.write("<script>alert("Hello")</" + "script>")
-</script>
-
-

JavaScript 除錯

-

Mozilla provides several ways to debug JavaScript-related issues found in applications created for Internet Explorer. The first tool is the built-in JavaScript console, shown in Figure 1, where errors and warnings are logged. You can access it in Mozilla by going to Tools -> Web Development -> JavaScript Console, or in Firefox (the standalone browser product from Mozilla) at Tools -> JavaScript Console.

-

 

-

Figure 1. JavaScript console

-
- Javascript Console
-

The JavaScript console can show the full log list or just errors, warnings, and messages. The error message in Figure 1 says that at aol.com, line 95 tries to access an undefined variable called is_ns70. Clicking on the link will open Mozilla's internal view source window with the offending line highlighted.

-

The console also allows you to evaluate JavaScript. To evaluate the entered JavaScript syntax, type in 1+1 into the input field and press Evaluate, as Figure 2 shows.

-

 

-

Figure 2. JavaScript console evaluating

-
- JavaScript Console evaluating
-

Mozilla's JavaScript engine has built-in support for debugging, and thus can provide powerful tools for JavaScript developers. Venkman, shown in Figure 3, is a powerful, cross-platform JavaScript debugger that integrates with Mozilla. It is usually bundled with Mozilla releases; you can find it at Tools -> Web Development -> JavaScript Debugger. For Firefox, the debugger isn't bundled; instead, you can download and install it from the Venkman Project Page. You can also find tutorials at the development page, located at the Venkman Development Page.

-

 

-

Figure 3. Mozilla's JavaScript debugger

-
- Mozilla's JavaScript debugger
-

The JavaScript debugger can debug JavaScript running in the Mozilla browser window. It supports such standard debugging features as breakpoint management, call stack inspection, and variable/object inspection. All features are accessible through the user interface or through the debugger's interactive console. With the console, you al can execute arbitrary JavaScript in the same scope as the JavaScript currently being debugged.

-

CSS 差異

-

與 Internet Explorer 和其他的瀏覽器比較之下, Mozilla 擁有最強大的 Cascading Style Sheets 4(即 CSS) 支援, 包含大部份的 CSS1、CSS2 和部份的 CSS3 。

-

對於下列敘述的問題, Mozilla 會在 JavaScript 控制台中發出警告。 如果您遇到了 CSS 的相關問題,請確認 JavaScript 控制台。

-

CSS 檔無法套用:MIME Type 問題

-

CSS 定義的相關檔沒有被讀取是 CSS 的相關問題中最常見的。 這通常是伺服器將 CSS 檔案送出了錯誤的 MIME Type 。 CSS 說明書 ( CSS specification ) 中提到:「 CSS 檔案應該被作為 text/css mimetype 。」 當網頁處於嚴格的規範模式 ( strict standards mode )時, Mozilla 將遵循並只載入以 text/css 作為 mimetype 的 CSS 檔案。 在 Internet Explorer 中,無論 mimetype 是甚麼, CSS 檔案都會被載入。 當網頁的 doctype ( document type,檔案類型 ) 在網頁的開頭被指定時,他們會進入嚴格的標準模式。 要解決這個問題,您可以修改正確的 mimetype 或移除 doctype。 我們會在下個章節中討論更多關於 doctype。

-

CSS 單位

-

有很多網路應用程式都不在他們的 CSS 中加上單位,尤其是利用 JavaScript 設定 CSS 的時候。 當網頁不執行在標準模式時,Mozilla 不會回報錯誤。 因為 Internet Explorer 並非真正的支援 XHTML ,它不在乎有沒有具體的單位描述。 如果網頁處於嚴格的標準描述下,並且沒有使用單位,那麼 Mozilla 將忽略以下的 style :

-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-  <body>
-    // works in strict mode
-    <div style="width:40px; border:1px solid black;">
-      Text
-    </div>
-
-    // will fail in strict mode
-    <div style="width:40; border:1px solid black;">
-      Text
-    </div>
-  </body>
-</html>
-
-

因為上述的範例中有一個規範的 doctype (檔案類型),所以網頁將執行在嚴格的標準模式下。 第一個 div 標籤會套用 40 像素的寬度,因為它有單位,但是第二個 div 標籤將不會套用指定的寬度,因此會套用預設的 100% 寬度。 透過 JavaScript 設定寬度將會得到一樣的結果。

-

JavaScript 及 CSS

-

既然 Mozilla 支援 CSS 標準,它同時也支援透過 JavaScript 設定 CSS 的 CSS DOM。 您可以透過 style 標籤讀取、移除和修改 CSS 的屬性規則:

-
<div id="myDiv" border:1px solid black;">
-  Text
-</div>
-
-<script>
-  var myElm = document.getElementById("myDiv");
-  myElm.style.width = "40px";
-</script>
-
-

您可以利用這種方式來延伸 css 的屬性。再次強調,如果網頁處於標準模式,您必須加上單位,否則 Mozilla 將忽略指令。 當您要查詢變數時,透過 .style.width 來達成,在 Mozilla 和 Internet Explorer 中,傳回的值中會包含單位,也就是傳回了一串字串。 您可以利用 parseFloat("40px") 將字串轉換成數值。

-

CSS 溢出部分(overflow)差異

-

CSS 增加了溢出(overflow)的概念,它允許您定義如何處理溢出部份;舉例來說,當 div 內容指定的高度高於 div 的高度時, CSS 規範(CSS standard)中定義了如果程式中沒有定義溢出的相關設定, div 的內容將會溢出。 但是 Internet Explorer 仍然不會遵循相關規範,並且會為了留住內容而擴張 div 的高度。 下面的例子表現了這個差異性:

-
<div style="height:100px; border: 1px solid black;">
-  <div style="height:150px; border: 1px solid red; margin:10px;">
-    a
-  </div>
-</div>
-
-

就像你在圖片四看到的,Mozilla 依照了 CSS 規範做出了判斷。 規範中提到了在這個情況下,因為 div 的內部高過它的母體,所以它溢出到了按鈕的地方。 如果您這麼愛 Internet Explorer 的行為,就不要在母體(即 div )加上 height 這個屬性。

-

 

-

圖片四:div溢出部份

-
- DIVdiv溢出部份
-

hover(滑鼠移上某元素)效果差異

-

在一些網站上存在著 Internet Explorer 的非標準 CSS hover。 在 Mozilla 中,通常當滑鼠滑入的時候,利用改變 Text Style 來顯示它自己。 這是因為 a:hover ,在 Internet Explorer 中的 CSS 解析器對應 HTML 中錨點(anchor)的是 <a href="" />,而不是 <a name="" /> 由於作者將錨點設定標記(anchor-setting markup)套用進了區塊,所以造成了文字的顏色變化:

-
CSS:
-  a:hover {color:green;}
-
-HTML:
-  <a href="foo.com">This text should turn green when you hover over it.</a>
-
-  <a name="anchor-name">
-    This text should change color when hovered over, but doesn't in Internet Explorer.
-  </a>
-
-

Mozilla 遵循 CSS 說明書 ( CSS specification )並且在這個例子中會把顏色變成綠色。 您可以使用這兩種方法來讓 Mozilla 擁有像 Internet Explorer 的效果,並且當滑鼠滑入時不會改變文字的顏色:

- -

Quirks 模式、標準模式

-

  在舊的瀏覽器上 (如 Internet Explorer 4),網頁可能會被以一種被不完全正確的方式渲染網頁。當 Mozilla 企圖成為一個和標準相容的瀏覽器的情況下,它採取三種不同方式來處理在這些不太合標準的渲染方式下開發的既有網頁。你可以在  Mozilla 瀏覽器中的  View -> Page Info (或 Ctrl-i) 下查看目前處於哪種模式。而該採取怎樣的模式則取決於該頁面的 doctype。

-

  Doctypes (document type declarations) 看起來是:

-

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

-

  藍色部份稱為 public identifier,而綠色部份是為 system identifier (以 URI 方式描述)。

-

Standards Mode (標準模式)

-

  Standards mode 是最嚴謹的渲染模式。它將完全按照 W3C HTML 以及 CSS specification 來處理,並且不支援任何除此之外的寫法。 Mozilla 會在以下情形中使用此模式:

- -

Almost Standards mode (近乎標準模式)

-

Mozilla introduced almost standards mode for one reason: a section in the CSS 2 specification breaks designs based on a precise layout of small images in table cells. Instead of forming one image to the user, each small image ends up with a gap next to it. The old IBM homepage shown in Figure 5 offers an example.

-

 

-

Figure 5. Image gap

-
- Image Gap
-

Almost standards mode behaves almost exactly as standards mode, except when it comes to an image gap issue. The issue occurs often on standards-compliant pages and causes them to display incorrectly.

-

Mozilla uses almost standards mode for the following conditions:

- -

You can read more about the image gap issue.

-

Quirks Mode (怪癖模式)

-

  以目前情況來說,網路上充斥著許多不完全符合標準規範的網頁。這些不合標準的網頁,卻和有著 bug 的瀏覽器配合的很好。舉例來說,在以前Netscape 居市場領導地位時,便有著 bug。而 IE 誕生石,為了能和那些網頁相容,「繼承」了這些 bug 們。對於在之後才來到市場上的新一代瀏覽器們來說,這些 bug 們便被稱為 quirks (但他們大都能向下相容於這些網頁)。值得注意的是,因為這些既有網頁並非按照規格設計,所以新瀏覽器在渲染時得花上更多時間。不幸的是,絕大多數的網頁都有賴新瀏覽器們以此模式渲染。

-

Mozilla 會在以下情況使用此模式:

- -

For further reading, check out: List of Quirks and List of Doctypes and What Modes They Cause.

-

 

-

事件差異

-

  Mozilla 和 Internet Explorer 在 events 的這個部分幾乎是完全不同的。 Mozilla event model 遵循 W3C 以及 Netscape model。但在 Internet Explorer 中,倘若一個 function 被 event 所觸發,那麼我們可以用 window.event 來接觸到該 event 物件 - 這必須被特別指定為參數傳入。Mozilla 則會直接傳遞該 event 物件到 event handlers 中。一個跨瀏覽器 (cross-browser) 的 event handling 範例如下:

-
<div onclick="handleEvent(event)">Click me!</div>
-
-<script>
-  function handleEvent(aEvent) {
-    // if aEvent is null, means the Internet Explorer event model,
-    // so get window.event.
-    var myEvent = aEvent ? aEvent : window.event;
-  }
-</script>
-
-

  此外,event 物件產生時所擁有的 properties 和 functions 在 Mozilla and Internet Explorer 也可能有不同的名字。請參見 Table 4。

-

 

-

Table 4. Mozilla/Internet Explorer event property 比較表

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Internet Explorer NameMozilla NameDescription
altKeyaltKeyBoolean property that returns whether the alt key was pressed during the event.
cancelBubblestopPropagation()Used to stop the event from bubbling farther up the tree.
clientXclientXThe X coordinate of the event, in relation to the client.
clientYclientYThe Y coordinate of the event, in relation to the client.
ctrlKeyctrlKeyBoolean property that returns whether the Ctrl key was pressed during the event.
fromElementrelatedTargetFor mouse events, this is the element from which the mouse moved away.
keyCodekeyCodeFor keyboard events, this is a number representing the key that was pressed. It is 0 for mouse events.
returnValuepreventDefault()Used to prevent the event's default action from occurring.
screenXscreenXThe X coordinate of the event, in relation to the screen.
screenXscreenYThe Y coordinate of the event, in relation to the screen.
shiftKeyshiftKeyBoolean property that returns whether the Shift key was pressed during the event.
srcElementtargetThe element to which the event was originally dispatched.
toElementcurrentTargetFor mouse events, this is the element to which the mouse moved.
typetypeReturns the name of the event.
-

加上事件控制式

-

  Mozilla 支援了兩種方式來附加 events 到 JavaScript 中。第一種是所有瀏覽器都支援的,直接將 event properties 連接到物件上。下例為設定一個 click event handler,一個 function reference 被設定到物件的 onclick property:

-
<div id="myDiv">Click me!</div>
-
-<script>
-  function handleEvent(aEvent) {
-    // if aEvent is null, means the Internet Explorer event model,
-    // so get window.event.
-    var myEvent = aEvent ? aEvent : window.event;
-  }
-
-  function onPageLoad(){
-    document.getElementById("myDiv").onclick = handleEvent;
-  }
-</script>
-
-

Mozilla fully supports the W3C standard way of attaching listeners to DOM nodes. You use the addEventListener() and removeEventListener() methods, and have the benefit of being able to set multiple listeners for the same event type. Both methods require three parameters: the event type, a function reference, and a boolean denoting whether the listener should catch events in their capture phase. If the boolean is set to false, it will only catch bubbling events. W3C events have three phases: capturing, at target, and bubbling. Every event object has an eventPhase attribute indicating the phase numerically (0 indexed). Every time you trigger an event, the event starts at the DOM's outermost element, the element at the top of the DOM tree. It then walks the DOM using the most direct route toward the target, which is the capturing phase. When the event reaches the target, the event is in the target phase.  After arriving at the target, it walks up the DOM tree back to the outermost node; this is bubbling. Internet Explorer's event model only has the bubbling phase; therefore, setting the third parameter to false results in Internet Explorer-like behavior:

-
<div id="myDiv">Click me!</div>
-
-<script>
-
-  function handleEvent(aEvent) {
-    // if aEvent is null, it is the Internet Explorer event model,
-    // so get window.event.
-    var myEvent = aEvent ? aEvent : window.event;
-  }
-
-  function onPageLoad() {
-    var element = document.getElementById("myDiv");
-    element.addEventListener("click", handleEvent, false);
-  }
-</script>
-
-

One advantage of addEventListener() and removeEventListener() over setting properties is that you can have multiple event listeners for the same event, each calling another function. Thus, to remove an event listener requires all three parameters be the same as the ones you use when adding the listener.

-

Mozilla does not support Internet Explorer's method of converting <script> tags into event handlers, which extends <script> with for and event attributes (see Table 5). It also does not support the attachEvent and detachEvent methods. Instead, you should use the addEventListener and removeEventListener methods. Internet Explorer does not support the W3C events specification.

-

 

-

Table 5. Event method differences between Mozilla and Internet Explorer

- - - - - - - - - - - - - - - - - - -
Internet Explorer MethodMozilla MethodDescription
attachEvent(aEventType, aFunctionReference)addEventListener(aEventType, aFunctionReference, aUseCapture)Adds an event listener to a DOM element.
detachEvent(aEventType, aFunctionReference)removeEventListener(aEventType, aFunctionReference, aUseCapture)Removes an event listener to a DOM element.
-

Rich-text 編輯

-

While Mozilla prides itself with being the most W3C standards-compliant browser, it does support nonstandard functionality, such as innerHTML and rich text editing, if no W3C equivalent exists.

-

Mozilla 1.3 introduced an implementation of Internet Explorer's designMode feature, which turns an HTML document into a rich text editor field. Once turned into the editor, commands can run on the document through the execCommand command. Mozilla does not support Internet Explorer's contentEditable attribute for making any widget editable. You can use an iframe to add a rich text editor.

-

Rich-text 差異

-

Mozilla supports the W3C standard of accessing iframe's document object through IFrameElm.contentDocument, while Internet Explorer requires you to access it through document.frames{{ mediawiki.external('\"name\"') }} and then access the resulting document:

-
function getIFrameDocument(aID) {
-  var rv = null;
-
-  // if contentDocument exists, W3C compliant (Mozilla)
-  if (document.getElementById(aID).contentDocument){
-    rv = document.getElementById(aID).contentDocument;
-  } else {
-    // IE
-    rv = document.frames[aID].document;
-  }
-  return rv;
-}
-
-

Another difference between Mozilla and Internet Explorer is the HTML that the rich text editor creates. Mozilla defaults to using CSS for the generated markup. However, Mozilla allows you to toggle between HTML and CSS mode using the useCSS execCommand and toggling it between true and false. Internet Explorer always uses HTML markup.

-
Mozilla (CSS):
-  <span style="color: blue;">Big Blue</span>
-
-Mozilla (HTML):
-  <font color="blue">Big Blue</font>
-
-Internet Explorer:
-  <FONT color="blue">Big Blue</FONT>
-
-

Below is a list of commands that execCommand in Mozilla supports:

-

 

-

Table 6. Rich text editing commands

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Command NameDescriptionArgument
boldToggles the selection's bold attribute.---
createlinkGenerates an HTML link from the selected text.The URL to use for the link
deleteDeletes the selection.---
fontnameChanges the font used in the selected text.The font name to use (Arial, for example)
fontsizeChanges the font size used in the selected text.The font size to use
fontcolorChanges the font color used in the selected text.The color to use
indentIndents the block where the caret is.---
inserthorizontalruleInserts an <hr> element at the cursor's position.---
insertimageInserts an image at the cursor's position.URL of the image to use
insertorderedlistInserts an ordered list (<ol>) element at the cursor's position.---
insertunorderedlistInserts an unordered list (<ul>) element at the cursor's position.---
italicToggles the selection's italicize attribute.---
justifycenterCenters the content at the current line.---
justifyleftJustifies the content at the current line to the left.---
justifyrightJustifies the content at the current line to the right.---
outdentOutdents the block where the caret is.---
redoRedoes the previous undo command.---
removeformatRemoves all formatting from the selection.---
selectallSelects everything in the rich text editor.---
strikethroughToggles the strikethrough of the selected text.---
subscriptConverts the current selection into subscript.---
superscriptConverts the current selection into superscript.---
underlineToggles the underline of the selected text.---
undoUndoes the last executed command.---
unlinkRemoves all link information from the selection.---
useCSSToggles the usage of CSS in the generated markup.Boolean value
-

For more information, visit Rich-Text Editing in Mozilla.

-

 

-

XML 差異

-

Mozilla 對 XML 與相關的技術有很完整的支援,如對 XSLT 與 Web services 等。它也支援一些 Internet Explorer 非標準的延伸,例如 XMLHttpRequest。

-

Mozilla has strong support for XML and XML-related technologies, such as XSLT and Web services. It also supports some nonstandard Internet Explorer extensions, such as XMLHttpRequest.

-

掌控 XML

-

如同對於標準 HTML,對於可各方面控制 XML 檔的 DOM 的支援,Mozilla 也是依 W3C 所定的 XML DOM 規格。Mozilla 與 Internet Explorer 在 XML DOM 上的不同處大多在於 Internet Explorer 非標準的處理方式。一個常見的差異是對空白字元節點的處理。 通常在建立 XML 時,XML 節點間會有空白。 Internet Explorer 用 XMLNode.childNodes[] 時不會包括這些空白節點,但在 Mozilla 上這些節點會在 array 裡。

-

  在 HTML 標準上,Mozilla 支援了 W3C XML DOM 規範,但  Internet Explorer 則否。Mozilla 和 Internet Explorer 的一些差異很大部分是肇始於後者的非規範行為。在這其中,最廣為人知的應該就是如何去處理 white space text nodes 了。通常在 XML 文檔產生後,會在 XML node 間包含著一些 white space。當你使用 XMLNode.childNodes[] 時,Internet Explorer 將不會包含這些 white space nodes。但在 Mozilla 中,這些 nodes 仍會出現在 array 中。

-
XML:
-  <?xml version="1.0"?>
-  <myXMLdoc xmlns:myns="http://myfoo.com">
-    <myns:foo>bar</myns:foo>
-  </myXMLdoc>
-
-JavaScript:
-  var myXMLDoc = getXMLDocument().documentElement;
-  alert(myXMLDoc.childNodes.length);
-
-

The first line of JavaScript 的第一行載入 XML 檔並用 documentElement 來存取它的 root 元素 (myXMLDoc)。第二行顯示子節點的數目。根據 W3C 規格,接在一起的空白與換行字符組成一個文字節點。在 Mozilla 上 myXMLdoc 節點有三個子:一個有換行字符與兩個空白的文字節點、myns:foo 節點、與另一個有換行字符的文字節點。Internet Explorer 並不遵循這個,因此上面的程式碼會顯示 "1",表示只有 myns:foo 節點。所以,如要迴走子節點並掠過文字節點,要分辨這些節點。

-

The first line of JavaScript loads the XML document and accesses the root element (myXMLDoc) by retrieving the documentElement. The second line simply alerts the number of child nodes. Per the W3C specification, the white spaces and new lines merge into one text node if they follow each other. For Mozilla, the myXMLdoc node has three children: a text node containing a new line and two spaces; the myns:foo node; and another text node with a new line. Internet Explorer, however, does not abide by this and will return "1" for the above code, namely only the myns:foo node. Therefore, to walk the child nodes and disregard text nodes, you must distinguish such nodes.

-

As mentioned earlier, every node has a nodeType attribute representing the node type. For example, an element node has type 1, while a document node has type 9. To disregard text nodes, you must check for types 3 (text node) and 8 (comment node).

-
XML:
-  <?xml version="1.0"?>
-  <myXMLdoc xmlns:myns="http://myfoo.com">
-    <myns:foo>bar</myns:foo>
-  </myXMLdoc>
-
-JavaScript:
-  var myXMLDoc = getXMLDocument().documentElement;
-  var myChildren = myXMLDoc.childNodes;
-
-  for (var run = 0; run < myChildren.length; run++){
-    if ( (myChildren[run].nodeType != 3) &&
-          myChildren[run].nodeType != 8) ){
-      // not a text or comment node
-    }
-  }
-
-

XML data islands

-

Internet Explorer has a nonstandard feature called XML data islands, which allow you to embed XML inside an HTML document using the nonstandard HTML tag <xml>. Mozilla does not support XML data islands and handles them as unknown HTML tags. You can achieve the same functionality using XHTML; however, because Internet Explorer's support for XHTML is weak, this is usually not an option.

-

One cross-browser solution is to use DOM parsers, which parse a string that contains a serialized XML document and generates the document for the parsed XML. Mozilla uses the DOMParser class, which takes the serialized string and creates an XML document out of it. In Internet Explorer, you can achieve the same functionality using ActiveX. A new Microsoft.XMLDOM generates and has a loadXML method that can take in a string and generate a document from it. The following code shows you how:

-
IE XML data island:
-  ..
-  <xml id="xmldataisland">
-    <foo>bar</foo>
-  </xml>
-
-Cross-browser solution:
-  var xmlString = "<xml id=\"xmldataisland\"><foo>bar</foo></xml>";
-
-  var myDocument;
-
-  if (document.implementation.createDocument){
-    // Mozilla, create a new DOMParser
-    var parser = new DOMParser();
-    myDocument = parser.parseFromString(xmlString, "text/xml");
-  } else if (window.ActiveXObject){
-    // Internet Explorer, create a new XML document using ActiveX
-    // and use loadXML as a DOM parser.
-    myDocument = new ActiveXObject("Microsoft.XMLDOM")
-    myDocument.async="false";
-
-    myDocument.loadXML(xmlString);
-  }
-
-

XML HTTP request

-

Internet Explorer allows you to send and retrieve XML files using MSXML's XMLHTTP class, which is instantiated through ActiveX using new ActiveXObject("Msxml2.XMLHTTP") or new ActiveXObject("Microsoft.XMLHTTP"). Since there is no standard method of doing this, Mozilla provides the same functionality in the global JavaScript XMLHttpRequest object. The object generates asynchronous requests by default.

-

After instantiating the object using new XMLHttpRequest(), you can use the open method to specify what type of request (GET or POST) you use, which file you load, and if it is asynchronous or not. If the call is asynchronous, then give the onload member a function reference, which is called once the request has completed.

-

Synchronous request:

-
  var myXMLHTTPRequest = new XMLHttpRequest();
-  myXMLHTTPRequest.open("GET", "data.xml", false);
-
-  myXMLHTTPRequest.send(null);
-
-  var myXMLDocument = myXMLHTTPRequest.responseXML;
-
-

Asynchronous request:

-
  var myXMLHTTPRequest;
-
-  function xmlLoaded() {
-    var myXMLDocument = myXMLHTTPRequest.responseXML;
-  }
-
-  function loadXML(){
-    myXMLHTTPRequest = new XMLHttpRequest();
-
-    myXMLHTTPRequest.open("GET", "data.xml", true);
-
-    myXMLHTTPRequest.onload = xmlLoaded;
-
-    myXMLHTTPRequest.send(null);
-  }
-
-

Table 7 features a list of available methods and properties for Mozilla's XMLHttpRequest.

-

 

-

Table 7. XMLHttpRequest methods and properties

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescription
void abort()Stops the request if it is still running.
string getAllResponseHeaders()Returns all response headers as one string.
string getResponseHeader(string headerName)Returns the value of the specified header.
functionRef onerrorIf set, the references function will be called whenever an error occurs during the request.
functionRef onloadIf set, the references function will be called when the request completes successfully and the response has been received. Use when an asynchronous request is used.
void open (string HTTP_Method, string URL)
-
- void open (string HTTP_Method, string URL, boolean async, string userName, string password)
Initializes the request for the specified URL, using either GET or POST as the HTTP method. To send the request, call the send() method after initialization. If async is false, the request is synchronous, else it defaults to asynchronous. Optionally, you can specify a username and password for the given URL needed.
int readyStateState of the request. Possible values: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ValueDescription
0UNINITIALIZED - open() has not been called yet.
1LOADING - send() has not been called yet.
2LOADED - send() has been called, headers and status are available.
3INTERACTIVE - Downloading, responseText holds the partial data.
4COMPLETED - Finished with all operations.
-
string responseTextString containing the response.
DOMDocument responseXMLDOM Document containing the response.
void send(variant body)Initiates the request. If body is defined, it issent as the body of the POST request. body can be an XML document or a string serialized XML document.
void setRequestHeader (string headerName, string headerValue)Sets an HTTP request header for use in the HTTP request. Has to be called after open() is called.
string statusThe status code of the HTTP response.
-

XSLT 差異

-

Mozilla supports XSL Transformations (XSLT) 1.0. It also allows JavaScript to perform XSLT transformations and allows running XPATH on a document.

-

Mozilla requires that you send the XML and XSLT file holding the stylesheet with an XML mimetype (text/xml or application/xml). This is the most common reason why XSLT won't run in Mozilla but will in Internet Explorer. Mozilla is strict in that way.

-

Internet Explorer 5.0 and 5.5 supported XSLT's working draft, which is substantially different than the final 1.0 recommendation. The easiest way to distinguish what version an XSLT file was written against is to look at the namespace. The namespace for the 1.0 recommendation is http://www.w3.org/1999/XSL/Transform, while the working draft's namespace is http://www.w3.org/TR/WD-xsl. Internet Explorer 6 supports the working draft for backwards compatibility, but Mozilla does not support the working draft, only the final recommendation.

-

If XSLT requires you to distinguish the browser, you can query the "xsl:vendor" system property. Mozilla's XSLT engine will report itself as "Transformiix" and Internet Explorer will return "Microsoft."

-
<xsl:if test="system-property('xsl:vendor') = 'Transformiix'">
-  <!-- Mozilla specific markup -->
-</xsl:if>
-<xsl:if test="system-property('xsl:vendor') = 'Microsoft'">
-  <!-- Internet Explorer specific markup -->
-</xsl:if>
-
-

Mozilla also provides JavaScript interfaces for XSLT, allowing a Web site to complete XSLT transformations in memory. You can do this using the global XSLTProcessor JavaScript object. XSLTProcessor requires you to load the XML and XSLT files, because it needs their DOM documents. The XSLT document, imported by the XSLTProcessor, allows you to manipulate XSLT parameters. XSLTProcessor can generate a standalone document using transformToDocument(), or it can create a document fragment using transformToFragment(), which you can easily append into another DOM document. Below is an example:

-

 

-
var xslStylesheet;
-var xsltProcessor = new XSLTProcessor();
-
-// load the xslt file, example1.xsl
-var myXMLHTTPRequest = new XMLHttpRequest();
-myXMLHTTPRequest.open("GET", "example1.xsl", false);
-myXMLHTTPRequest.send(null);
-
-// get the XML document and import it
-xslStylesheet = myXMLHTTPRequest.responseXML;
-
-xsltProcessor.importStylesheet(xslStylesheet);
-
-// load the xml file, example1.xml
-myXMLHTTPRequest = new XMLHttpRequest();
-myXMLHTTPRequest.open("GET", "example1.xml", false);
-myXMLHTTPRequest.send(null);
-
-var xmlSource = myXMLHTTPRequest.responseXML;
-
-var resultDocument = xsltProcessor.transformToDocument(xmlSource);
-
-

After creating an XSLTProcessor, you load the XSLT file using XMLHttpRequest. The XMLHttpRequest's responseXML member contains the XML document of the XSLT file, which is passed to importStylesheet. You then use the XMLHttpRequest again to load the source XML document that must be transformed; that document is then passed to the transformToDocument method of XSLTProcessor. Table 8 features a list of XSLTProcessor methods.

-

 

-

Table 8. XSLTProcessor methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodDescription
void importStylesheet(Node styleSheet)Imports the XSLT stylesheet. The styleSheet argument is the root node of an XSLT stylesheet's DOM document.
DocumentFragment transformToFragment(Node source, Document owner)Transforms the Node source by applying the stylesheet imported using the importStylesheet method and generates a DocumentFragment. owner specifies what DOM document the DocumentFragment should belong to, making it appendable to that DOM document.
Document transformToDocument(Node source)Transforms the Node source by applying the stylesheet imported using the importStylesheet method and returns a standalone DOM document.
void setParameter(String namespaceURI, String localName, Variant value)Sets a parameter in the imported XSLT stylesheet.
Variant getParameter(String namespaceURI, String localName)Gets the value of a parameter in the imported XSLT stylesheet.
void removeParameter(String namespaceURI, String localName)Removes all set parameters from the imported XSLT stylesheet and makes them default to the XSLT-defined defaults.
void clearParameters()Removes all set parameters and sets them to defaults specified in the XSLT stylesheet.
void reset()Removes all parameters and stylesheets.
-
-

原文資訊

- -
diff --git a/files/zh-tw/archive/mozilla/persona/branding/index.html b/files/zh-tw/archive/mozilla/persona/branding/index.html deleted file mode 100644 index 2793b91f88..0000000000 --- a/files/zh-tw/archive/mozilla/persona/branding/index.html +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: 品牌資源 -slug: Archive/Mozilla/Persona/branding -translation_of: Archive/Mozilla/Persona/User_interface_guidelines ---- -

「使用 Persona 登入」按鈕

-

圖片

-

登入按鈕有三種版本、三種配色:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Sign in with your EmailSign in with PersonaSign in
-

CSS-Based

-

Sawyer Hollenshead 製作了一套精美的 CSS-based 按鈕。下載 (.zip)

-

更多資訊

-

您可在 Sean Martell's style primer 找到更多有關 Persona 視覺設計的資訊。

diff --git a/files/zh-tw/archive/mozilla/persona/index.html b/files/zh-tw/archive/mozilla/persona/index.html deleted file mode 100644 index 5345e5f569..0000000000 --- a/files/zh-tw/archive/mozilla/persona/index.html +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: Persona -slug: Archive/Mozilla/Persona -translation_of: Archive/Mozilla/Persona ---- -
-

       保持聯繫或取得協助!

- -

追蹤 我們的 blog,加入 我們的郵件列表,或在 IRC 裡頭 #identity 頻道找到我們。

-
- -

Mozilla Persona 是一個跨瀏覽器的 Web 登入驗證系統,其基本設計精神為易於使用以及易於實作。它可以使用於當今主要的各種瀏覽器環境中,你可以現在就開始使用它。

- -

為什麼你應該套用 Persona 在你的網站上呢?

- -
    -
  1. Persona 完全消除了特定網站的密碼,讓使用者們與網站們從創立、管理以及安全地保存密碼的責任中解放出來。
  2. -
  3. Persona 易於使用。只需要兩次點擊,一位 Persona 使用者即可登入某個新網站,諸如:VoostThe Times Crossword ,避開了造訪新網站又要再申請一組帳號密碼的麻煩事。
  4. -
  5. Persona 易於實作。開發人員只需要花一個下午的時間,即可將 Persona 套用到一個網站中。
  6. -
  7. 更棒的是,不會被鎖定。開發人員可以取得造訪網站的所有使用者已驗證過的電子郵件信箱,而使用者可以使用任何一個或多個電子郵件信箱在 Persona 中。
  8. -
- -

而且,Persona 未來將會變得越來越棒:它是基於開放去中心化的通訊協定,被設計規劃成可直接整合到各個瀏覽器中,以及可由電子郵件服務提供者直接提供支援。今天採用並導入 Persona 的網站將直接體驗到這些未來的改進項目,不需要再更動其程式碼。

- -
備註:Persona 正在很活躍地開發中。歡迎造訪我們的 blog 來認識更多心功能,或是加入我們的郵件群組(英文)給予我們更多建議與回饋!
- -

動手導入 Persona 到你的網站中

- - - - - - - - - - - - -
-

開始動手!

- -
-
為什麼是 Persona?
-
認識更多關於在你的網站上採用 Persona 的原因,以及它與其他身分驗證系統的差異比較。
-
快速指南
-
這是一份快捷的攻略,馬上學習如何在你的網站中加入 Persona 功能。
-
-
-

Persona API 參考資料

- -
-
navigator.id API
-
這是一份關於 navigator.id 物件的參考資料,Web 開發人員可以用來將 Persona 整合到網站中。
-
Verification (驗證) API
-
這份參考資料是關於建構在https://verifier.login.persona.org/verify 的遠端驗證 API。
-
-
-

導引指南

- -
-
安全考量
-
實作與技巧用以確保你的 Persona 佈署是安全的。
-
瀏覽器相容性
-
確切得知有哪些瀏覽器有支援 Persona。
-
國際化
-
了解 Persona 如何處理不同的各國語言。
-
-
-

資源

- -
-
函式庫與套件
-
尋找你愛好的程式語言、web framework、blog 或是內容管理系統 (CMS) 的函式庫或套件 (plugin)。
-
The Persona cookbook
-
給 Persona 網站參考的範例程式碼。包含有 C# (MVC3)、PHP、Node.JS 等等各種語言。
-
品牌資源
-
Persona 登入按鈕,以及方便你的使用者識別的 Persona 圖形資源。
-
-
- -

 

- - - - - - - - -
-

給身分識別提供者 (Identity Provider) 的資訊

- -

如果你是電子郵件服務提供者,或是身分識別服務提供者,請參考以下資訊獲知如何整合並成為一個 Persona 身分識別提供者 (IdP)。

- -
-
IdP 概述
-
Persona 身份識別提供者概述。
-
實作 IdP
-
這是一份詳細的技術指南,關於如何成為身分識別提供者 (IdP)。
-
.well-known/browserid
-
.well-known/browserid 文件的結構與用途概述。這份文件檔案被 IdPs 用於廣播通知其支援此通訊協定。
-
-
-

Persona 專案

- -
-
專有名詞對照表
-
BrowserID 和 Persona 定義的專有名詞。
-
FAQ
-
常見問題集。
-
通訊協定概述
-
BrowserID 通訊協定的底層技術性概述。
-
加密
-
一瞥 Persona 和 BrowserID 背後的密碼學概念。
-
規格
-
在這裡可以挖到更多更深的技術性細節。
-
Persona 網站
-
為了讓 Persona 運作,我們在 https://login.persona.org 設立了三種服務:一個身分識別提供者,一個可移動可轉移的 {{ domxref("navigator.id") }} API 實作,以及一個身分判定 (identity assertion) 驗證服務。
-
Persona 原始程式碼
-
我們將 Persona 網站背後的程式碼放在 GitHub 上。非常歡迎送 Pull requests 給我們!
-
-
- -

 

diff --git a/files/zh-tw/archive/mozilla/persona/internationalization/index.html b/files/zh-tw/archive/mozilla/persona/internationalization/index.html deleted file mode 100644 index b4ec357352..0000000000 --- a/files/zh-tw/archive/mozilla/persona/internationalization/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Internationalization -slug: Archive/Mozilla/Persona/Internationalization -tags: - - Persona -translation_of: Archive/Mozilla/Persona/Internationalization ---- -

Persona 的本土化如何呢?

-

將來,使用 Persona 登入網站的使用者界面(UI)將被直接集成至瀏覽器中,並且隨著瀏覽器自己的本土化來本土化。。而不支援集成的瀏覽器,Persona 的使用者界面即由一系列來自 login.persona.org 的對話框所組成。這些對話框的翻譯由來自社群的自願者進行,並且有超過 45 種語言可用於這些產品中

-

Persona 如何選擇語言?

-

Persona 服務通過來自瀏覽器請求頭部訊息中的 Accept-Language 來選擇語言。Accept-Language 頭部訊息所使用的語言與 mozilla.org 所使用的為一致:

-
    -
  1. 對於每個 Accept-Language 中的語言標籤: -
      -
    • 確保我們有完整的該語言標籤的語言,則為精準配對該語言標籤
    • -
    • 確保我們有該語言標籤中的第一個部分,則精準配對第一部分
    • -
    -
  2. -
  3. 若沒辦法通過規則 1 來配對,則退而使用 en-US 。但是,通常 en 或 en-US 幾乎會被大多數瀏覽器作為最後一個傳送的 accept-lang 頭部資訊。
  4. -
-

舉例來說,下列下列表格列出了不同的 Accept-Language 會選擇的語言,假設支援下列語言: en-US, es, es-MX:

- - - - - - - - - - - - - - - - - - - - - - - - - -
Accept-Language HeaderPersona 選擇的語言
es-AR,es;q=0.8,en-us;q=0.5es
es-MX,es;q=0.8,en-us;q=0.5es-MX
es-es,en-us;q=0.5en-US
es-esen-US
-

目前還沒辦法讓網站強制將對話框設為某一種語言。這是因為 Persona UI 的邏輯是(以及未來在本機上實現的,也會是)設計為作為瀏覽器的使用者界面的一部分,所以其語言應該要同瀏覽器的語言一致。

-

我可以如何協助?

-

Persona 使用了 Mozilla Verbatim 來協助志願者建立新的翻譯。若您想幫助,請參閱開始使用 Verbatim 並看看 Verbatim 上的「BrowserID」計劃

-

 

diff --git a/files/zh-tw/archive/mozilla/persona/quick_setup/index.html b/files/zh-tw/archive/mozilla/persona/quick_setup/index.html deleted file mode 100644 index d21858329f..0000000000 --- a/files/zh-tw/archive/mozilla/persona/quick_setup/index.html +++ /dev/null @@ -1,137 +0,0 @@ ---- -title: 快速指南 -slug: Archive/Mozilla/Persona/Quick_Setup -translation_of: Archive/Mozilla/Persona/Quick_Setup ---- -

要把 Persona 登入系統加到你的網站,只需要五個步驟:

-
    -
  1. 在你的網頁中引入 Persona 的 JavaScript 函式庫。
  2. -
  3. 加上「登入」和「登出」按鈕。
  4. -
  5. 監聽登入和登出行為。
  6. -
  7. 驗證使用者的身分 (credential)。
  8. -
  9. 檢視最佳導入實例。
  10. -
-

你應該能在一個下午就建置完成並開始執行,另外重要的事情是:如果你要在你的網站上開始使用 Persona,請花點時間訂閱 Persona 通知 郵件清單。它的流量非常低,只會用於通知你關於變更公告或是安全問題等可能對你的網站造成影響的議題。

-

步驟1:引入 Persona 函式庫

-

Persona 被設計為跨瀏覽器且可在全部主要桌面和移動瀏覽器中工作。

-

在未來我們期望瀏覽器提供 Persona 的原生支援,但我們同時提供了一個 JavaScript 函式庫完整實作了使用者介面和客戶端部分的協議。透過包含這個函式庫,你的使用者將可以用 Persona 登入,無論他們的瀏覽器是否有原生支援。

-

一旦頁面中的這個函式庫載入完成,你需要的 Persona 函式({{ domxref("navigator.id.watch()", "watch()") }}、{{ domxref("navigator.id.request()", "request()") }} 和 {{ domxref("navigator.id.logout()", "logout()") }})會在全域物件 navigator.id 中可用。

-

要包含 Persona JavaScript 函式庫,你可以把這個 script 標籤放進你頁面的首部:

-
<script src="https://login.persona.org/include.js"></script>
-
-

必須在每個使用 {{ domxref("navigator.id") }} 中函式的頁面裡包含這個標籤。因為 Persona 始終在開發中,你不應該自行管理 include.js 檔。

-

步驟2:加入登入/登出按鈕

-

因為 Persona 被設計為一個 DOM API,你必須在使用者按下你網站上的登入或登出按鈕時呼叫函式。要開啟 Persona 對話視窗並提示使用者登入,你應該呼叫 {{ domxref("navigator.id.request()") }} 。而登出要呼叫 {{ domxref("navigator.id.logout()") }} 。

-

例如:

-
var signinLink = document.getElementById('signin');
-if (signinLink) {
-signinLink.onclick = function() { navigator.id.request(); };
-};
-
-var signoutLink = document.getElementById('signout');
-if (signoutLink) {
-signoutLink.onclick = function() { navigator.id.logout(); };
-};
-
-

那些按鈕的是什麼樣子的?查看我們的品牌資源頁面中的預製圖片和基於 CSS 的按鈕!

-

步驟3:監視登入/登出行為

-

要把 Persona 封裝成函式,你需要告訴它當使用者登入/登出時做甚麼。呼叫 {{ domxref("navigator.id.watch()") }} 函式就可以實作,它支援三處:

-
    -
  1. -

    你網站目前使用者的 loggedInEmail ,如果沒有則為 null 。你應該在渲染頁面的時候動態產生它。

    -
  2. -
  3. -

    當觸發 onlogin 行為的時候呼叫的函式。這個函式會被傳遞一個必須認證的「身分斷言」參數。

    -
  4. -
  5. -

    當觸發 onlogout 行為的時候呼叫的函式。這個函式不會被傳遞任何參數。

    -
  6. -
-
-

注意:你必須總是在呼叫 {{ domxref("navigator.id.watch()") }} 時同時包含 onloginonlogout

-
-

例如,如果你現在認為 Bob 已經登入到你的網站,你會這樣做:

-
var currentUser = 'bob@example.com';
-
-navigator.id.watch({
-loggedInUser: currentUser,
-onlogin: function(assertion) {
-// 一個使用者已經登入!這是你需要做的:
-// 1. 把斷言發送到後端驗證並建立一個工作階段。
-// 2. 更新你的 UI。
-$.ajax({ /* <-- 本例使用了 jQuery,但你也可以用你想用的 */
-type: 'POST',
-url: '/auth/login', // 這是你網站上的一個 URL
-data: {assertion: assertion},
-success: function(res, status, xhr) { window.location.reload(); },
-error: function(res, status, xhr) { alert("登入失敗" + res); }
-});
-},
-onlogout: function() {
-// 一個使用者已經登出!這是你需要做的:
-// 銷毀使用者的工作階段並重新導向使用者或做後端的呼叫。
-// 同樣,讓 loggedInUser 在下個頁面載入時變為 null。
-// (這是一個字面的 JavaScript null。不是 false、 0 或 undefined。null。)
-$.ajax({
-type: 'POST',
-url: '/auth/logout', // 這是你網站上的一個 URL
-success: function(res, status, xhr) { window.location.reload(); },
-error: function(res, status, xhr) { alert("登出失敗" + res); }
-});
-}
-});
-
-

在本例中,onloginonlogout 都通過向你網站的後端發送非同步 POST 請求來實作。後端隨後通常用設定或刪除工作階段 cookie 中的資訊來登入或登出使用者。之後,如果一切都核對無誤,頁面重新載入來考慮帳號的新登入狀態。

-

你當然可以用 AJAX 來不用重新載入或重新導向來實作,但這超出了本教學的範疇。

-

必須在每個有登入/登出按鈕的頁面上呼叫這個函式。要為使用者支持 Persona 加強功能,諸如自動登入和全域登出,你應該在網站上的每個頁面都呼叫這個函式。

-

步驟4:驗證使用者證書

-

Persona 用「身分斷言」來代替密碼,那是一種類似一次性、單一網站的、使用者郵件地址捆綁的密碼。當使用者想要登入時,你的 onlogin 回調會傳入一個該使用者的斷言來呼叫。在你登入他們前,你必須驗證斷言的有效性。

-

在你的伺服器上而不是使用者瀏覽器上執行的 JavaScript 中驗證斷言是極度重要的,因為那很容易偽造。上面的例子用 jQuery 的 $.ajax() 輔助函式來把斷言通過 POST/auth/login 來呈遞給後端。

-

一旦你的伺服器取得了斷言,你如何驗證它?最簡單的方法是用 Mozilla 提供的輔助服務。簡單地把斷言以兩個參數 POSThttps://verifier.login.persona.org/verify

-
    -
  1. assertion: 使用者提供的身分斷言。
  2. -
  3. audience: 你網站的主機名稱和連接埠。你必須在後端硬編碼這個值;不要從使用者提供的任何資料中派生這個值。
  4. -
-

例如,如果你是 example.com,你可以用下面的命令行來測試斷言:

-
$ curl -d "assertion=<ASSERTION>&audience=https://example.com:443" "https://verifier.login.persona.org/verify"
-
-

如果它是有效的,你會得到像這樣的一個 JSON 回應:

-
{
-"status": "okay",
-"email": "bob@eyedee.me",
-"audience": "https://example.com:443",
-"expires": 1308859352261,
-"issuer": "eyedee.me"
-}
-
-

你可以閱讀驗證服務 API來獲知更多關於驗證服務的內容。一個 /api/login 實作的使用了 PythonFlask web 框架和 Requests HTTP 函式庫的例子看起來是這樣:

-
@app.route('/auth/login', methods=['POST'])
-def login():
-# 請求必須包含我們要驗證的斷言
-if 'assertion' not in request.form:
-abort(400)
-
-# 把斷言發送給 Mozilla 的驗證服務
-data = {'assertion': request.form['assertion'], 'audience': 'https://example.com:443'}
-resp = requests.post('https://verifier.login.persona.org/verify', data=data, verify=True)
-
-# 驗證器回應了嗎?
-if resp.ok:
-# 處理回應
-verification_data = json.loads(resp.content)
-
-# 檢查斷言是否有效
-if verification_data['status'] == 'okay':
-# 設置一個安全工作階段 cookie 來登入使用者
-session.update({'email': verification_data['email']})
-return resp.content
-
-# 哎喲,有什麼東西不對,放棄
-abort(500)
-
-

工作階段管理可能很像你現有的登入系統。首先的大區別是在驗證使用者身分採用了檢查斷言而不是檢查密碼。另一個不同是確保使用者的郵件地址有效來用於 {{ domxref("navigator.id.watch()") }} 的 loggedInEmail 參數

-

登出很簡單:你只需要移除使用者的工作階段 cookie。

-

步驟5:回顧最佳實踐

-

一旦所有的東西都工作正常並且你已經成功登入和登出你的網站,你應該花一會時間來回顧安全可靠地使用 Persona 的最佳實踐

-

如果你在做一個要作為生產環境的網站,你會想要編寫整合測試來模擬用 Persona 登入或登出使用者。要改善 Selenium 中的這個行為,請考慮使用 bidpom 函式庫。mockmyid.compersonatestuser.org 這兩個網站也可能會有用。

-

最後,不要忘記登記加入 Persona 通知 郵件清單,這樣會通知你任何安全問題或 Persona API 的向後相容變更。這個清單的流量非常低:它只用於通知會對你的網站造成負面影響的變更。

diff --git a/files/zh-tw/archive/mozilla/persona/remote_verification_api/index.html b/files/zh-tw/archive/mozilla/persona/remote_verification_api/index.html deleted file mode 100644 index 7d84cc21b6..0000000000 --- a/files/zh-tw/archive/mozilla/persona/remote_verification_api/index.html +++ /dev/null @@ -1,171 +0,0 @@ ---- -title: 遠端驗證 API -slug: Archive/Mozilla/Persona/Remote_Verification_API -translation_of: Archive/Mozilla/Persona/Remote_Verification_API ---- -

概覽

-

當使用者嘗試登入至網站時,瀏覽器會產生一名為「斷言」的資料結構,其實質上就是一個加密過的電子郵件位置。瀏覽器傳送這個斷言至網站上,使用者登入前,網站必須驗證斷言的有效性。

-

斷言可以在本地端或是通過在下列位置的 API 來進行驗證:https://verifier.login.persona.org/verify。這個頁面介紹了如何使用 API 。

-

方法

-

HTTP POST 請求至 https://verifier.login.persona.org/verify

-

參數

-
-
- assertion
-
- 使用者所提供之斷言。作為傳入 {{ domxref("navigator.id.watch()") }} 中 onlogin 函數的第一個參數。
-
- audience
-
- 您網站的通訊協定、網域名稱、與通訊埠。例如:「https://example.com:443
-
-

回傳值

-

呼叫後會傳統一個包含 status 元素的 JSON 結構,其值可能為「okay」或是「failure」。 依據 status 的值的不同,可能會包含下列表中的額外元素。

-

"okay"

-

該斷言有效。

-

在這種情況下,JSON 結構會包含下列附加元素:

- - - - - - - - - - - - - - - - - - - -
"email"斷言中包含的登入者的郵件位置。
"audience"Audience 的值包含了斷言。Expected to be your own website URL.
"expires"斷言有效期的資料,expressed as the primitive value of a Date object: that is, the number of milliseconds since midnight 01 January, 1970 UTC.
"issuer"The hostname of the identity provider that issued the assertion.
-

"failure"

-

該斷言無效。這種情況下 JSON 結構將會包含一個附加的元素:

- - - - - - - -
"reason"一字串解釋驗證為何失敗。
-

範例

-

node.js

-

該範例為使用 express.js 的 Node.js 伺服器。

-
var express = require("express"),
-    app = express.createServer(),
-    https = require("https"),
-    querystring = require("querystring");
-/* ... */
-
-// Audience 必須符合您瀏覽器的位置列上顯示的,
-// 包含通訊協定、主機名稱、以及通訊埠。
-var audience = "http://localhost:8888";
-
-app.post("/authenticate", function(req, res) {
-  var vreq = https.request({
-    host: "verifier.login.persona.org",
-    path: "/verify",
-    method: "POST"
-  }, function(vres) {
-    var body = "";
-    vres.on('data', function(chunk) { body+=chunk; } )
-        .on('end', function() {
-          try {
-            var verifierResp = JSON.parse(body);
-            var valid = verifierResp && verifierResp.status === "okay";
-            var email = valid ? verifierResp.email : null;
-            req.session.email = email;
-            if (valid) {
-              console.log("assertion verified successfully for email:", email);
-              res.json(email);
-            } else {
-              console.log("failed to verify assertion:", verifierResp.reason);
-              res.send(verifierResp.reason, 403);
-            }
-          } catch(e) {
-            console.log("non-JSON response from verifier");
-            // bogus response from verifier!
-            res.send("bogus response from verifier!", 403);
-
-          }
-        });
-  });
-
-  vreq.setHeader('Content-Type', 'application/x-www-form-urlencoded');
-
-  var data = querystring.stringify({
-    assertion: req.body.assertion,
-    audience: audience
-  });
-
-  vreq.setHeader('Content-Length', data.length);
-  vreq.write(data);
-  vreq.end();
-
-  console.log("verifying assertion!");
-});
-
-
-

via Lloyd Hilaiel

-

PHP

-
$url = 'https://verifier.login.persona.org/verify';
-$assert = filter_input(
-    INPUT_POST,
-    'assertion',
-    FILTER_UNSAFE_RAW,
-    FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH
-);
-//使用 $_POST 超全域陣列供 PHP < 5.2 並撰寫您自己的篩選其
-$params = 'assertion=' . urlencode($assert) . '&audience=' .
-           urlencode('http://example.com:80');
-$ch = curl_init();
-$options = array(
-    CURLOPT_URL => $url,
-    CURLOPT_RETURNTRANSFER => TRUE,
-    CURLOPT_POST => 2,
-    //CURLOPT_SSL_VERIFYPEER => true,   //This currently blocks connection to 'https://verifier.login.persona.org/verify'
-    CURLOPT_SSL_VERIFYPEER => 0,
-
-    CURLOPT_SSL_VERIFYHOST => 2,
-    CURLOPT_POSTFIELDS => $params
-);
-curl_setopt_array($ch, $options);
-$result = curl_exec($ch);
-curl_close($ch);
-echo $result;
-

Via Christian Heilmann

-

Java

-
@Override
-protected void doPost(final HttpServletRequest req,
-   final HttpServletResponse resp) throws ServletException,
-   IOException {
-
-   final String audience = req.getServerName();
-   final String assertion = req.getParameter("assertion");
-   final Verifier verifier = new Verifier();
-   final BrowserIDResponse personaResponse = verifier.verify(assertion,audience);
-   final Status status = personaResponse.getStatus();
-
-   if (status == Status.OK) {
-     /* Authentication with Persona was successful */
-     String email = personaResponse.getEmail();
-     log.info("{} has sucessfully signed in", email);
-     HttpSession session = req.getSession(true);
-     session.setAttribute("email", email);
-
-   } else {
-     /* Authentication with Persona failed */
-     log.info("Sign in failed...");
-
-   }
-}
-
-

Via Javier

-

 

-

注意:If you send the assertion and audience parameters as a JSON-object, they must not be URL-encoded. If they are sent as regular HTTP POST parameters, as in the example above, they must be URL-encoded.

diff --git a/files/zh-tw/archive/mozilla/persona/why_persona/index.html b/files/zh-tw/archive/mozilla/persona/why_persona/index.html deleted file mode 100644 index e6b3b97ded..0000000000 --- a/files/zh-tw/archive/mozilla/persona/why_persona/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 為什麼是 Persona? -slug: Archive/Mozilla/Persona/Why_Persona -translation_of: Archive/Mozilla/Persona/Why_Persona ---- -

現行的使用者帳號和密碼系統不是個長久之計:使用者每造訪一個新網站新服務就得建立並記住一組新的、複雜的密碼,然後每一個網站系統都必須要夠安全地存放這些密碼。儘管如此,最近的事故中也顯示了即使是有規模、有聲望的大型網路公司也還是會在密碼安全上失誤出錯,讓他們的使用者資訊暴露在風險中。

-

Persona 是一個開放的、分散式的、web 規模的身分識別系統,用以取代一個網站一組密碼的局面。它解決了如 OpenID 這類系統的易用性與隱私相關等缺點,而且不訴諸於如 Facebook Connect 這類型中心化系統架構。

-

Persona 擺脫了每站一密碼

-

Persona 讓使用者在完成一個簡單的、一次性的身分識別處理流程後,只需要兩次點擊即可登入網站,而不再需要每站一密碼了。這是安全、可靠的,並且植基於公開金鑰密碼學的基礎上。使用者的瀏覽器產生一組加密過的「身分判定」來取代密碼,它的有效期只存在幾分鐘而且只能用於單一網站上。因為沒有網站特定的密碼,網站使用 Persona 也就不需要擔心如何安全地儲存密碼或是擔心失去或洩漏密碼資料庫了。

-

如此快速簡便的步驟,將讓使用者更快樂地造訪新網站。

-

Persona 使用電子郵件信箱地址作為身分識別

-

Persona 使用電子郵件信箱地址作為身分的識別方式,而不使用任意形式或自訂形式的用戶名稱作為身分識別。這帶給了使用者與開發人員諸多的好處:

-

使用者使用電子郵件信箱地址的好處

- -

開發者使用電子郵件信箱地址的好處

- -

更不用說電子郵件已經是個完整地,橫跨無數服務提供者的,數以億計帳戶的分散式系統。

-

Persona 與其他單一登入 (Single Sign-On) 服務有何不同?

-

Persona 安全、可靠、而且簡單。它保護了使用者的隱私、使用者的控制權、使用者的選擇,而這些是其它登入服務無法或不願意做到的。

-

許多社群網站,例如 Facebook 或 Google+,需要使用者使用真實姓名,並且限制使用者僅能使用單一帳號。藉由建構於電子郵件信箱地址的架構,Persona 允許使用者用以區分它們工作用、家用、學校用等不同的身份識別。

-

Persona 是開放的,也是分散式的:任何一位擁有電子郵件信箱地址的人都可以登入使用 Persona。除此之外,任何人也可以建立他們自己的身份識別服務或委由其他專業機構建立服務,就像使用電子郵件一般。這與需要單一且中心化帳號的社群網站登錄服務的做法剛好相反。

-

Persona 也採用較為新穎的做法來保護使用者的隱私,藉由將瀏覽器置入成為驗證過程當中的一環:瀏覽器從使用者的電子郵件提供者獲取認證身份,然後瀏覽器轉頭將此認證轉呈給網站。電子郵件提供者無法追蹤使用者,但是網站仍可藉由密碼學等驗證技術取得使用者的身份認證,並信任此使用者身份。其它大部份系統,即使是像 OpenID 如此的分散式系統,仍需要網站在背景連接通訊 (phone home) 才允許使用者登入。

diff --git a/files/zh-tw/archive/mozilla/xpinstall/index.html b/files/zh-tw/archive/mozilla/xpinstall/index.html deleted file mode 100644 index 907f839dc4..0000000000 --- a/files/zh-tw/archive/mozilla/xpinstall/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: XPInstall -slug: Archive/Mozilla/XPInstall -tags: - - NeedsTranslation - - TopicStub - - XPInstall - - XPInstall_API_reference -translation_of: Archive/Mozilla/XPInstall ---- -

Parts of this page show the use of the XPInstall API. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. Extension, Theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. In particular plugin developers should see how to package a plugin as an extension.

-
<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <!-- properties -->
-  </Description>
-</RDF>
-
- -
Cross-Platform Install (XPInstall) is a technology used by Mozilla Application Suite, Mozilla Firefox, Mozilla Thunderbird and other XUL-based applications for installing extensions. An XPI (pronounced "zippy" and derived from XPInstall) installer module is a ZIP file that contains an install script or manifest (entitled install.js or install.rdf) at the root of the file.
- - - - - - - - -
-

Documentation

- -
-
XPInstall API Reference
-
XPInstall API Reference.
-
Learn XPI Installer Scripting by Example
-
This article uses the installer script from browser.xpi install package as the basis for discussing XPI installations in general.
-
Creating XPI Installer Modules
-
This article describes the packaging scheme of the Mozilla and offers a tutorial for creating a new package that can then be redistributed, installed, and made available to users.
-
Install Wizards (aka: Stub Installers)
-
- -

View All...

-
-

Community

- -
    -
  • View Mozilla forums... {{ DiscussionList("dev-platform", "mozilla.dev.platform") }}
  • -
- -

Tools

- - - - - - -
- -

 

diff --git a/files/zh-tw/archive/mozilla/xpinstall/scripting_by_example/index.html b/files/zh-tw/archive/mozilla/xpinstall/scripting_by_example/index.html deleted file mode 100644 index 7d95c88d75..0000000000 --- a/files/zh-tw/archive/mozilla/xpinstall/scripting_by_example/index.html +++ /dev/null @@ -1,244 +0,0 @@ ---- -title: XPI 安裝腳本範例教學 -slug: Archive/Mozilla/XPInstall/Scripting_by_example -tags: - - XPInstall - - 待翻譯 -translation_of: Archive/Mozilla/XPInstall/Scripting_by_example ---- -

本文以 browser.xpi 安裝套件為基礎,討論一般的 XPI 安裝程序。安裝腳本 installer script 雖短,但含括了 XPInstall API 大部分的重要功能,且可做為其他一般用途套件的安裝腳本樣本。本文在 unix 下安裝,不過各平台的安裝方式大同小異,你可以此變化安裝在各種 Mozilla 支援的平台。

- -

關於 browser.xpi

- -

browser.xpi 是 Mozilla 瀏覽器安裝主要元件的 XPI 封存檔。Mozilla 跨平台安裝以 XPI 格式作為組織、壓縮、以及軟體自動化安裝及更新的用途。XPI 的格式同 ZIP 及 JAR,為 PKZIP 壓縮後的檔案,只是內含可供管理安裝方式的腳本。本文目標即為此安裝腳本installer script(通常稱為 install.js)的教學。

- -

任何能解 ZIP 壓縮檔的工具都能開啟 XPI 檔,先來看看裡面有什麼東西:

- -
install.js
-bin\
-  chrome\
-  components
-  defaults\
-  icons\
-  plugins\
-  res\
-
- -

Note that this high-level structure parallels the directory structure of the installed browser very closely:

- -

mozilla directory on linux

- -

As you will see in the installation script, the contents of the archive are installed onto the file system in much the same way that they are stored in the archive itself, though it's possible to rearrange things arbitrarily upon installation--to create new directories, to install files in system folders and other areas.

- -

綜覽安裝腳本

- -

XPI install scripts are written in JavaScript using XPInstall Engine syntax defined in the XPInstall API Reference.

- -

Most installation scripts, including the one discussed here, take the following basic form (in pseudo-code and with links to the sections in which these installation steps are documented):

- -

節譯:大部分的安裝腳本都採以下的概念依流程安裝:

- -
initInstall();
-if (verify_space()) {
-   err = add_dirs_and_files;
-   register_files;
-
-   if (err==SUCCESS) { performInstall() };
-   else { cancelInstall() };
-}
-
- -

As you can see in the code listing, the verification process at the top is on lines 1 to 18; the file addition process, here part of the main installation block, is on lines 24 to 41; the registration part of the main installation block is on lines 42-58; and the execution at the end of the main block is on lines 59 to 71. If you choose not to register the installed software or do the verifications at the front end of the installation, then at a minimum, the install scripts mustinitialize, add the files to be installed, and execute.

- -

Note also that when you call methods on the Install--as you do so often in installation scripts (getFolder, initInstall, addFile, and performInstall are all examples of common Install object methods)--the Install object is implicit; like the window object in regular web page scripts, the Install object does not need to be prefixed to the method.

- -

初始化

- -

All installations must begin with initInstall(). The initInstall() method on the Install object creates a new installation for the specified software and version. In the browser.xpi installation, this function appears at line 20: var err = initInstall("Netscape Seamonkey", "Browser", "6.0.0.2000110807");

- -

如果你在 initInstall() 之前呼叫 Install 物件中的方法,會導致錯誤。

- -

The initInstall method takes the following parameters: the display name of the package, the name of the package as it appears in the client registry, and the version, which can be expressed as a number or as an InstallVersion object. In the example above, "Netscape Seamonkey" is the display name, "Browser" is the registry name, and the version is "6.0.0.2000110807." See initInstall in the XPInstall API Reference for more information on the initialization process.

- -

檢驗安裝目標

- -

The first thing the installation script does when it's executed is to check that there is adequate disk space for the software to be installed, where the verifyDiskSpace function is called as a condition of the main installation block that starts at line 24).

- -
 // 先檢查磁碟剩餘空間
- function verifyDiskSpace(dirPath, spaceRequired)
- {
-   var spaceAvailable;
-   // 取得安裝磁碟之剩餘空間
-   spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
-
-   // 將剩餘空間單位化為 KB
-   spaceAvailable = parseInt(spaceAvailable / 1024);
-   // 開始檢查
-   if(spaceAvailable < spaceRequired)
-   {
-      logComment("Insufficient disk space: " + dirPath);
-      logComment("  required : " + spaceRequired + " K");
-      logComment("  available: " + spaceAvailable + " K");
-      return(false);
-   }
-   return(true);
- }
-
- -

In the verifyDiskSpace block, fileGetDiskSpaceAvailable is called with dirPath as its expected input. This input is defined in line 22, where getFolder() is used to assign a value to the communicatorFolder variable representing the "Program" folder on the local system:

- -
var communicatorFolder = getFolder("Program");
-spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
-
- -

spaceRequired, the other expected input to the verifyDiskSpace function, is given as 17311 kilobytes on line 19. Inside the function, the two sizes are compared and if the available space is larger than the required space, the installation proceeds.

- -

為 Install 物件加入檔案及內含檔案的目錄

- -

一旦確保程式可以開始安裝,就該把想放的檔案加入安裝程序。在 browser.xpi 中,此程式段位於 26 到 41 行:

- -
  err = addDirectory("Program",
-                     "6.0.0.2000110807",
-                     "bin",              // jar source folder
-                     communicatorFolder, // target folder
-                     "",                 // target subdir
-                     true );             // force flag
-
-  logComment("addDirectory() returned: " + err);
-
-  // 建立 plugins 目錄
-  var pluginsFolder = getFolder("Plugins");
-  if (!fileExists(pluginsFolder))
-  {
-      var ignoreErr = dirCreate(pluginsFolder);
-      logComment("dirCreate() returned: " + ignoreErr);
-  }
-  else
-      logComment("Plugins folder already exists");
-
- -

本例檔案都放在單一目錄中, 所以採用 Install 物件的 addDirectory 方法將壓縮檔目錄中的檔案一併加入。addDirectoryaddFile 兩種方法都要指定來源與目的路徑,在此例中是把「bin」目錄中的檔案列為來源,並要求於程式正式呼叫 performInstall 時將檔案安裝到 communicatorFolder 目錄(此變數於第 22 行指定為「Program」)。

- -

"Program" is one of a short list of keywords that can be used in place of full path names in methods such as addFile. "Program" represents the directory where software itself is installed (e.g., C:\Program Files\ on win32 systems), as opposed to supporting directories like "Components", "Chrome", or "Temporary" (see getFolder in the XPInstall API Reference for a list of keywords).

- -

登記軟體

- -

對於一個軟體來說,有時候需要同時在作業系統和 Netscape 6 平台上進行登記「登錄碼」。當你安裝了一個新的 chrome 像是 browser.xpi 時,你需要讓 chrome 登錄碼把這些更新登記在起來;如此一來,面板(skin)、使用者介面(user preference)、檔案清單(packaging list)、本地化文件(localization bundle)就會自動與新的軟體對應。

- -

對於在 win32 作業系統上登記軟體,XPInstall API 提供兩個特別的物件-WinProfileWinReg。它們能夠對 Windows 使用者資料和 Windows 登錄碼進行對應的操作。browser.xpi 安裝腳本並不強制你使用這些物件。關於在 win32 平台上和其他作業系統登記軟體,詳情可以參考 XPInstall API Reference。

- -

而要利用 chrome 登錄碼登記基於 Netscape 6 的新軟體,像是一些外掛(plug-in)、元件(component)、佈景主題(theme)和套件(package),你需要使用 Install 物件中的 registerChrome 函數。如果執行成功,這個函數會回傳一個「0」並且將這筆紀錄寫進 chrome 的子目錄「installed-chrome.txt」這個檔案當中以便以後其他的 chrome 能夠同步更新千變萬化的 RDF 檔案。

- -
 var cf = getFolder("Chrome");
- registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"toolkit.xpi"),"content/global/");
- registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"browser.xpi"),"content/communicator/");
- registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"browser.xpi"),"content/editor/");
- registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"browser.xpi"),"content/navigator/");
- registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/communicator/");
- registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/editor/");
- ...
-
- -

在第 42 行至 58 行,只要有不同的資料夾中存在需要紀錄在 chrome 紀錄碼中的內容, registerChrome 就會被呼叫。 In lines 42-58, registerChrome is called as many times as there are different directories that contain content that needs to be registered with the chrome registry. Note that in the first few lines of this process, new content from the XPI is being registered, and in the remainder, it is new skin information. In this most common form of the registerChrome function (it can also be used to support the now-deprecatedmanifest.rdf style of installation archive), the three parameters represent, in order, the chrome SWITCH used to indicate what kind of software is being registered, the target destination of the software (e.g., the "Chrome" folder in the example above), and the path within the XPI (or JAR theme archive) where the contents.rdf file is located.

- -

See registerChrome in the XPInstall API Reference for more information about registering new packages with the chrome registry.

- -

開始安裝

- -

Once you have added all the files to the installation, the final step is to actually execute the installation. Note that until this point, the install calls you have been making on the Install object are preliminary only. Recall that an install process takes the following general form:

- -
initInstall();
-if (verify_space()) {
-   err = add_dirs_and_files;
-   register_files;
-
-   if (err==SUCCESS) { performInstall() };
-   else { cancelInstall() };
-}
-
- -

In this arrangement, the actual execution of the installation is checked against the errors returned from the addition of files to the installation, which may itself have been conditioned on some verification of version and necessary disk space.

- -

The actual install code used to execute the installation appears in theinstall.js file as follows:

- -
if (err==SUCCESS)
-  {
-     err = performInstall();
-        logComment("performInstall() returned: " + err);
-  }
-
-  else
-  {
-     cancelInstall(err);
-	 logComment("cancelInstall() due to error: " + err);
-  }
-}
-else
-   cancelInstall(INSUFFICIENT_DISK_SPACE);
-
- -

performInstall is the function used to execute the install once it has been initialized and loaded, and it is the last step to installing the software. Note that in the example above, the installation is cancelled if the error code from the file addition process returns success (0), and also cancelled outside the main block if the earlier verification process is not successful.

- -

Note also the comments that indicate the success of various steps in the process--including the performInstall and cancelInstall steps--are written to the install log using the logComment, described in the following section.

- -

安裝紀錄

- -

Logging is an important feature of the XPInstall API that can help you streamline and debug your installations. In the example in the Executing the Installation section and in many places in the installation script, the logComment API is used to write data to a log file that can then be reviewed when things don't go as planned.

- -

The install log is created in the product directory by default (where the browser executable is). If the installation doesn't have proper permission, the install log is written to the user's profile directory. Respectively, these directories correspond to the "Program" and "Current User" keywords for the getFolder method.

- -

更進一步

- -

What does all this mean to you? How can this information be adapted for your own installations? In this final section, we describe the application of the XPInstall technology described here in the creation and deployment of a very simple installation script and installation archive (XPI).

- -

Say you have a simple executable and a README file that goes with it, and you want to make it available for installation from a XPI. After putting these two files in a XPI (which, as described above, is simply a ZIP file with an install.js script at the top and a suffix of '.xpi'), the next step is to add an installation script to the XPI.

- -

Minimally, the installation script must:

- - - -

Here is an example of small but complete installation script.

- -
var xpiSrc = "cd_ripper.exe";
-var xpiDoc = "README_cdrip";
-
-initInstall("My CD Ripper", "cdrip", "1.0.1.7");
-f = getFolder("Program");
-setPackageFolder(f);
-addFile(xpiSrc);
-addFile(xpiDoc);
-
-if (0 == getLastError())
-	performInstall();
-else
-	cancelInstall();
-
- -

The example above shows this minimal installation. This install script does not include any version or disk space checking, very little error checking, only a single executable, no registration, and no commenting. It does, however, take the executable and the README file and install them on the user's system. Note also that for the installation script in a XPI to be automatically triggered from a web page, you must use a "trigger script." The following InstallTrigger function, called from an event handler on a regular web page, will point to the remotely-hosted XPI (called here 'cdrip.xpi') and trigger its installation:

- -
function putIt()
-{
-  xpi={'CD_Ripper':'cdrip.xpi'};
-  InstallTrigger.install(xpi);
-}
-...
-
-<a href="#" onclick="putIt();">install the CD Ripper Now!</a>
-
- -

See the InstallTrigger object in the XPInstall API Reference for more information on triggering installations.

- -
-

原文資訊

- - -
diff --git a/files/zh-tw/archive/mozilla/xul/index.html b/files/zh-tw/archive/mozilla/xul/index.html deleted file mode 100644 index ac13916ad4..0000000000 --- a/files/zh-tw/archive/mozilla/xul/index.html +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: XUL -slug: Archive/Mozilla/XUL -tags: - - XUL -translation_of: Archive/Mozilla/XUL ---- -

 

- -
XUL 指南
-這份指南將協助你開始學習 XUL,原始創作來自於 XULPlanet。
- -
XUL (XML User Interface Language,XML 使用者介面語言) 是 Mozilla 以 XML 為基礎的語言,可以讓你打造豐富功能且跨平台的應用程式,不論是否有連線到網際網路。這些應用程式可以輕鬆地自訂文字、圖案以及排版,因此可以很方便地為不同市場區塊發表不同品牌形象或本地化。已經熟悉 Dynamic HTML (DHTML) 的 Web 開發人員將可以很快地學會 XUL,並且馬上開始開發應用程式。 用 Firefox 或其他以 Gecko 為基礎的瀏覽器開啟 XUL 週期表 ,你將會看到一些 XUL 範例。
- - - - - - - - -
-

文件

- -
-
XUL 參考文獻
-
請參照這份 prefwindow MDC 文件。
-
- -
-
XUL 控制項
-
快速瀏覽 XUL 控制項。
-
- -
-
第一次玩 XUL 就上手
-
介紹 XUL 幾項重要功能與元件。
-
- -
-
選單和彈出選單指南
-
選單和彈出式面板的指南。
-
- -
-
XUL 模板指南
-
一份詳細討論 XUL 模板的指南,是個從資料源產生內容的方法指引。
-
- -
-
XUL 的拖曳處理
-
如何使用拖曳操作。
-
- -
-
為 Firefox 1.5 改寫 XUL 應用程式
-
一份關於 Firefox 1.5 所做變更的清單,會影響到使用 XUL 開發人員。
-
- -

所有文件...

-
-

社群

- -
    -
  • 查閱 Mozilla 討論區...
  • -
- - - - - -

工具

- - - -

所有工具...

- -

相關主題

- -
-
JavaScript, XBL, CSS, RDF, Extensions, XULRunner
-
-
- -

Categories

- -

Interwiki Language Links

diff --git a/files/zh-tw/archive/mozilla/xul/template_guide/index.html b/files/zh-tw/archive/mozilla/xul/template_guide/index.html deleted file mode 100644 index 643bdaea0e..0000000000 --- a/files/zh-tw/archive/mozilla/xul/template_guide/index.html +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Template Guide -slug: Archive/Mozilla/XUL/Template_Guide ---- -

這個頁面無內容。您可以通過貢獻來豐富 MDN 的內容

diff --git a/files/zh-tw/archive/mozilla/xul/the_joy_of_xul/index.html b/files/zh-tw/archive/mozilla/xul/the_joy_of_xul/index.html deleted file mode 100644 index ab1da2e93c..0000000000 --- a/files/zh-tw/archive/mozilla/xul/the_joy_of_xul/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: The Joy of XUL -slug: Archive/Mozilla/XUL/The_Joy_of_XUL -tags: - - XUL -translation_of: Archive/Mozilla/XUL/The_Joy_of_XUL ---- -

 

-

建議的讀者群:想要更加認識 XUL 且想瞭解為什麼 Mozilla 會採用 XUL 的應用開發人員與管理者。

-

翻譯原則:由於考量到預設讀者群應該有某種程度的原文專有名詞的認識基礎,故盡可能保留原文專有名詞,或採用加註的方式呈現。如果文中有對稱關係,則採用對稱保留或加註。

-

 

-

序論

-

XUL (發音〝/zu:l/〞) 是 Mozilla 以 XML 為基礎的使用者介面語言,讓你盡情地開發各式各樣的跨平台應用程式,不論是否在連線到網際網路的狀態皆可。這些應用程式可以藉由簡單地變更文字,圖案與版面佈局,來達到客製化的目的,因此可以輕易地本土化以推廣到各種市場去。如果您已經是熟習 Dynamic HTML (DHTML) 的網頁設計師,那您將可以很快地學會 XUL 並且可以馬上開始動手建構應用程式了。

-

這份文件將介紹一些比較吸引人的理由給網頁設計師,來應用 XUL 以及 Mozilla 相關技術來撰寫跨平台的應用程式。這也將充分說明 Mozilla 要設計 XUL 的動機,以及為什麼 Mozilla 平台是使用 XUL 建構起來的。XUL 的重要特色與優勢將會接著以支援 Mozilla 技術的方式來呈現。最後,有個關於 "使用 XUL 所撰寫之 Calendar" 的小小個案研討,作為補充。

-

重要特色與優勢

- -
強大、以元件為基礎的標示語言 XUL 的目標是建造跨平台的應用程式,以別於原本拿來設計網頁的 DHTML。因此,XUL 設計為應用程式的加工組件(application artifacts),如︰視窗(windows)、標籤(labels)、按鈕(buttons)等,用來取代頁面(pages)、大標題(heading levels)、連結(hypertext links)等。

事實上,許多開發人員已經嘗試在他們的 DHTML 網頁應用程式中達到圖形界面的效果,但這其中的代價就是複雜以及效能,而且沒有任何標準可以支援。

以現有標準為基礎 XUL 是立基於 W3C 標準 XML 1.0 的一個 XML 語言。使用 XUL 的應用程式是建構於這些 W3C 標準技術之上︰HTML 4.0、CSS 1 & 2、DOM Levels 1 & 2、JavaScript 1.5,包括 ECMA-262 Edition 3 (ECMAscript)、XML 1.0。

mozilla.org 正進一步地尋求 W3C 為 eXtensible Binding Language (XBL) 標準化。(參考下面的〝支援技術〞)。

平台可攜性 如同 HTML,XUL 被設計成與平台無關的,可以很容易地讓應用程式在任何存在 Mozilla 的作業系統上面使用。想想看現在有多麼廣泛的平台支援 Mozilla,這是以 XUL 技術來開發應用程式當中,最令人讚嘆的特色。

因為 XUL 提供了使用者介面組成元件的抽象層,因此實現了這個保證︰一經寫就,處處執行 (write-once, run-anywhere)。所有 Mozilla 核心應用程式的使用者介面都是用 XUL 所撰寫的,並且該單一程式碼,在所有 Mozilla 平台上都支援。

分離介面呈現與程式流程 大部分網頁應用程式沒落的主因就是,把使用者介面跟程式流程緊緊的結合在一起了。這在一個團隊的環境中是個頗為難的問題,因為這兩部分所需的技能通常是分散在不同的人身上。

XUL 很清楚地分離出應用程式的各個組成︰程式流程 ("content" 以 XUL、XBL 與 JavaScript 組成)、外觀 ("skin" 以 CSS 和圖像組成)、與特定語言的文字標籤 ("locale" 以 DTD 以及在 .properties 檔案中的對應字串)。XUL 應用程式的佈局與外觀可以自由地改變,獨立程式與流程之外。甚至,應用程式可以本地化為任何語言或地區,完全獨立於程式流程或外觀。

對應用程式作各種分離所得的結果是︰程式設計師可以很容易地維護程式,設計師可以輕鬆地變更設計樣式,而各個語言的翻譯人員也可以自行完成翻譯工作。這樣子獨立的工作流程,相較於以 HTML 為基礎的應用程式更容易協同工作,也減少了整個系統在穩定性與品質上的衝擊。

輕鬆自訂、本地化、打品牌 另一個由分離程式流程,介面呈現和語言文字所直接造成的特點,即是不同的使用者或使用群可以很容易的修改成所需要的樣子。

程式開發人員可以只維護應用程式的主要程式碼,然後藉由使用不同的外觀介面 (skin) 來自訂圖示與品牌觀感給他們不同的顧客群。一個以英文介面撰寫與開發的應用程式,可以被翻譯成法文給相同需求的顧客使用。當這些改變被廣泛地使用在這個應用程式的時候,他們也可以從程式流程與介面呈現之中獨立出來,來分享給所有的自訂版本。

-

支援技術

-

這裡有一些 Mozilla 所用來支援 XUL 撰寫跨平台網頁應用程式的技術。

- -
XBL eXtensible Bindings Language (XBL) 是一種標記語言 (markup language),定義了新的物件元素以及給 XUL 構件 (widget) 的 "bindings"。藉由 XBL,開發人員可以為 XUL 構件定義新的內容,為 XUL 構件添加事件處理,加入新的介面屬性與方法。事實上,XBL 將使得開發人員得以利用自訂現有的標籤 (tag) 或是新增他們所需要的標籤來擴充 XUL。

藉由使用 XBL,開發人員可以輕易地建構出所想要的使用者介面物件,如︰進度表、別緻的彈出式選單、甚至是工具列或搜尋表單。這些自訂物件可以在指定標籤與其屬性之後,使用在各個 XUL 應用程式當中。

Overlays Overlay 是用來描述使用介面之額外內容的 XUL 檔案。他們是一種增添使用介面的通用機制,用以增加額外的元件,覆蓋掉 XUL 檔案中不再支援的使用者介面,並且可以重新利用使用者介面當中的一些片段。

Overlay 對於自訂與擴充現有應用程式而言是個很強大的機制,因為他們是以兩種相關但卻又幾乎完全不同的方式在運作著。某種程度上看來,Overlay 其他語言所謂的〝引入(include)〞檔案,因為一個應用程式可能指定在其定義中引入一個 Overlay。但是 Overlay 也可以只用於外觀上,使得設計人員可以在某個應用程式上頭使用 Overlay,而不需要改變其原始程式。

在實作上,這使得開發人員只需對其應用程式維護一組程式碼,然後再為客戶應用各自自訂的外型,或是引入特別的功能,而這些都完全獨立於主程式碼。這導致整個解決方案的簡化,與降低維護成本。

Overlay 對於那些想要為 Mozilla 增添新功能但又希望保有著作權的軟體開發人員而言還有個特點。這兩種執照聲明︰Netscape Public License (NPL) 和 Mozilla Public License (MPL) 都要求那些有對原始程式 (Mozilla 所提供的那些原始程式碼) 做過修改的開發人員,要釋放出他們變更之後的程式碼給他們的顧客。Overlay 可以在變更著作權的情況下用來為 Mozilla 增添新的功能,而不會污染了最原始的開放原始程式碼。

XPCOM/XPConnect XPCOM 與 XPConnect 都是加強技術,將外部函數庫與 XUL 應用程式整合在一起。

XPCOM,代表的是跨平台組成物件模型 (Cross Platform Component Object Model),是個用來撰寫跨平台與軟體模組化的一個架構。XPCOM 的組成元件可以用 C、C++ 和 JavaScript 來撰寫,並且可以在這些環境下來開發︰C、C++、JavaScript、Python、與 Perl 擴充集。

XPConnect 這個技術是用來製造出簡單的 XPCOM 與 JavaScript 之間的溝通。XPConnect 允許 JavaScript 物件正大光明地存取與運用 XPCOM 物件。他也讓 JavaScript 物件可以表示成 XPCOM 相容介面以供 XPCOM 物件呼叫使用。

將兩者合在一起,XPCOM 和 XPConnect 使得開發人員可以設計那些需要使用編譯式語言的效能或是存取作業系統等級的 XUL 應用程式。

XPInstall XPInstall,Mozilla 的跨平台安裝技術,提供了一個標準的方式將 XUL 應用程式的各個元件包裝成一個安裝檔案,來讓 Mozilla 可以下載並且執行之。

XPInstall 讓使用者可以毫不費力地從網際網路或是公司主機來安裝新的 XUL 應用程式。要安裝一個新的應用程式,使用者只要在網頁上或是電子郵件訊息中的超連結點一下滑鼠,然後在安裝對話方塊中允許安裝新的應用程式即可。

-

個案研討: A Mozilla Calendar Application

-

這個小型的個案研討將敘述 OEone 公司 (http://www.oeone.com) 如何將他的 Calendar 應用程式整合成為 Mozilla 的核心產品. Calendar 包含了 XUL 前端使用介面與以 C 寫成的 XPCOM 元件函式庫 libical , 該函式庫主要是供日期運算以及行事曆資料的儲存. 原本 Calendar 只有在 Linux 上開發, 但是都會成功地在一週之內移植到 Macintosh 和 Windows 平台上.

-

XUL 提供了許多的使用者介面元件. Calendar 的使用者介面完完全全都是用 XUL 所完成的, JavaScript? 還有 CSS, 都可以證明這樣的開發平台所帶來的強大與彈性. 他使用了簡單的 XUL 元件, 例如 boxes, grids, 和 stacks 來構成週, 日, 和月的瀏覽介面. 一開始 Calendar 還沒有利用到 XBL, 因為開發人員還沒完全清楚地掌握這整個開發技術. 但是 Calendar 的未來計畫已經包含了要將這些使用者介面的元件轉換成 XBL widgets 來簡化開發工作.

-

XPCOM/XPConnect 讓整合現有程式碼成為可能. 一個擁有完整行事曆功能的開放原始碼函式庫, libical (http://www.softwarestudio.org/libical/), 被 Calendar 專案所採用. Libical 以開放原始碼的方式實做了 IETF 的 iCalendar 行事曆與排程協定. (RFC 2445, 2446, 及 2447). 他有 iCal 元件並提供了 C API 來操作這些元件的屬性, 參數以及其子元件. 這個函式庫藉由撰寫一個 XPCOM wrapper 來整合操作其使用介面. 為了增進應用程式的效能, 也將程式從 JavaScript 轉移成 XPCOM 元件.

-

外觀呈現與程式寫作的分離, 修改起來超有彈性. 原本的使用者介面使用了大量的圖形檔案來呈現月和週的顯示. 而在開發人員學習了更多關於 XUL 的細節之後, 改用一些較為精巧的元件來呈現這個使用介面. 這不僅加快了顯示的速度, 也節省了許多記憶體與磁碟存取的資源. 他們幾乎重寫整個顯示月和週的使用者介面, 但對於主程式方面則絲毫不受影響, 不需要做任何的改變.

-

轉移 XUL 的應用程式到其他作業平台, 壓根兒不重要. Calendar 原本是個 Linux 上的應用程式, 也沒想過要轉移到其他平台上面去. 但是當原來的開發者 (OEone Corporation) 將原始程式碼貢獻給 Mozilla 專案的時候, Calendar 就必須要想辦法轉移到 Windows 和 Macintosh 的平台上面去. XUL 應用程式的使用者介面不用做任何平台轉移的修改, 因為他可以幾乎不做任何變更就可以在這兩個新的平台上運作. 相類似地, 因為使用者介面是用 JavaScript 寫成的, 互動操作方面的程式也不需要做修改, 不過, 因為 libical 函式庫是由 C 所寫成的, 所以比較需要做修改, 才能轉移到其他平台上面去使用.

-

很幸運地, 現有的 libical 函式庫已經有 Macintosh 平台上的版本可以用了, 藉由 XPCOM 這個跨平台的基石, 在 Macintosh 上的行事曆在幾天之內就完成移植了. 可是那時候還沒有 Win32 上面的版本可以直接拿來用, 所以開發人員需要把 libical 移植到 Windows 平台上面來. 不到一個星期, 這項工作也完成了, 因此 Mozilla 可以在這三個平台上使用行事曆了: Linux, Macintosh, 和 Windows.

-

XPInstall 對於開發者和使用者都很方便. Calendar 沒有被包含在 Mozilla 1.0 裡面一起發行, 因此沒有被當成標準配備而包含在固定的 nightly release builds 裡面. 對於有能力自行編譯 Mozilla 的開發人員而言, 他們可以自己設定相關的環境變數, 並且自己編譯 Calendar 來使用. 但是對於許多想要試看看 Calendar 的 Mozilla 使用者來說, 編譯這件事實在是遙不可及. 但是藉由 XPInstall, 開發者就可以很輕易地包裝各個版本的 Calendar, 然後只要在網路上點擊一個連結就可以直接進行安裝.

-

結論

-

Mozilla, 那出色的 XUL, 使用與 desktop 應用程式相同且豐富的使用者介面與使用體驗, 為開發跨平台的應用程式帶來令人讚嘆的全心體驗. 對於使用 W3C 標準來設計 web 應用程式的設計師們, 可以輕鬆地利用以往的經驗直接轉換到 desktop 應用程式.

-

在 web 成為散佈應用程式供使用者在不同電腦上使用的標準之前, 這個跨平台的問題需要藉由 客戶端-伺服端 (client-server) 的工具來解決. 但這總是會有版權的問題, 開發人員需要支付一筆可觀的金額來購買執行程式時所需要之函式庫的版權, 也同時被廠商給綁住了. Mozilla 為這些跨平台的工具, 提供了相同價值觀但卻是使用開放原始碼版權的選擇.

-

身為快速成長的跨平台技術, XUL 可以填滿一些有趣的技術空缺, 例如那些透過網路存取分散式物件的 Java J2EE 和 Microsoft .Net. 動態的應用程式搭配可以自由變換的使用者介面表達, 這都是依循標準, 具有擴充性, 而且可以很方便的透過網際網路來散播.

-

XUL 模糊了 desktop 和 web 應用程式的分界, 因為他在這兩個世界裡面都有良好的根基. 將 web 應用程式轉換成 XUL 將獲得許多好處, 可以有高度的介面彈性, 在各種支援的平台上擁有一致的操作環境, 而且仍然可以存取你原有的資源, 例如共享的函式庫, 以及本地端的檔案系統.

-

不論你是需要將現有的網頁應用程式轉移到 desktop 而尋求可以讓你輕鬆移轉到多重平台的技術, 或是將你的勁酷功能整合進瀏覽器, XUL 都會是個很值得的選擇.

-

Reference Material

-
  1. XUL Planet - Samples, Tutorials and Language-References to XUL and XBL http://www.xulplanet.com/
  2. Introduction to a XUL Document, Dan Matejka <danm@netscape.com> http://www.mozilla.org/xpfe/xptoolkit/xulintro.html
  3. XBL - Extensible Binding Language 1.0, David Hyatt <hyatt@netscape.com> http://www.mozilla.org/projects/xbl/xbl.html
  4. XBL - XML Binding Language (W3C Note), David Hyatt < hyatt@netscape.com> http://www.w3.org/TR/xbl/
  5. XUL Overlays, Ian Oeschger <oeschger@netscape.com> and David Hyatt <hyatt@netscape.com> http://www.mozilla.org/xpfe/xptoolkit/overlays.html
  6. XPCOM Part 1: An introduction to XPCOM, Rick Parrish <rfmobile@swbell.net> http://www-106.ibm.com/developerwork.../co-xpcom.html
  7. XPConnect (Scriptable Components), John Bandhauer <jband@netscape.com> http://www.mozilla.org/scriptable/
  8. 為 Mozilla 建立新的套件(Package), Ian Oeschger <oeschger@netscape.com> http://www.mozilla.org/docs/xul/xuln..._packages.html
  9. Mozilla Calendar 專案網站, 由 Mike Potter 所維護 <mikep@oeone.com> http://www.mozilla.org/projects/calendar/
  10. -
-
-

原始文件資訊

- -

翻譯文件資訊

- -
-

zh_tw:The Joy of XUL

- -

{{ languages( { "en": "en/The_Joy_of_XUL", "fr": "fr/Les_joies_de_XUL", "ja": "ja/The_Joy_of_XUL", "pl": "pl/Zabawa_j\u0119zykiem_XUL" } ) }}

diff --git a/files/zh-tw/archive/mozilla/xul/xul_reference/index.html b/files/zh-tw/archive/mozilla/xul/xul_reference/index.html deleted file mode 100644 index 337bb2938a..0000000000 --- a/files/zh-tw/archive/mozilla/xul/xul_reference/index.html +++ /dev/null @@ -1,344 +0,0 @@ ---- -title: XUL 參考文件 -slug: Archive/Mozilla/XUL/XUL_Reference -tags: - - XUL -translation_of: Archive/Mozilla/XUL/XUL_Reference ---- -

« XUL Reference «

- - - - - - - - - - - - -
全部 XUL 元件 (按字母排序)
-

action
- arrowscrollbox
- assign
- bbox
- binding
- bindings
- box
- broadcaster
- broadcasterset
- button
- browser
- checkbox
- caption
- colorpicker
- column
- columns
- commandset
- command
- conditions
- content
- datepicker
- deck
- description
- dialog
- dialogheader
- dropmarker
- editor
- grid
- grippy
- groupbox
- hbox
- iframe
- image
- key
- keyset
- label
- listbox
- listcell
- listcol
- listcols
- listhead
- listheader
- listitem

-
-

member
- menu
- menubar
- menuitem
- menulist
- menupopup
- menuseparator
- notification
- notificationbox
- observes
- overlay
- page
- panel
- param
- popupset
- preference
- preferences
- prefpane
- prefwindow
- progressmeter
- query
- queryset
- radio
- radiogroup
- resizer
- richlistbox
- richlistitem
- row
- rows
- rule
- scale
- script
- scrollbar
- scrollbox
- scrollcorner
- separator
- spacer
- spinbuttons
- splitter
- stack
- statusbar

-
-

statusbarpanel
- stringbundle
- stringbundleset
- tab
- tabbrowser (從 Firefox 3/Gecko 1.9 開始支援)
- tabbox
- tabpanel
- tabpanels
- tabs
- template
- textnode
- textbox
- textbox (Firefox autocomplete)
- textbox (Mozilla autocomplete)
- timepicker
- titlebar
- toolbar
- toolbarbutton
- toolbargrippy
- toolbaritem
- toolbarpalette
- toolbarseparator
- toolbarset
- toolbarspacer
- toolbarspring
- toolbox
- tooltip
- tree
- treecell
- treechildren
- treecol
- treecols
- treeitem
- treerow
- treeseparator
- triple
- vbox
- where
- window
- wizard
- wizardpage

-
- -

XUL 參考文件

- -

« XUL Reference «

- - - - - - - - - - - - -
XUL 元件 (按分類)
-

WINDOWS

- -

dialog
- overlay
- page
- window
- wizard
- wizardpage
- preference
- preferences
- prefpane
- prefwindow

- -

WINDOW STRUCTURE

- -

browser
- tabbrowser
- editor
- iframe
- titlebar
- resizer
- statusbar
- statusbarpanel
- dialogheader
- notification
- notificationbox

- -

MENUS AND POPUPS

- -

menubar
- menu
- menuitem
- menuseparator
- menupopup
- panel
- tooltip
- popupset

- -

TOOLBARS

- -

toolbar
- toolbarbutton
- toolbargrippy
- toolbaritem
- toolbarpalette
- toolbarseparator
- toolbarset
- toolbarspacer
- toolbarspring
- toolbox

- -

TABS AND GROUPING

- -

tabbox
- tabs
- tab
- tabpanels
- tabpanel
- groupbox
- caption
- separator
- spacer

-
-

CONTROLS

- -

button
- checkbox
- colorpicker
- datepicker
- menulist
- progressmeter
- radio
- radiogroup
- scale
- splitter
- textbox
- textbox (Firefox autocomplete)
- textbox (Mozilla autocomplete)
- timepicker

- -

TEXT AND IMAGES

- -

description
- label
- image

- -

LISTS

- -

listbox
- listitem
- listcell
- listcol
- listcols
- listhead
- listheader
- richlistbox
- richlistitem

- -

TREES

- -

tree
- treecell
- treechildren
- treecol
- treecols
- treeitem
- treerow
- treeseparator

- -

 

-
-

LAYOUT

- -

box
- hbox
- vbox
- bbox
- deck
- stack
- grid
- columns
- column
- rows
- row
- scrollbox

- -

TEMPLATES

- -

action
- assign
- binding
- bindings
- conditions
- content
- member
- param
- query
- queryset
- rule
- template
- textnode
- triple
- where

- -

SCRIPTING

- -

script
- commandset
- command
- broadcaster
- broadcasterset
- observes
- key
- keyset
- stringbundle
- stringbundleset

- -

HELPER ELEMENTS

- -

arrowscrollbox
- dropmarker
- grippy
- scrollbar
- scrollcorner
- spinbuttons

-
- -

其他 XUL 列表

- - diff --git a/files/zh-tw/archive/mozilla/xulrunner/index.html b/files/zh-tw/archive/mozilla/xulrunner/index.html deleted file mode 100644 index f2e5e0b75c..0000000000 --- a/files/zh-tw/archive/mozilla/xulrunner/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: XULRunner -slug: Archive/Mozilla/XULRunner -tags: - - NeedsTranslation - - NeedsUpdate - - TopicStub - - XUL - - XULRunner -translation_of: Archive/Mozilla/XULRunner ---- -
Getting Started with XULRunner
-A short introduction to XULRunner.
- -
XULRunner is a Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications that are as rich as Firefox and Thunderbird. It provides mechanisms for installing, upgrading, and uninstalling these applications. XULRunner also provides libxul, a solution which allows the embedding of Mozilla technologies in other projects and products.
- - - - - - - - -
-

Releases

- -
-

Until version 41, XULRunner could be downloaded from ftp.mozilla.org.

- -

Firefox (from version 3) ships with a private XULRunner package, which can run any compatible XULRunner application using the -app switch: firefox -app application.ini is equivalent to xulrunner -app application.ini

- -

Older builds are also available.

-
- -

Overview

- - - -

Documentation

- -
-
Getting Started with XULRunner
-
Short tutorial on building desktop applications with XULRunner.
-
XUL Tutorial
-
Once you have a working XULRunner application, use the XUL tutorial to expand it into a fantastic XUL application.
-
XULRunner tips
-
A collection of tips for working with XULRunner.
-
Deploying XULRunner
-
An introduction on how to package your application with XULRunner.
-
XULRunner Hall of Fame
-
Tracks all available applications based on XULRunner.
-
Build Documentation
-
Learn how to get the source and build it.
-
Debug Documentation
-
Steps to configure Venkman to debug your App
-
XULRunner Guide
-
A fairly complete, but outdated, introduction and tutorial for XULRunner which collates much of the documentation found here.
-
- -

View all...

-
-

Community

- - - - - - - -

See also

- - -
- -

 

diff --git a/files/zh-tw/archive/mozilla/xulrunner/xulrunner_tips/index.html b/files/zh-tw/archive/mozilla/xulrunner/xulrunner_tips/index.html deleted file mode 100644 index c51ae6a0ee..0000000000 --- a/files/zh-tw/archive/mozilla/xulrunner/xulrunner_tips/index.html +++ /dev/null @@ -1,213 +0,0 @@ ---- -title: XULRunner秘技 -slug: Archive/Mozilla/XULRunner/XULRunner_tips -translation_of: Archive/Mozilla/XULRunner/Tips ---- -

XULRunner Frequently Asked Questions. Work in progress.

-

Extension Manager

-

To be able to install any extensions, you first need to enable the Extension Manager in application.ini. XULRunner 1.8.0 does not load extensions from the application directory; only the XULRunner directory and the user profile directory are checked. However, it seems that with XULRunner 1.9 the XULRunner directory is ignored, while the profile and application directories are checked. The following prefs must also be set to make the XPInstall dialog, extension manager, and theme manager work:

-
pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul");
-pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul?type=themes");
-pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul?type=extensions");
-pref("xpinstall.dialog.progress.type.skin", "Extension:Manager-themes");
-pref("xpinstall.dialog.progress.type.chrome", "Extension:Manager-extensions");
-pref("extensions.update.enabled", true);
-pref("extensions.update.interval", 86400);
-pref("extensions.dss.enabled", false);
-pref("extensions.dss.switchPending", false);
-pref("extensions.ignoreMTimeChanges", false);
-pref("extensions.logging.enabled", false);
-pref("general.skins.selectedSkin", "classic/1.0");
-// NB these point at AMO
-pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.properties");
-pref("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensions.properties");
-pref("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.properties");
-
-

If your application is based on Gecko 2.0, you need to register a component through the new component registration because the extension manager uses FUEL, namely Application.restart(), to restart your xulrunner-based application after any change (installation, removal, enabling, disabling) in the extensions' list:

-
    -
  1. copy files fuelApplication.js and fuelApplication.manifest from browser/fuel/src for instance into your components/ directory
  2. -
  3. tweak the line #include ../../../toolkit/components/exthelper/extApplication.js in your copy of fuelApplication.js as needed
  4. -
  5. make sure to declare the FUEL module and the two files in your components/Makefile.in as in browser/fuel/src/Makefile.in
  6. -
  7. rebuild...
  8. -
-

Useful Chrome URLs

-

Most of these require branding.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WindowURLWindow Type
Extension Managerchrome://mozapps/content/extensions/extensions.xul?type=extensionsExtension:Manager-extensions
Theme Managerchrome://mozapps/content/extensions/extensions.xul?type=themesExtension:Manager-themes
JavaScript Consolechrome://global/content/console.xulglobal:console
about:configchrome://global/content/config.xul  
-

Developer Extensions

-

Venkman

- -

DOM Inspector

-

To add DOM Inspector 2.0.* to your XULRunner 1.9.0.* application follow these steps:

- -
content  inspector                       jar:inspector.jar!/content/inspector/ xpcnativewrappers=no
-locale   inspector           en-US       jar:inspector.jar!/locale/en-US/inspector/
-skin     inspector           modern/1.0  jar:inspector.jar!/skin/modern/inspector/
-skin     inspector           classic/1.0 jar:inspector.jar!/skin/classic/inspector/
-
-overlay  chrome://inspector/content/popupOverlay.xul   chrome://inspector/content/viewers/dom/popupOverlay.xul
-overlay  chrome://inspector/content/commandOverlay.xul chrome://inspector/content/viewers/styleRules/commandOverlay.xul
-overlay  chrome://inspector/content/keysetOverlay.xul  chrome://inspector/content/viewers/dom/keysetOverlay.xul
-overlay  chrome://inspector/content/popupOverlay.xul   chrome://inspector/content/viewers/styleRules/popupOverlay.xul
-overlay  chrome://inspector/content/commandOverlay.xul chrome://inspector/content/viewers/dom/commandOverlay.xul
-
-

To launch DOM Inspector in your application, you need to open its main window, with a command like this:

-
window.open("chrome://inspector/content/inspector.xul", "", "chrome");
-
-

Alternatively, the DOM Inspector may also be added as an extension:

-
    -
  1. (if you already have inspector installed for another application you can skip to the next step)
    - Follow the instructions above through "Unzip the package."
  2. -
  3. Create a file in the extensions directory of your application with the same name as the DOM Inspector ID (inspector@mozilla.org) containing one line of text -- the exact path to the root directory of DOM inspector (where the install.rdf is) like this one: -
    /home/username/.mozilla/firefox/numbersandletters/extensions/inspector@mozilla.org/
    -
  4. -
  5. Now create a javascript file with the following code and include it in the main window of your application: -
    function startDOMi()
    -{
    -  // Load the Window DataSource so that browser windows opened subsequent to DOM
    -  // Inspector show up in the DOM Inspector's window list.
    -  var windowDS = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]
    -                                   .getService(Components.interfaces.nsIWindowDataSource);
    -  var tmpNameSpace = {};
    -  var sl = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
    -    .createInstance(Components.interfaces.mozIJSSubScriptLoader);
    -  sl.loadSubScript("chrome://inspector/content/hooks.js", tmpNameSpace);
    -  tmpNameSpace.inspectDOMDocument(document);
    -}
    -
    -
  6. -
  7. Now create a hook in your application window to start DOM Inspector, like this one: -
    <button label="Start Inpector" oncommand="startDOMi()"/>
    -
  8. -
  9. Start your application and DOM Inspector will be installed.
  10. -
-

Note: I use this method of installing extensions into all of my Mozilla applications. This way I have one directory where I keep all my Mozilla extensions, and each application (Firefox, Thunderbird) simply contains a few small, one line files pointing to the location of the extensions. (I keep them in source control to be sure I can maintain compatibility)

-

Component Viewer

-

Need custom build, first of all. What else?

-

Extension Developer's Extension

-

Extension Developer's Extension is a useful tool, featuring Live XUL Editor and JavaScript Shell. To install the extension into your application you'll need to hack its install.rdf (see above). You'll probably also want to create menuitems that let you open the JS Shell and other tools provided by the extension.

-

Branding

-

Branding is a chrome package containing product-specific information (e.g. the product name, vendor, and logo). Some XULRunner components (in particular, the Extension Manager) depend on branding, in the sense that they expect to find certain strings in chrome://branding/locale/brand.dtd and chrome://branding/locale/brand.properties. In order to satisfy these dependencies, you can save Firefox's brand.dtd/brand.properties to chrome/locale/branding folder, modify them appropriately, and register a locale provider for branding by adding the following line to your chrome manifest:

-
locale branding en-US chrome/locale/branding/
-
-

The location you put the branding files in doesn't matter, as long as you register it appropriately in the manifest. In addition, a branding content package must be registered to include the application logos:

-
content branding chrome/branding/
-
-

3 files should be provided in this folder: about.png, icon48.png and icon64.png. See Firefox for example.

-

Making Windows display correct application name and icon when buttons are grouped

-

By default, the task bar on Windows might group windows belonging to the same process into one button to save space. This button is usually called "xulrunner.exe" and has XULRunner's icon. There are two approaches to display the branding of your application instead:

- -

Reading command line arguments

-

See Chrome: Command Line. Command line arguments are handled via nsICommandLineHandler, as usual.

-

Preferences needed for file download dialogs

-

To use the unknown-content-type and file-downloads dialogs from a <browser> element, you need to add the following prefs:

-
pref("browser.download.useDownloadDir", true);
-pref("browser.download.folderList", 0);
-pref("browser.download.manager.showAlertOnComplete", true);
-pref("browser.download.manager.showAlertInterval", 2000);
-pref("browser.download.manager.retention", 2);
-pref("browser.download.manager.showWhenStarting", true);
-pref("browser.download.manager.useWindow", true);
-pref("browser.download.manager.closeWhenDone", true);
-pref("browser.download.manager.openDelay", 0);
-pref("browser.download.manager.focusWhenStarting", false);
-pref("browser.download.manager.flashCount", 2);
-//
-pref("alerts.slideIncrement", 1);
-pref("alerts.slideIncrementTime", 10);
-pref("alerts.totalOpenTime", 4000);
-pref("alerts.height", 50);
-
-

If you are missing preferences that a dialog requires, you will get the following errors:

-
Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getBoolPref]
-
-Error: dialog has no properties
-Source File: chrome://mozapps/content/downloads/u...ontentType.xul
-Line: 1
-
-

Enabling Password Manager

-

These preferences seem to be the default in Firefox, however, they are missing in XULRunner. Without these settings Password Manager will not store login details.

-
pref("signon.rememberSignons", true);
-pref("signon.expireMasterPassword", false);
-pref("signon.SignonFileName", "signons.txt");
-
-

You also need to get an instance of the login manager service, which internally initializes the system:

-
Components.classes["@mozilla.org/login-manager;1"].getService(Components.interfaces.nsILoginManager);
-
-

Using Firefox 3 to run XULRunner applications

-

Firefox 3 contains the XULRunner runtime. It has an -app command-line switch to run a specified XUL application instead of starting the browser.

-

On Windows:

-
  firefox.exe -app path\to\application.ini
-
-

On Linux:

-
  firefox -app path/to/application.ini
-

On the Mac:

-
  /Applications/Firefox.app/Contents/MacOS/firefox-bin -app /path/to/application.ini
-
-

Note that at least on the Mac, you need to use a full path. Partial paths don't seem to work.

-

Troubleshooting

-

Window title missing

-

If the title of your XUL <window> is blank, even though you specified a title attribute, make sure the extension on your XUL file is .xul rather than .xml

-

Default Theme

-

To create a default theme you need to create a folder in the extensions folder with an install.rdf in it.  As of Oct. 2008, the folder needs to have the same name as the one in Firefox 3.0. 

-

\MyApp\Extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}\install.rdf

-

It should also have an <em:internalName>classic/1.0</em:internalName> as that is the default theme in Firefox.

-

{{ languages( { "ja": "ja/XULRunner_tips", "fr": "fr/Astuces_XULRunner" } ) }}

diff --git a/files/zh-tw/archive/themes/index.html b/files/zh-tw/archive/themes/index.html deleted file mode 100644 index a440be2e7a..0000000000 --- a/files/zh-tw/archive/themes/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Themes -slug: Archive/Themes -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Themes ---- -

Archived theme documentation.

- -

{{Listsubpages("/en-US/docs/Archive/Themes", 10)}}

diff --git a/files/zh-tw/archive/web/e4x/index.html b/files/zh-tw/archive/web/e4x/index.html deleted file mode 100644 index 7ba42421ff..0000000000 --- a/files/zh-tw/archive/web/e4x/index.html +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: E4X -slug: Archive/Web/E4X -translation_of: Archive/Web/E4X ---- -

This page was auto-generated because a user created a sub-page to this page.

diff --git a/files/zh-tw/archive/web/e4x/processing_xml_with_e4x/index.html b/files/zh-tw/archive/web/e4x/processing_xml_with_e4x/index.html deleted file mode 100644 index 3c8b4cb442..0000000000 --- a/files/zh-tw/archive/web/e4x/processing_xml_with_e4x/index.html +++ /dev/null @@ -1,229 +0,0 @@ ---- -title: 使用 E4X 處理 XML -slug: Archive/Web/E4X/Processing_XML_with_E4X -translation_of: Archive/Web/E4X/Processing_XML_with_E4X ---- -

{{Warning("E4X 已廢棄不用。 It's been disabled by default for chrome in Firefox 17, and completly removed in Firefox 21. 請使用 DOMParser/DOMSerializer 或 a non-native JXON algorithm 替代。")}}

-

使用 E4X 處理 XML

-

JavaScript 在 1.6 版本中首次引入,E4X 引入原生的 XML 物件以供 JavaScript 語言使用,並新增用來在 JavaScript 的代碼中嵌入照字面表達的 XML 文件的語法。

-

E4X 的完整定義可以在 Ecma-357 規範 中找到。本章提供實踐中的語言概要;但這並不是全面的參考資料。

-

相容性的問題

-

在主要的瀏覽器支援 <script> 元素以前,對於嵌入到頁面裡的 JavaScript 存有一種常見的做法,就是使用 HTML 的註解標籤將其包夾,避免瀏覽器直接把 <script> 裡的 JavaScript 代碼顯示在使用者眼前。如今已無須這麼做,不過仍殘存在部分遺留下來的代碼中。為了向後相容的需要,E4X 預設會忽略註解和 CDATA 區段。你可以給你的 <script> 標籤加上 e4x=1 參數以解除這項限制︰

-
<script type="text/javascript;e4x=1">
-...
-</script>
-
-

XML 物件的建立

-

E4X 提供兩種建立 XML 物件的方式。第一種是傳入字串給 XML 建構子︰

-
 var languages = new XML('<languages type="dynamic"><lang>JavaScript</lang><lang>Python</lang></languages>');
-
-

第二種是直接在你的 Script 中嵌入 XML︰

-
 var languages = <languages type="dynamic">
-   <lang>JavaScript</lang>
-   <lang>Python</lang>
- </languages>;
-
-

在這兩種情況裡,產生都會是 E4X XML 物件,他提供了方便的語法用以存取並更新其內夾藏著的資料。

-

XML 物件在外觀上和行為上都和普通的 JavaScript 物件很類似,但有兩件事並不相同。E4X 引入的新語法只能用在 E4X XML 物件上。雖然新語法被設計成對 JavaScript 設計者而言較熟悉的形式,但 E4X 並不提供從 XML 到原生 JavaScript 物件的完整對應;只是看起來很像而已。

-

可以把變數加入到 XML 的字面中用來建立元素的名稱(或是內容)。

-
var h = 'html';
-var text = "Here's some text";
-var doc = <{h}><body>{text}</body></{h}>;
-alert(doc.toXMLString());
-// 產生的是
-<html>
-  <body>Here's some text</body>
-</html>
-
-

屬性的運用

-

當你需要動態的建立標記的時候,XML 字面語法明顯更勝 XML 建構子。使用 E4X 可輕易的在標記中嵌入動態值。只需使用花括弧 ({}) 包夾要建立的屬性值,並省略一般會加上的引號標記,變數和表達式即可用於建立屬性值,如同下例所示︰

-
 var a = 2;
- var b = <foo bar={a}>"hi"</foo>;
-
-

開始執行時,變數的值會被求出,並自動在適當的位置加上引號。前面的例子產生的 XML 物件看起來就像這樣︰<foo bar="2">"hi"</foo>

-

在屬性的替換方面,雙引號會被跳脫成 &quot;,單引號則按平常方式處理。

-
var b = 'He said "Don\'t go there."';
-var el = <foo a={b}/>;
-alert(el.toXMLString());
-// 產生︰<foo a="He said &quot;Don't go there.&quot;"/>
-
-

小於和 & 符號也會被跳脫成各自的等價實體。由於大於符號不會被跳脫,因此如果包含了 CDATA 結束序列 (]]>),就有可能產生 XML 錯誤。

-

通常不會直接在字面(或變數)的屬性內容之中作修改(例如,bar="a{var1}{var2}")。如果有必須使用 JavaScript 表達式計算變數來替代的內容的話(例如,bar={'a'+var1+var2}),在元素字面之前先定義新的變數,在變數中包含完整的修改內容,然後在字面中含入這個變數,或在字面之後取回屬性並將其修改(見下)。

-

可如同屬性值一般的修改屬性的名稱︰

-
var a = 'att';
-var b = <b {a}='value'/>;
-alert(b);
-// Gives:
-<b att="value"/>
-
-
-

…但之後就不能修改表達式(例如,<b {a}>)。

-

執行上面的例子之後,參考 XML 物件的語言變數與 XML 文件中的 <languages> 結點一致。這個結點只有一個屬性︰type,這個屬性可用各種方式來存取並更新︰

-
 alert(languages.@type); // 警報 "dynamic"
- languages.@type = "agile";
- alert(languages.@type); // 警報 "agile"
-
-
 alert(languages.toString());
- /* 警報:
-   <languages type="agile"><lang>JavaScript</lang><lang>Python</lang></languages>
- */
-
-

注意,如果想要把取回的屬性與其他的字串作比較,就有必要先把屬性作轉換,即使屬性有可能會在其他地方被轉換成字串(例如插入到文字框中)。

-
if (languages.@type.toString() === 'agile') {
- ...
-}
-
-

XML 物件的運用

-

XML 物件提供一系列的方法用來查閱並更新其中的內容。這類物件亦支援 JavaScript 的點 (.) 和 [] 符號,但不是用來存取物件的屬性,E4X 覆蓋了這些運算子,改用來存取元素的子結點︰

-
var person = <person>
-  <name>Bob Smith</name>
-  <likes>
-    <os>Linux</os>
-    <browser>Firefox</browser>
-    <language>JavaScript</language>
-    <language>Python</language>
-  </likes>
-</person>;
-
-alert(person.name); // Bob Smith
-alert(person['name']); // Bob Smith
-alert(person.likes.browser); // Firefox
-alert(person['likes'].browser); // Firefox
-
-

如果你使用多於一個以上的元素來存取的話,你會得到 XMLList

-
alert(person.likes.language.length()); // 2
-
-

和 DOM 一樣,* 可以用來存取所有的子結點︰

-
alert(person.likes.*.length()); // 4
-
-

. 運算子會直接存取指定結點的子結點,.. 運算子則會存取所有的子結點,不論嵌入的有多深︰

-
alert(person..*.length()); // 11
-
-

length() 方法在此返回 11,因為元素結點和文字結點兩者都被包含在 XMLList 的結果中。

-

用來表示 XML 元素的物件提供一系列實用的方法,部分方法的解說見下︰TODO: Add all of the methods to the JavaScript reference, link from here

-
alert(person.name.text()) // Bob Smith
-
-var xml = person.name.toXMLString(); // 內含 XML 的字串
-
-var personCopy = person.copy(); // XML 物件的深層複製
-
-var child = person.child(1); // 第二個子結點;目前是 <likes> 元素
-
-

XMLLists 的運用

-

除了 XML 物件以外,E4X 也引入了 XMLList 物件。XMLList 是用來表示附有編號的 XML 物件的集合;例如,元素的列表。接續上面的例子,我們可以在頁面上存取 XMLList<lang> 元素如下︰

-
 var langs = languages.lang;
-
-

XMLList 提供 length() 方法,可用來查出內含元素的數目︰

-
 alert(languages.lang.length());
-
-

注意,有別於 JavaScript 陣列的 length 屬性,這個 length 是方法,不是屬性,而且必須使用 length() 來呼叫。

-

我們可以迭代所有相配的元素,就像這樣︰

-
 for (var i = 0; i < languages.lang.length(); i++) {
-     alert(languages.lang[i].toString());
- }
-
-

在此我們使用同一個語法存取陣列中的已編號項。雖然這部分很類似普通的陣列,但 XMLList 並不支援 Array 的方法,如 forEach,且陣列的通用功能,如 Array.forEach() 也不相容於 XMLList 物件。

-

我們也可以使用在 JavaScript 1.6 中所引入的 for each...in 語法,他已支援 E4X 的部分︰

-
 for each (var lang in languages.lang) {
-     alert(lang);
- }
-
-

for each...in 也可以用在普通的 JavaScript 物件,迭代出內含在物件中的值(不是鍵)。如同 for...in非常不建議 和陣列一起使用。

-

可以使用下面的 XML 字面語法來建立 XMLList,而無須建立格式正確的 XML 文件︰

-
 var xmllist = <>
-   <lang>JavaScript</lang>
-   <lang>Python</lang>
- </>;
-
-

+= 運算子可用來把新的元素附加到文件中的 XMLList

-
 languages.lang += <lang>Ruby</lang>;
-
-

注意,有別於由普通的 DOM 方法所返回的結點列表,XMLList 只是靜態的,而且不會自動更新以反映在 DOM 中的改變。如果你在既有的 XML 物件底下建立 XMLList 作為子集,XMLList 並不會反映 XML 物件的改變;你需要重新建立 XMLList 以取得最近的更新︰

-
 var languages = <languages>
-   <lang>JavaScript</lang>
-   <lang>Python</lang>
- </languages>;
-
- var lang = languages.lang;
- alert(lang.length()); // 警報 2
-
- languages.lang += <lang>Ruby</lang>;
- alert(lang.length()); // 仍舊警報 2
-
- lang = languages.lang; // 重新建立 XMLList
- alert(lang.length()); // 警報 3
-
-

搜尋和過濾

-

E4X 提供特殊的運算子用來在通過指定條件的文件內部選取結點。這種過濾動作是由括弧裡面的表達式所指定的︰

-
var html = <html>
-  <p id="p1">First paragraph</p>
-  <p id="p2">Second paragraph</p>
-</html>;
-
-alert(html.p.(@id == "p1")); // 警報 "First paragraph"
-
-

在表達式前面比對路徑的結點(在本例中即 p 元素)會在表達式求值之前先加上作用域的限縮。就如同已經用 with 語法 指定了一樣。

-

因此,過濾器也可以依據在目前元素中內含的單一結點的值來執行︰

-
var people = <people>
-  <person>
-    <name>Bob</name>
-    <age>32</age>
-  </person>
-  <person>
-    <name>Joe</name>
-    <age>46</age>
-  </person>
-</people>;
-
-alert(people.person.(name == "Joe").age); // 警報 46
-
-

也可以使用 JavaScript 函數當作過濾器的表達式︰

-
function over40(i) {
-    return i > 40;
-}
-
-alert(people.person.(over40(parseInt(age))).name); // 警報 Joe
-
-

命名空間的處理

-

E4X 也全面考慮到命名空間。任何代表結點或屬性的 XML 物件都提供了可返回 QName 物件的 name() 方法,使加上命名空間的元素的查詢更為容易。

-

預設

-
default xml namespace = "http://www.w3.org/1999/xhtml";
-// 目前還沒有必要在 HTML 標記裡指定命名空間
-var xhtml = <html><head><title></title></head><body>
-            <p>text</p></body></html>;
-alert(xhtml.head); // 目前還沒有必要在此處的子元素中指定命名空間
-

非預設

-
var xhtml = <html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>Embedded SVG demo</title>
-	</head>
-	<body>
-		<h1>Embedded SVG demo</h1>
-		<svg xmlns="http://www.w3.org/2000/svg"
-			viewBox="0 0 100 100">
-			<circle cx="50"
-				cy="50"
-				r="20"
-				stroke="orange"
-				stroke-width="2px"
-				fill="yellow" />
-		</svg>
-	</body>
-</html>;
-
-alert(xhtml.name().localName); // 警報 "html"
-alert(xhtml.name().uri); // 警報 "http://www.w3.org/1999/xhtml"
-
-

若要存取非預設命名空間內部的元素,首先建立 Namespace 物件把特定的命名空間的 URI 加以封裝︰

-
var svgns = new Namespace('http://www.w3.org/2000/svg');
-
-

目前可以在 E4X 中使用 namespace::localName 代替一般的元素指定子來作查詢︰

-
var svg = xhtml..svgns::svg;
-alert(svg); // 顯示文件中的 <svg> 部分
-
-

參閱

- -

{{ languages( { "en": "en/Core_JavaScript_1.5_Guide/Processing_XML_with_E4X", "zh-cn": "cn/Core_JavaScript_1.5_Guide/Processing_XML_with_E4X", "fr": "fr/Guide_JavaScript_1.5/Traitement_de_XML_avec_E4X", "ja": "ja/Core_JavaScript_1.5_Guide/Processing_XML_with_E4X" } ) }}

diff --git a/files/zh-tw/archive/web/index.html b/files/zh-tw/archive/web/index.html deleted file mode 100644 index 6f60d315ff..0000000000 --- a/files/zh-tw/archive/web/index.html +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Archived open Web documentation -slug: Archive/Web -tags: - - Archived - - NeedsTranslation - - TopicStub - - Web -translation_of: Archive/Web ---- -

The documentation listed below is archived, obsolete material about open Web topics.

-

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/archive/web_standards/index.html b/files/zh-tw/archive/web_standards/index.html deleted file mode 100644 index 1fed929d5f..0000000000 --- a/files/zh-tw/archive/web_standards/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Web Standards -slug: Archive/Web_Standards -translation_of: Archive/Web_Standards ---- -
In progress. Web standards are carefully designed to deliver the greatest benefits to the greatest number of web users while ensuring the long-term viability of any document published on the Web. Designing and building with these standards simplifies and lowers the cost of production, while delivering sites that are accessible to more people and more types of Internet devices. Sites developed along these lines will continue to function correctly as traditional desktop browsers evolve, and as new Internet devices come to market. {{ Ref(1) }}
- - - - - - - - -
-

Documentation

- -
-
Migrate apps from Internet Explorer to Mozilla
-
Ever have trouble getting your Internet Explorer-specific Web applications to work with Mozilla? This article covers common issues associated with migrating applications to the open source Mozilla-based browser.
-
Using Web Standards in your Web Pages
-
This article provides an overview of the process for upgrading the content of your web pages to conform to the W3C web standards.
-
Choosing Standards Compliance Over Proprietary Practices
-
In the development world, there is a need for standards because applications are designed across multiple development groups.
-
The Business Benefits of Web Standards
-
This article discusses how adhering to web standards, and leaving behind proprietary markup and technologies, can contribute to a company's business goals.
-
- -

View All...

-
-

Community

- -
    -
  • View Mozilla forums...
  • -
- -

{{ DiscussionList("dev-web-development", "mozilla.dev.web-development") }}

- - - -

Tools

- - - -

View All...

- -

Examples

- - - - - -
-
CSS, DHTML, HTML, Web Development, XHTML, XML
-
-
- -
-

{{ endnote(1) }} - The Web Standards Project

- -

{{ languages( { "ca": "ca/Est\u00e0ndards_web", "de": "de/Web-Standards", "es": "es/Est\u00e1ndares_Web", "fr": "fr/Standards_du_Web", "ja": "ja/Web_Standards", "ko": "ko/Web_Standards", "pl": "pl/Standardy_WWW", "pt": "pt/Normas_Web" } ) }}

diff --git a/files/zh-tw/archive/web_standards/rdf_in_fifty_words_or_less/index.html b/files/zh-tw/archive/web_standards/rdf_in_fifty_words_or_less/index.html deleted file mode 100644 index c9d003f911..0000000000 --- a/files/zh-tw/archive/web_standards/rdf_in_fifty_words_or_less/index.html +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: 50 字解說 RDF -slug: Archive/Web_Standards/RDF_in_Fifty_Words_or_Less -translation_of: Archive/Web_Standards/RDF_in_Fifty_Words_or_Less ---- -

 

- -

好吧,可能比 50 字還要多一點,但重點十分簡單(並且已經幫諸位只想看重點的成功人士標為粗體)。資源描述架構,或稱為「RDF」(Resource Description Framework),其實是指兩件事。

- -
首先,RDF 是種圖像式模型,用以描述網路上的資源(如網頁內容、電子郵件訊息等),以及這些資源之間的關係。
- -

不過這到底是什麼意思?對 Mozilla 開發者來說,這代表 RDF 資料模型(就是那個「圖像」)可以用來組織、整合網路上的資源。

- -

舉「書籤」為例。目前大部分的網頁瀏覽器讓你將書籤歸入資料夾的樹狀結構,每個書籤則指向一個網頁的 URI(通用資源定義符,Uniform Resource Identifier)。

- -

但網頁只是眾多網路資源的其中一項,其他還有如電子郵件內容、新聞群組的訊息(或整個新聞群組)、搜尋引擎的探索結果... 等等。基本上,若說這些其他資源不能存入書籤、與其他書籤擺在一起以資料夾整理,也沒什麼道理。甚至還應該可以建立一個「智慧型」資料夾,點選後就動態找出符合某些條件的內容。

- -

一個「書籤」尚且應有眾多相關的屬性:您可能想自己定義一些書籤的「分類規則」、依據麥金塔的「hot」、「warm」、「cool」色彩標準上色;又或許,您想標示某個書籤與另一個書籤有關,還可能想將其同時放入多個不同的資料夾。

- -

RDF 圖像提供絕佳資料模型,可以建立上述的「通用」書籤服務:這種圖像可以指向任意資源、亦能以幾乎任何想得到的方式組織。

- -

別那麼快下結論,還有...

- -
第二,RDF 是種串接式的語法。這種語法讓圖像式的資料模型可以透過「代理人」溝通。
- -

這又是什麼意思?基本上,這代表 RDF 資料模型可以跨越網路來交流,其圖像內容還可以在收到遠端服務的資訊時動態變更。

- -

我們再回到書籤的例子。就說我有個書籤的「資料夾」,其實指向我的電子郵件收件匣:一旦點選這個資料夾,哇喔,所有昨晚收下來的郵件都列出來了!

- -

不過這是怎麼辦到的?其實這個「收件資料夾」指向一個網路資源,此資源內含更多的 RDF 來拓展資源版圖。此「網路資源」為一個指向 CGI 的 URI(像是 http://www.mozilla.org/smart-mail/get-mail.cgi?user=waterson&folder=inbox),此 CGI 會建立串接 RDF、就像是把一張圖片以 XML 方式表達一樣:

- -
 <rdf:RDF
-     xmlns:rdf="http://www.w3.org/TR/WD-rdf-syntax#"
-     xmlns:sm="http://www.mozilla.org/smart-mail/schema#">
-   <rdf:Description
-     about="http://www.mozilla.org/smart-mail/get-mail.cgi?user=waterson&folder=inbox">
-     <sm:message id="4025293">
-        <sm:recipient>
-          Chris Waterson "waterson@netscape.com"
-        </sm:recipient>
-        <sm:sender>
-          Aunt Helga "helga@netcenter.net"
-        </sm:sender>
-        <sm:received-by>x-wing.mcom.com</sm:received-by>
-        <sm:subject>Great recipe for Yam Soup!</sm:subject>
-        <sm:body>
-          http://www.mozilla.org/smart-mail/get-body.cgi?id=4025293
-        </sm:body>
-     </sm:message>
-     <sm:message id="4025294">
-        <sm:recipient>
-          Chris Waterson "waterson@netscape.com"
-        </sm:recipient>
-        <sm:sender>
-          Sarah Waterson "waterson.2@postbox.acs.ohio-state.edu"
-        </sm:sender>
-        <sm:received-by>x-wing.mcom.com</sm:received-by>
-        <sm:subject>We won our ultimate game</sm:subject>
-        <sm:body>
-          http://www.mozilla.org/smart-mail/get-body.cgi?id=4025294
-        </sm:body>
-     </sm:message>
-   </rdf:Description>
- </rdf:RDF>
-
- -

收到上面這堆怪物之後,RDF 引擎會將 RDF 資料放在圖像中的適當位置。負責實際繪出書籤介面的 Tree 控制項此時將收到通知,知道應該繪出 Aunt Helga 關於 Yam Soup 之信件的一些圖示。

- -

其實,這正是 SmartMail 運作的原理。

- -

聯絡: Chris Waterson (waterson@netscape.com)

- -
-

原始文件資訊

- - -
- -

Interwiki Language Links

- -

{{ languages( { "fr": "fr/RDF_en_cinquante_mots", "it": "it/RDF_in_cinquanta_parole_o_meno", "ja": "ja/RDF_in_Fifty_Words_or_Less", "ko": "ko/RDF_in_Fifty_Words_or_Less", "zh-TW": "zh_tw/50_字解說_RDF" } ) }}

diff --git a/files/zh-tw/code_snippets/index.html b/files/zh-tw/code_snippets/index.html deleted file mode 100644 index 095e91dae2..0000000000 --- a/files/zh-tw/code_snippets/index.html +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: Code snippets -slug: Code_snippets -tags: - - Add-ons - - Code snippets - - Extensions - - NeedsTranslation - - TopicStub -translation_of: Archive/Add-ons/Code_snippets ---- -

This is a quick list of useful code snippets (small code samples) available for developers of extensions for the various Mozilla applications. Many of these samples can also be used in XULRunner applications, as well as in actual Mozilla code itself.

-

These examples demonstrate how to accomplish basic tasks that might not be immediately obvious.

-

General

-
-
- Examples and demos from MDN articles
-
- A collection of examples and demos from articles.
-
- Windows code
-
- Opening and manipulating windows
-
- Toolbar
-
- Toolbar related code
-
- Sidebar
-
- Sidebar related code
-
- XML
-
- Code used to parse, write, manipulate, etc. XML
-
- File I/O
-
- Code used to read, write and process files
-
- Drag & Drop
-
- Code used to setup and handle drag and drop events
-
- Dialogs
-
- Code used to display and process dialog boxes
-
- Alerts and Notifications
-
- Modal and non-modal ways to notify users
-
- Preferences
-
- Code used to read, write, and modify preferences
-
- JS XPCOM
-
- Code used to define and call XPCOM components in JavaScript
-
- Running applications
-
- Code used to run other applications
-
- <canvas> related
-
- WHAT WG Canvas-related code
-
- Signing a XPI
-
- How to sign an XPI with PKI
-
- Threads
-
- Performing background operations and delaying execution while background operations complete
-
- Miscellaneous
-
- Miscellaneous useful code fragments
-
- HTML to DOM
-
- Using a hidden browser element to parse HTML to a window's DOM
-
-

JavaScript libraries

-

Here are some JavaScript libraries that may come in handy.

-
-
- StringView
-
- A library that implements a StringView view for JavaScript typed arrays. This lets you access data in typed arrays using C-like string functions.
-
-

Browser-oriented code

-
-
- Tabbed browser code (Firefox/SeaMonkey)
-
- Basic operations, such as page loading, with the tabbed browser, which is the heart of Mozilla's browser applications
-
- Cookies
-
- Reading, writing, modifying, and removing cookies
-
- Page Loading
-
- Code used to load pages, reload pages, and listen for page loads
-
- Interaction between privileged and non-privileged code
-
- How to communicate from extensions to websites and vice-versa.
-
- Downloading Files
-
- Code to download files, images, and to monitor download progress
-
- Password Manager
-
- Code used to read and write passwords to/from the integrated password manager
-
- Bookmarks
-
- Code used to read and write bookmarks
-
- JavaScript Debugger Service
-
- Code used to interact with the JavaScript Debugger Service
-
-

SVG

-
-
- General
-
- General information and utilities
-
- SVG Animation
-
- Animate SVG using JavaScript and SMIL
-
- SVG Interacting with Script
-
- Using JavaScript and DOM events to create interactive SVG
-
- Embedding SVG in HTML and XUL
-
- Using SVG to enhance HTML or XUL based markup
-
-

XUL Widgets

-
-
- HTML in XUL for Rich Tooltips
-
- Dynamically embed HTML into a XUL element to attain markup in a tooltip
-
- Label and description
-
- Special uses and line breaking examples
-
- Tree
-
- Setup and manipulation of trees using XUL and JS
-
- Scrollbar
-
- Changing style of scrollbars. Applies to scrollbars in browser and iframe as well.
-
- Autocomplete
-
- Code used to enable form autocomplete in a browser
-
- Boxes
-
- Tips and tricks when using boxes as containers
-
- Tabbox
-
- Removing and manipulating tabs in a tabbox
-
-

Windows-specific

-
-
- Finding Window Handles (HWND) (Firefox)
-
- How to use Windows API calls to find various kinds of Mozilla window handles. Window handles can be used for IPC and Accessibility purposes.
-
- Using the Windows Registry with XPCOM
-
- How to read, write, modify, delete, enumerate, and watch registry keys and values.
-
- -

The content at MozillaZine Example Code is slowly being moved here, but you can still find useful examples there for now.

diff --git a/files/zh-tw/code_snippets/tabbed_browser/index.html b/files/zh-tw/code_snippets/tabbed_browser/index.html deleted file mode 100644 index b8a3b14fff..0000000000 --- a/files/zh-tw/code_snippets/tabbed_browser/index.html +++ /dev/null @@ -1,398 +0,0 @@ ---- -title: Tabbed browser -slug: Code_snippets/Tabbed_browser -translation_of: Archive/Add-ons/Tabbed_browser ---- -

您將在此尋獲協助您運用Firefox的多頁籤瀏覽器的一些程式碼片段,註解將提示您應該在什麼地方插入您自己的程式碼。

-

 

-

一般來說這些片段會包含其初始化的程式碼。基本假設是這些程式碼片段將於瀏覽器視窗內容中執行,最佳做法是以 load listener 來運行。若您要從瀏覽器視窗以外的地方來操作頁籤,您必須先取得任意一個瀏覽器視窗,詳見: Working with windows in chrome code

-

多世界詮釋算什麼,多 browser 詮釋才夠暈

-

"browser" 有很多意思。把整個 Firefox 稱為 browser 再為理所當然不過,但是 Firefox 有頁籤,每個頁籤本身也都是 browser。無論是一般所指的 web page browser,還是 XUL 裡的 {{ XULElem("browser") }} element,通通叫做 browser。在本文件和其它某些 Firefox 文件裡, browser 還有另一個意思,就是 Firefox XUL window 裡的 tabbrowser element。

-

如何存取 browser

-

從主視窗

-

從 global ChromeWindow 中運行的程式碼,例如套疊 (overlay) 於 browser.xul 的 extension,可以用全域變數 gBrowser 來存取 {{ XULElem("tabbrowser") }} element

-
// gBrowser 只存在於 browser window (browser.xul)
-gBrowser.addTab(...);
-
-

如果 gBrowser 未定義,代表您的程式碼要不是太早運行,就是並非從 browser window 中運行。在 browser window 還沒完全載入之前 gBrowser 根本還不存在。若要在視窗一打開時存取 gBrowser ,請在 event listener 中使用它,並 listen 'load' 事件。

-

若您的程式是 sidebar 或 dialog 而無法存取主視窗,那就要先獲取主視窗才能使用 gBrowser ,詳見: Working with windows in chrome code.

-

從腮巴 (sidebar) 存取 browser

-

若您的附加元件基本上是一坨屎 (sidebar) ,那就:

-
var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                       .getInterface(Components.interfaces.nsIWebNavigation)
-                       .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
-                       .rootTreeItem
-                       .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                       .getInterface(Components.interfaces.nsIDOMWindow);
-
-mainWindow.gBrowser.addTab(...);
-
-

從呆鴨肉 (dialog) 存取 browser

-

若您的程式基本上運行於某種呆鴨肉 (dialog) ,而且是從 browser window 直接甩出來的精選優質肥美呆鴨肉,那就:

-
window.opener.gBrowser.addTab(...);
-
-

如果 window.opener 搞不定,那就用以下的程式碼先取得最近打開的 browser window :

-
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
-                   .getService(Components.interfaces.nsIWindowMediator);
-
-var mainWindow = wm.getMostRecentWindow("navigator:browser");
-mainWindow.gBrowser.addTab(...);
-

如何以 URL 開啟新 tab

-
// Add tab
-gBrowser.addTab("http://www.google.com/");
-
-// Add tab, then make active
-gBrowser.selectedTab = gBrowser.addTab("http://www.google.com/");
-
-

操作新頁籤的內容

-

若要操作新開啟頁籤的內容,就要等它載入完。

-
// 醬子不行啊 .. 人家還沒準備好
-var newTabBrowser = gBrowser.getBrowserForTab(gBrowser.addTab("http://www.google.com/"));
-alert(newTabBrowser.contentDocument.body.innerHTML);
-
-// BETTER WAY
-var newTabBrowser = gBrowser.getBrowserForTab(gBrowser.addTab("http://www.google.com/"));
-newTabBrowser.addEventListener("load", function () {
-  newTabBrowser.contentDocument.body.innerHTML = "<div>hello world</div>";
-}, true);
-
-

onLoad handler 中的 event target 是個 'tab' XUL element。 關於 getBrowserForTab(),參見: tabbrowser

-

如何精準地在 window 或 tab 開啟 URL

-

chrome://browser/content/utilityOverlay.js 中有許多方法例如 openUILinkInopenUILink, 讓 tab 開啟 URL 變簡單。

-
-
- openUILinkIn( url, where, allowThirdPartyFixup, postData, referrerUrl )
-
- where 可以是: -
    -
  • "current" 目前 tab (要是 browser window 連個鬼都沒的話就開新視窗)
  • -
  • "tab" 新的 tab (一樣,鬼都沒有就開新視窗)
  • -
  • "tabshifted" 也是新 tab,但若預設選定新 tab 則會在背景開啟,若預設相反則行為相反 (這就是為什麼叫 shifted)
  • -
  • "window" 新視窗
  • -
  • "save" 直接存檔 (不會提示檔名喔!)
  • -
-
-
- openUILink( url, e, ignoreButton, ignoreAlt, allowKeywordFixup, postData, referrerUrl )
-
-  
-
-

下列程式碼將開啟 URL 並依照什麼鬼滑鼠鍵和什麼鬼熱鍵(例:Ctrl)被按下來開新視窗、開新 tab 或是開在現有的 tab 。這是用於 {{ XULElem("menuitem") }} 的程式碼,而在其它的 XUL elements 上也沒什麼兩樣,但只限 browser.xul 的 overlay 。

-

XUL:

-
<menuitem oncommand="myExtension.foo(event)" onclick="checkForMiddleClick(this, event)" label="Click me"/>
-
-

JS:

-
var myExtension = {
-  foo: function(event) {
-    openUILink("http://www.example.com", event, false, true);
-  }
-}
-

如何優柔寡斷地開啟 URL

-
var gSessionStore = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
-
-// 生一個新 tab 但是沒載入內容
-var url = "https://developer.mozilla.org";
-var tab = gBrowser.addTab(null);
-gSessionStore.setTabState(tab,
-  '{\
-    "entries":[\
-      {\
-        "url":"' + url + '",\
-        "title":"' + url + '"\
-      }\
-    ],\
-    "lastAccessed":0,\
-    "index":1,\
-    "hidden":false,\
-    "attributes":{},\
-    "image":null\
-  }'
-);
-
-

tab 再利用

-

與其每次需要就再開新的 tab,若已有 tab 開啟了欲前往的 URL,最佳做法就是試著重用它。遵循這個做法可使您的附加元件開啟最少的 tab。

-
依 URL/URI 來重用
-

附加元件常見的一項功能是,當 user 按下某個按鈕或連結就從browser window 中將 user 導向至某個 chrome:// 開頭的 URI (像是 help 或 about 這種) 或者一個外部的 HTML (on-line http(s)://) 。接下來的程式碼展示如何重用已顯示所欲前往 URL/URI 的頁籤,如果沒有現存的,則會開個新的。

-
function openAndReuseOneTabPerURL(url) {
-  var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
-                     .getService(Components.interfaces.nsIWindowMediator);
-  var browserEnumerator = wm.getEnumerator("navigator:browser");
-
-  // Check each browser instance for our URL
-  var found = false;
-  while (!found && browserEnumerator.hasMoreElements()) {
-    var browserWin = browserEnumerator.getNext();
-    var tabbrowser = browserWin.gBrowser;
-
-    // Check each tab of this browser instance
-    var numTabs = tabbrowser.browsers.length;
-    for (var index = 0; index < numTabs; index++) {
-      var currentBrowser = tabbrowser.getBrowserAtIndex(index);
-      if (url == currentBrowser.currentURI.spec) {
-
-        // The URL is already opened. Select this tab.
-        tabbrowser.selectedTab = tabbrowser.tabContainer.childNodes[index];
-
-        // Focus *this* browser-window
-        browserWin.focus();
-
-        found = true;
-        break;
-      }
-    }
-  }
-
-  // Our URL isn't open. Open it now.
-  if (!found) {
-    var recentWindow = wm.getMostRecentWindow("navigator:browser");
-    if (recentWindow) {
-      // Use an existing browser window
-      recentWindow.delayedOpenTab(url, null, null, null, null);
-    }
-    else {
-      // No browser windows are open, so open a new one.
-      window.open(url);
-    }
-  }
-}
-
-
依其它準則來重用
-

有時候您可能想重用某個先前已由您的附加元件開啟的頁籤,管它目前 URL/URI 是什麼,只要不是其他的元件開啟的。您的確可以為所欲為,只要在第一次開啟時給它一個自訂屬性。之後要重用它的時候,就從所有已開啟的頁籤找出這個有自訂屬性的頁籤,變更其 URL/URI 並 focus 或 select 該頁籤。要是連個屁都沒有 (可能被 user 關了或是根本沒開過),那就開個新的然後給它這個自訂屬性。

-
function openAndReuseOneTabPerAttribute(attrName, url) {
-  var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
-                     .getService(Components.interfaces.nsIWindowMediator);
-  for (var found = false, index = 0, tabbrowser = wm.getEnumerator('navigator:browser').getNext().gBrowser;
-       index < tabbrowser.tabContainer.childNodes.length && !found;
-       index++) {
-
-    // Get the next tab
-    var currentTab = tabbrowser.tabContainer.childNodes[index];
-
-    // Does this tab contain our custom attribute?
-    if (currentTab.hasAttribute(attrName)) {
-
-      // Yes--select and focus it.
-      tabbrowser.selectedTab = currentTab;
-
-      // Focus *this* browser window in case another one is currently focused
-      tabbrowser.ownerDocument.defaultView.focus();
-      found = true;
-    }
-  }
-
-  if (!found) {
-    // Our tab isn't open. Open it now.
-    var browserEnumerator = wm.getEnumerator("navigator:browser");
-    var tabbrowser = browserEnumerator.getNext().gBrowser;
-
-    // Create tab
-    var newTab = tabbrowser.addTab(url);
-    newTab.setAttribute(attrName, "xyz");
-
-    // Focus tab
-    tabbrowser.selectedTab = newTab;
-
-    // Focus *this* browser window in case another one is currently focused
-    tabbrowser.ownerDocument.defaultView.focus();
-  }
-}
-
-

該函式應如此這般調用:

-
openAndReuseOneTabPerAttribute("myextension-myattribute", "http://developer.mozilla.org/").
-
-

如何砍掉 tab

-

下列程式碼將砍掉目前選擇的 tab。

-
gBrowser.removeCurrentTab();
-
-

另有一個更廣用的 removeTab 方法,以 XUL {{ XULElem("tab") }} element 為唯一的參數。

-

如何改變 active tab

-

左三圈 .. ok,並沒有三圈 .. 選定向左一個 tab:

-
gBrowser.tabContainer.advanceSelectedTab(-1, true);
-
-

右三圈 (喔 .. 抱歉)

-
gBrowser.tabContainer.advanceSelectedTab(1, true);
-
-

如何偵測 page load

-

另見: Code snippets:On page load

-
function examplePageLoad(event) {
-  if (event.originalTarget instanceof HTMLDocument) {
-    var win = event.originalTarget.defaultView;
-    if (win.frameElement) {
-      // Frame within a tab was loaded. win should be the top window of
-      // the frameset. If you don't want do anything when frames/iframes
-      // are loaded in this web page, uncomment the following line:
-      // return;
-      // Find the root document:
-      win = win.top;
-    }
-  }
-}
-
-// do not try to add a callback until the browser window has
-// been initialised. We add a callback to the tabbed browser
-// when the browser's window gets loaded.
-window.addEventListener("load", function () {
-  // Add a callback to be run every time a document loads.
-  // note that this includes frames/iframes within the document
-  gBrowser.addEventListener("load", examplePageLoad, true);
-}, false);
-
-...
-// When no longer needed
-gBrowser.removeEventListener("load", examplePageLoad, true);
-...
-
-

tab 增減通知

-
function exampleTabAdded(event) {
-  var browser = gBrowser.getBrowserForTab(event.target);
-  // browser is the XUL element of the browser that's been added
-}
-
-function exampleTabMoved(event) {
-  var browser = gBrowser.getBrowserForTab(event.target);
-  // browser is the XUL element of the browser that's been moved
-}
-
-function exampleTabRemoved(event) {
-  var browser = gBrowser.getBrowserForTab(event.target);
-  // browser is the XUL element of the browser that's been removed
-}
-
-// During initialization
-var container = gBrowser.tabContainer;
-container.addEventListener("TabOpen", exampleTabAdded, false);
-container.addEventListener("TabMove", exampleTabMoved, false);
-container.addEventListener("TabClose", exampleTabRemoved, false);
-
-// When no longer needed
-container.removeEventListener("TabOpen", exampleTabAdded, false);
-container.removeEventListener("TabMove", exampleTabMoved, false);
-container.removeEventListener("TabClose", exampleTabRemoved, false);
-
-
-

{{ gecko_callout_heading("1.9.1") }}

-

Starting in Gecko 1.9.1 {{ geckoRelease("1.9.1") }}, there's an easy way to listen on progress events on all tabs.

-
-

{{ h2_gecko_minversion("Notification when a tab's attributes change", "2.0") }}

-

自 Gecko 2.0 起,您可以 listen TabAttrModified event 來得知 tab 之 attribute 異動。event listener 可能收到 tab 異動的 attribute 如下:

- -
function exampleTabAttrModified(event) {
-  var tab = event.target;
-  // Now you can check what's changed on the tab
-}
-
-// During initialization
-var container = gBrowser.tabContainer;
-container.addEventListener("TabAttrModified", exampleTabAttrModified, false);
-
-// When no longer needed
-container.removeEventListener("TabAttrModified", exampleTabAttrModified, false);
-
-

{{ h2_gecko_minversion("Notification when a tab is pinned or unpinned", "2.0") }}

-

自 Gecko 2.0 起,tab 可以被 "釘選";也就是說這類 tab 變成一種特殊的 application tabs ("app tabs"),可以被釘在 tab 列的開頭而且只顯示為 favicon。透過 TabPinnedTabUnpinned 事件可以得知 tab 被釘了或被拔了。

-
function exampleTabPinned(event) {
-  var browser = gBrowser.getBrowserForTab(event.target);
-  // browser is the XUL element of the browser that's been pinned
-}
-
-function exampleTabUnpinned(event) {
-  var browser = gBrowser.getBrowserForTab(event.target);
-  // browser is the XUL element of the browser that's been pinned
-}
-
-// Initialization
-
-var container = gBrowser.tabContainer;
-container.addEventListener("TabPinned", exampleTabPinned, false);
-container.addEventListener("TabUnpinned", exampleTabUnpinned, false);
-
-// When no longer needed
-
-container.removeEventListener("TabPinned", exampleTabPinned, false);
-container.removeEventListener("TabUnpinned", exampleTabUnpinned, false);
-
-

如何偵測 tab 選定

-

下列程式碼用來得知 browser 中的 tab 被選定:

-
function exampleTabSelected(event) {
-  var browser = gBrowser.selectedBrowser;
-  // browser is the XUL element of the browser that's just been selected
-}
-
-// During initialisation
-var container = gBrowser.tabContainer;
-container.addEventListener("TabSelect", exampleTabSelected, false);
-
-// When no longer needed
-container.removeEventListener("TabSelect", exampleTabSelected, false);
-
-

如何取得已選定 tab 裡的內文(document)

-

下列程式碼用來獲取選定 tab 中的內文(document),於 browser window scope 中運作,例如從 browser window 的 overlay 。

-
gBrowser.contentDocument;
-
-

-
content.document
-
-

若程式碼是從由 browser window 所開啟的 window 或 dialog,可用以下程式碼獲取已選定 tab 裡所顯示的內文:

-
window.opener.content.document
-
-

若程式從並非自 browser window 所開啟的 window 或 dialog 中運行,則可用 {{ interface("nsIWindowMediator") }} 獲取最近所使用的 browser window 中已選定 tab 裡的內文。

-
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
-                   .getService(Components.interfaces.nsIWindowMediator);
-var recentWindow = wm.getMostRecentWindow("navigator:browser");
-return recentWindow ? recentWindow.content.document.location : null;
-
-

另見: Working with windows in chrome code.

-

如何遍歷 browser

-

要遍歷 tabbrowser 中所有的 browser,要先取得任意一個 browser 的 window。如果程式碼是從 browser.xul overlay 執行 (譬如 toolbar button 或者 menu click handler),可以用預定義的 window 變數。但若是從獨自的 window 執行 (例如 settings/options dialog) 則要用 {{ interface("nsIWindowMediator") }} 來取得任意一個 browser 的window。

-

有了一個 window 後再用 win.gBrowser 取得其 <tabbrowser/> element,其中 win 就是上個步驟中所得到的 browser window 。 如果程式是從 browser.xul overlay 執行的話,可以不必寫 window.gBrowser 直接用 gBrowser 就好。很奇怪沒錯,在所有的 IDE 當中也沒有 gBrowser 這個東西,但是別忘了您是在開發 Firefox 的 extension , 這是它本身的 object model 。

-

最後一步,利用 gBrowser.browsers.length 得知 browser 的數量,並用 gBrowser.getBrowserAtIndex() 取得 <browser/> element。範例:

-
var num = gBrowser.browsers.length;
-for (var i = 0; i < num; i++) {
-  var b = gBrowser.getBrowserAtIndex(i);
-  try {
-    dump(b.currentURI.spec); // dump URLs of all open tabs to console
-  } catch(e) {
-    Components.utils.reportError(e);
-  }
-}
-

透過 DOM Inspector 或參見 {{ source("toolkit/content/widgets/browser.xml","browser.xml") }} 得知對應的 XBL bindings ( 不然參見 {{ XULElem("browser") }} 及 {{ XULElem("tabbrowser") }} 也行),您將可了解 <browser/><tabbrowser/> elements 有哪些方法可用。

-

如何取得觸發 http-on-modify-request notification 的 browser

-

關於http-on-* notification 請參見 Observer notifications

-

請注意,部份 HTTP requests 與 tab 無關;例如 RSS feed updates、extension manager requests 以及 XPCOM components 所發出的 XHR requests 等。在這些情況中,下列程式碼將返回 null 。

-
- 注意:該程式碼使用之 getInterface(Components.interfaces.nsIDOMWindow) 應更新為 {{interface("nsILoadContext")}} ,參見範例
-
observe: function (subject, topic, data) {
-  if (topic == "http-on-modify-request") {
-    subject.QueryInterface(Components.interfaces.nsIHttpChannel);
-    var url = subject.URI.spec; /* url being requested. you might want this for something else */
-    var browser = this.getBrowserFromChannel(subject);
-    if (browser != null) {
-      /* do something */
-    }
-  }
-},
-
-getBrowserFromChannel: function (aChannel) {
-  try {
-    var notificationCallbacks =
-      aChannel.notificationCallbacks ? aChannel.notificationCallbacks : aChannel.loadGroup.notificationCallbacks;
-
-    if (!notificationCallbacks)
-      return null;
-
-    var domWin = notificationCallbacks.getInterface(Components.interfaces.nsIDOMWindow);
-    return gBrowser.getBrowserForDocument(domWin.top.document);
-  }
-  catch (e) {
-    dump(e + "\n");
-    return null;
-  }
-}
-
-

{{ languages( { "fr": "fr/Extraits_de_code/Onglets_de_navigation", "ja": "ja/Code_snippets/Tabbed_browser", "pl": "pl/Fragmenty_kodu/Przegl\u0105danie_w_kartach" } ) }}

diff --git a/files/zh-tw/extensions/index.html b/files/zh-tw/extensions/index.html deleted file mode 100644 index 63a7457aaa..0000000000 --- a/files/zh-tw/extensions/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Extensions -slug: Extensions ---- -

 

- -

This page was auto-generated because a user created a sub-page to this page.

- -

 

diff --git a/files/zh-tw/extensions/using_the_dom_file_api_in_chrome_code/index.html b/files/zh-tw/extensions/using_the_dom_file_api_in_chrome_code/index.html deleted file mode 100644 index e4bd4f169c..0000000000 --- a/files/zh-tw/extensions/using_the_dom_file_api_in_chrome_code/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: 使用 DOM 檔案 API 再FireFox外觀代碼上 -slug: Extensions/Using_the_DOM_File_API_in_chrome_code -translation_of: Extensions/Using_the_DOM_File_API_in_chrome_code ---- -

{{ gecko_minversion_header("6.0") }}

- -

如果你想使用如果你想使用 DOM 檔案 API 在FireFox外觀代碼上面,你可以沒有任何限制的這樣做。事實上你得到了一個特別的功能。你可以建立你可以建立 {{ domxref("File") }} 物件 specifying the path of the file on the user's computer. This only works from privileged code, so web content can't do it. This protects users from the inherent security risks associated with allowing web content free access to the contents of their disks. If you pass a path to the {{ domxref("File") }} constructor from unprivileged code (such as web content), an exception will be thrown.

- -

Accessing a file by hard-coded pathname

- -

To reference a file by its path, you can simply use a string literal:

- -
var file = File("path/to/some/file");
-
- -

Accessing files in a special directory

- -

You can also use the directory service to obtain and build the path to a file to access. For example, let's say your add-on needs to access a file in the user's profile. You can do so like this:

- -
var dsFile = Components.classes["@mozilla.org/file/directory_service;1"]
-                    .getService(Components.interfaces.nsIProperties)
-                    .get("ProfD", Components.interfaces.nsIFile);
-
-dsFile.append("myfilename.txt");
-
-var file = File(dsFile.path);
-
- -

This uses the directory service to locate the profile directory ("ProfD"), then appends the name of the file we want to work with by calling {{ ifmethod("nsIFile", "append") }}. Finally, we instantiate the {{ domxref("File") }} object by passing the string returned by {{ ifmethod("nsIFile", "path") }} to the {{ domxref("File") }} constructor.

- -

You can even simplify this further! You can actually pass the {{ interface("nsIFile") }} object itself directly to the File constructor, resulting in the following code:

- -
var dsFile = Components.classes["@mozilla.org/file/directory_service;1"]
-                    .getService(Components.interfaces.nsIProperties)
-                    .get("ProfD", Components.interfaces.nsIFile);
-
-dsFile.append("myfilename.txt");
-
-var file = File(dsFile);
- -

See also

- - diff --git "a/files/zh-tw/firefox_2_\344\275\210\346\231\257\344\270\273\351\241\214\344\271\213\346\233\264\345\213\225/index.html" "b/files/zh-tw/firefox_2_\344\275\210\346\231\257\344\270\273\351\241\214\344\271\213\346\233\264\345\213\225/index.html" deleted file mode 100644 index 2bf1c7150c..0000000000 --- "a/files/zh-tw/firefox_2_\344\275\210\346\231\257\344\270\273\351\241\214\344\271\213\346\233\264\345\213\225/index.html" +++ /dev/null @@ -1,884 +0,0 @@ ---- -title: Firefox 2 佈景主題之更動 -slug: Firefox_2_佈景主題之更動 -tags: - - 佈景主題 - - 待翻譯 -translation_of: Archive/Themes/Theme_changes_in_Firefox_2 ---- -

本文涵括使佈景主題相容 Firefox 2 的各種修改須知。

- -

 

- -

與瀏覽器更動相關

- -

瀏覽器中有許多更動甚至刪除的檔案,所以佈景主題可能需要修改才能正確套用。此表格列出 XUL 及相對應的 CSS 檔案更動處,供您編修查照。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
檔案名稱CSS 檔細節
feeds/addFeedReader.xulfeeds/addFeedReader.css新檔案,提供添加新消息來源閱讀工具的使用介面。
feeds/subscribe.xhtmlfeeds/subscribe.css新檔案,提供訂閱消息來源(RSS)的介面。
preferences/downloads.xul-自 Firefox 2 起移除。
preferences/general.xul-自 Firefox 2 起移除。
safebrowsing/warning-overlay.xulsafebrowsing/browser-protection.css新檔案,為使用者瀏覽疑似詐騙網站時覆蓋瀏覽器的警告介面。
search/engineManager.xulengineManager.css新檔案,為搜尋引擎管理員視窗的介面。
- -

預設佈景主題的更動

- -

以下列出 Firefox 2 預設佈景主題的變動之處,您可依循本表找出該修改的地方。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
檔案變動描述
browser/bookmarks/addBookmark.css加入與即時摘要相關的 CSS 更動部份。
browser/bookmarks/bookmarksProperties.css新檔案,內含與即時摘要相關的 CSS。
browser/browser.css需為即時摘要、搜尋欄、書籤選單項目圖示及其他部分修改之。
browser/dropmark-nav-small.png新檔案,為使用小圖示時上下一頁旁的下拉選單圖示。
browser/dropmark-nav.png新檔案,為上下一頁旁的下拉選單圖示。
browser/engineManager.css新檔案,搜尋引擎管理員所用的 CSS。
browser/feeds/addFeedReader.css新檔案,新增消息來源閱讀工具的視窗所用之 CSS。
browser/feeds/feedIcon.png新檔案,RSS 圖示。
browser/feeds/feedIcon16.png新檔案,RSS 圖示的 16x16 像素版。
browser/feeds/subscribe.css新檔案,訂閱消息來源時視窗的 CSS。
browser/Go-rtl.png新檔案,網址列尾端的「Go」三角箭頭圖示。
browser/preferences/preferences.css選項視窗的樣式檔。
browser/safebrowsing/browser-protection.css新檔案,控制瀏覽疑似詐騙網站時出現的警告訊息及網址列圖示樣式。
browser/safebrowsing/close16x16.png新檔案,詐騙網站警告視窗的關閉鈕。
browser/safebrowsing/dim.png新檔案,瀏覽疑似詐騙網站時,會覆蓋在整個頁面上使頁面內容變暗的檔案,應為半透明圖以便使用者辨識頁面的內容。
browser/safebrowsing/tail.png新檔案,詐騙網站警告視窗的「尾巴」,藉以製成談話泡泡的樣子。
browser/safebrowsing/warning16x16.png新檔案,網址列詐騙網站警告圖示的 16x16 像素版。.
browser/safebrowsing/warning24x24.png新檔案,此為顯示於詐騙網站警告視窗中的圖示。
browser/search-bar-background-mid.png新檔案,搜尋欄中間的背景。搜尋欄本身及尾端的圖已經拆開分別繪製。
browser/search-bar-background.png已移除。
browser/Search-bar.png已移除。
browser/Search-go-rtl.png新檔案,搜尋欄的搜尋圖示,此為顯示於左側的版本。
browser/Search-go.png新檔案,搜尋欄右側的搜尋圖示。
browser/Search-provider-bkgnd-rtl.pngNew file; the background drawn behind the search provider icon when it's located at the left end of the search bar.
browser/Search-provider-bkgnd.pngNew file; the background drawn behind the search provider icon when it's located at the right end of the search bar.
global/about.cssNew file; CSS used in the application's about box.
global/alltabs-box-bkgnd.pngNew file; the background for the "all tabs" drop-down menu at the right side of the tab bar.
global/alltabs-box-overflow-bkgnd.pngNew file; the background for the "all tabs" drop-down menu when there are enough tabs to activate tab bar scrolling.
global/browser.cssRevised to support new styles for the main browser window.
global/globalBindings.xmlUpdated to support changes to the tab bar, including per-tab close buttons.
global/icons/alltabs.pngNot actually used; left over from earlier drafts of the theme.
global/inactivetab-left.png已移除。
global/inactivetab-right.png已移除。
global/menu.cssUpdated to include new styles.
global/notification.cssNew file; defines styles used by the notification strip that appears at the top of browser windows to present notices such as "a popup was blocked."
global/scrollbox/autorepeat-arrow-dn-dis.gifNew file; icon displayed for a disabled autorepeat down arrow in a scroll box.
global/scrollbox/autorepeat-arrow-dn.gifNew file; icon displayed for an autorepeat down arrow in a scroll box.
global/scrollbox/autorepeat-arrow-up-dis.gifNew file; icon displayed for a disabled autorepeat up arrow in a scroll box.
global/scrollbox/autorepeat-arrow-up.gifNew file; icon displayed for an autorepeat up arrow in a scroll box.
global/scrollbox.cssNeeds to be updated to include new styles.
global/tab-arrow-end-bkgnd.pngNew file; the background for the scrolling tab bar arrow at the right side of the tab bar.
global/tab-arrow-end.pngNew file; the arrow drawn in the scrolling tab bar box at the right end of the tab bar.
global/tab-arrow-start-bkgnd.pngNew file; the background for the scrolling tab bar arrow at the left side of the tab bar.
global/tab-arrow-start.pngNew file; the arrow drawn in the scrolling tab bar box at the left end of the tab bar.
global/tab-left.png新檔案,為分頁標籤的左緣。
global/tab-middle.png新檔案,為分頁標籤中間部分。
global/tab-right.png新檔案,為分頁標籤的右緣。
global/tabbrowser-tabs-bkgnd.png新檔案,為分頁列上標籤後方的背景圖。
global/toolbar.css需更新,將新的樣式資訊加入。
mozapps/extensions/about.cssUpdated with a simplified set of style names, since several styles were identical.
mozapps/extensions/extensions.cssCSS for the add-ons manager window. Updated to support the new features of the Firefox 2 add-ons manager.
mozapps/extensions/itemDisabledFader.pngNew file; a translucent PNG used as an overlay on top of items that are disabled in the add-ons manager.
mozapps/extensions/itemEnabledFader.pngNew file; a translucent PNG used as an overlay on top of items that are enabled in the add-ons manager.
mozapps/extensions/notifyBadges.pngNew file; contains the icons used ito badge the icons for add-ons in the add-on manager window to indicate their status. These look like this in the default theme: -

Image:notifyBadges.png

- -
    -
  • The first icon (green here) indicates that an add-on has an update available.
  • -
  • The second icon (yellow here)appears to be used for blocklisted items; trying to confirm.
  • -
  • The third icon (red here) indicates that an add-on is disabled, either by the user or because it's incompatible with the application.
  • -
  • The fourth icon (blue here)(not sure what this one means).
  • -
-
mozapps/extensions/question.pngNew file; used in the Add-ons Manager when you check for updates. If no updates are found, this icon is displayed at the left side of the message strip that appears across the top of the window.
mozapps/extensions/update.css本檔案為更新精靈的樣式,其中的樣式資訊因應重新設計的更新精靈而較之前少。
mozapps/extensions/viewButtons.pngNew file; contains icons for each of the views that may be available in the add-ons manager. In the default theme, these look something like this: -

Image:viewButtons.png
- The top row contains dimmed versions of the icons below them. The first icon is for the extensions view. The second is for themes. The third is for locales, the fourth is for plugins, the fifth is for updates, and the sixth is for installs.

-
mozapps/prefFirefox 2 已經用不到這個目錄了,應予移除。
- -

Changes in browser

- -

bookmarks/addBookmark.css

- -

addBookmarks.css 檔的最開頭應該加上下列幾行:

- -
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-@namespace html url("http://www.w3.org/1999/xhtml");
-
- -

還有些與即時摘要相關的 CSS 也要加上,以便調整即時摘要選取工具的樣式。這個選取工具僅在頁面有即時摘要時才以可編輯式下拉選單呈現,否則就長得跟一般文字輸入區相同。

- - - -

此檔案將為 addBookmark2.xul 調整樣式。

- -

bookmarks/bookmarksProperties.css

- -

這是 Firefox 2 新增的檔案,其 CSS 碼應該跟你剛才加到 addBookmark.css 裡的一樣。此檔案為 bookmarksProperties.xul 調整樣式。

- -
註: 這個 CSS 應該會另外開一篇檔案展示範例內容,以便往後其他相關文件參照。
- -

browser.css

- -

以下是 Firefox 2 之後不再使用的樣式,應予移除:

- - - -

而以下是 Firefox 2 佈景主題應加上的樣式:

- - - -

可能還有其他的樣式也要一併修改一下。

- -

searchbar.css

- -

以下是 Firefox 2 不再使用的樣式,應予移除:

- - - -

以下是 Firefox 2 應加上的樣式:

- - - -

同樣的,你可能也需要更動其他部分。

- -

preferences/preferences.css

- -

以下是 Firefox 2 不再使用的樣式,應予移除:

- - - -

以下是 Firefox 2 佈景主題應加上的樣式:

- - - -

你依然可能得修改其他部分。

- -

feeds/addFeedReader.css

- -

這是 Firefox 2 中的新檔案,用於調整新增消息來源閱讀工具視窗樣式,即 browser/feeds/addFeedReader.xul。

- - - -

feeds/subscribe.css

- -

這是 Firefox 2 的新檔案,用以調整訂閱消息來源視窗的樣式,即 browser/feeds/subscribe.xhtml。

- - - -

預設佈景主題中也含有 a{{ mediawiki.external('href') }} imgbodyh1h2html 等樣式規則。

- -

safebrowser/browser-protection.css

- -

這個 Firefox 2 的新檔案用以調整偵測詐騙網站功能的樣式。下列樣式一定要設定好、在使用者碰上疑似詐騙網站時提醒他們:

- - - -

而以下樣式則調整碰上疑似詐騙網站時網址列的小圖示,安全跟警告各有不同:

- - - -

engineManager.css

- -

此檔案為 Firefox 2 新增,要調整的樣式如下:

- - - -

Changes in global

- -

about.css

- -

此檔案為 Firefox 2 新增、用以調整「關於 Mozilla Firefox」視窗的樣式。檔案中至少要有下列樣式資訊:

- - - -

預設的佈景主題則額外調整了 bodyhtmlimgulul > li

- -

browser.css

- -

Firefox 2 已不使用下列樣式,應予移除:

- - - -

而以下則是 Firefox 2 佈景主題該新增的樣式:

- - - -

除此之外,依然可能要調整相關的樣式。

- - - -

這是 Firefox 2 用不上的樣式,應予刪除:

- - - -

而 Firefox 2 佈景主題還應該加上下列樣式:

- - - -

若有相關樣式,可能得另外調整。

- -

notification.css

- -

此外 Firefox 2 新增的檔案,用以調整阻擋彈出視窗、提示安裝 plugin 等的訊息列樣式。至少應定義下列樣式:

- - - -

scrollbox.css

- -

請為 Firefox 2 佈景主題的這個檔案加上下列樣式:

- - - -

You may wish to make changes to other styles as well.

- - - -

或許也要更動其他相關的部分。

- -

mozapps 更動處

- -

extensions/about.css

- -

Firefox 2 已經用不著以下樣式了,應予刪除:

- - - -

此外應新增下列樣式:

- - - -

其他關聯的樣式也可能需要變動。

- -

extensions/update.css

- -

Firefox 2 已經用不著以下樣式了,應予刪除:

- - - -

此外應新增下列樣式:

- - diff --git a/files/zh-tw/firefox_3_animated_png_support/index.html b/files/zh-tw/firefox_3_animated_png_support/index.html deleted file mode 100644 index 8ed0584144..0000000000 --- a/files/zh-tw/firefox_3_animated_png_support/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Firefox 3 Animated PNG support -slug: Firefox_3_Animated_PNG_support -translation_of: Mozilla/Tech/APNG ---- -

Firefox 3 支援 Animated PNG

- -

參考資料

- -

延伸閱讀

- diff --git a/files/zh-tw/firefox_3_drag_and_drop_events/index.html b/files/zh-tw/firefox_3_drag_and_drop_events/index.html deleted file mode 100644 index 03cca49700..0000000000 --- a/files/zh-tw/firefox_3_drag_and_drop_events/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: Firefox 3 Drag and Drop Events -slug: Firefox_3_Drag_and_Drop_Events -translation_of: Archive/Mozilla/Drag_and_drop/Drag_and_drop_events ---- -

Firefox 3 加入了兩個新的 events 讓你可以決定 drag 什麼時候開始、什麼時候結束。這些 events 是 HTML 5 規格書的草稿中新加入的。

-

 

-
-
- drag
-
- drag operation 開始時送出。
-
- dragend
-
- drag operation 結束時送出。
-
-

如想知道更多,請看 [Drag and Drop.]

-

這裡有個例子可以參考:

- -

參考資料

-
    -
  1. Drag and Drop events 原始網頁
  2. -
-

延伸閱讀

-
    -
  1. WHATWG HTML 5 Working Draft
  2. -
  3. Drag and Drop
  4. -
  5. nsIDragService
  6. -
diff --git "a/files/zh-tw/gecko_dom_\345\217\203\350\200\203/tcpsocket/index.html" "b/files/zh-tw/gecko_dom_\345\217\203\350\200\203/tcpsocket/index.html" deleted file mode 100644 index a8ed5411b5..0000000000 --- "a/files/zh-tw/gecko_dom_\345\217\203\350\200\203/tcpsocket/index.html" +++ /dev/null @@ -1,140 +0,0 @@ ---- -title: TCPSocket API -slug: Gecko_DOM_參考/TCPSocket -translation_of: Archive/B2G_OS/API/TCPSocket ---- -

此處將以 JavaScript 格式存取原始的 TCP socket API。此 API 目前僅可用於 FirefoxOS 許可/認證的 App。

-

進入點 (Entry point)

-
var TCPSocket = navigator.mozTCPSocket;
-if(TCPSocket){
-  // ...
-}
-

API

-
interface TCPSocket{
-  readonly attribute DOMString host;
-  readonly attribute unsigned short port;
-  readonly attribute boolean ssl;
-  readonly attribute unsigned long bufferedAmount;
-  readonly attribute DOMString binaryType;
-
-  readonly attribute DOMString readyState;
-  readonly attribute DOMString CONNECTING;
-  readonly attribute DOMString OPEN;
-  readonly attribute DOMString CLOSING;
-  readonly attribute DOMString CLOSED;
-
-  TCPSocket open(DOMString host, unsigned short port, [object options]);
-  void suspend();
-  void resume();
-  void close();
-  boolean send(in jsval data);
-
-  attribute onopen;
-  attribute ondrain;
-  attribute ondata;
-  attribute onerror;
-  attribute onclose;
-};
-

屬性 (Attributes)

-
-
- host
-
- Socket 所要連接的 Host。
-
- port
-
- Socket 所要連接的 Port。
-
- ssl
-
- Socket 是否經過 SSL 加密。
-
- bufferedAmount
-
- 位於 Socket 緩衝區內,尚未傳送資料的位元數。
-
- readyState
-
- Socket 狀態。可能為 {CONNECTING, OPEN, CLOSING, CLOSED}。
-
-

常數 (Constants)

-
-
- CONNECTING
-
- 該數值表示 Socket 的連結狀態。尚未無法傳送資料。
-
- OPEN
-
- 該數值表示 Socket 的開啟狀態。已可傳送資料。
-
- CLOSING
-
- 該數值表示 Socket 的關閉中狀態。
-
- CLOSED
-
- 該數值表示 Socket 的已關閉狀態。
-
-

函式 (Method)

-
-
- open(host, port [, options])
-
- 所回傳的新 TCP Socket,均已於指定的 port 連上指定的 hostOptions 將作為正規物件。以下為可用選項:
-
- -
-
- send(data)
-
- 將緩衝所要傳送至網路的資料。若可安全緩衝更多資料,則將回傳 true。若是回傳 false,即代表將緩衝更多資料。但若要達到較佳效能 (保持較小緩衝),則應等待下個 drain 事件以緩衝更多資料。
-
- suspend()
-
- 暫停 data 事件。
-
- resume()
-
- 繼續 data 事件。若於 Socket 並未暫停的情況下而呼叫此方式,隨即將丟出錯誤。
-
- close()
-
- 關閉 TCP Socket。
-
-

事件 (Events)

-

透過 on* 屬性,可將 Event Listener 附加至 Socket。

-
-
- open
-
- 在此事件之後,Socket 即準備好傳送/接收資料。
-
- drain
-
- Socket 中可緩衝更多資料。
-
- error
-
- 發生錯誤。在 open 事件之前,將拒絕連結作業 (不會發生 close 事件)。在 open 事件之後,就會遺失連結作業 (事件之後隨即觸發 close 事件)
-
- data
-
- 已接受到某些資料。事件的物件將包含 data 屬性,以利檢索資料。在建立 Socket 時,即已設定資料型態。
-
- close
-
- 已關閉 Socket。
-
-

敘述 (Description)

-

此 API 僅可用於 FirefoxOS 許可/認證過的 App。而其指涉的 Host 與 Port 均必須由 app manifest 所提及。

-

僅限認證過的 App 可用 1024 以下的 Port。

-

另請參閱

- diff --git a/files/zh-tw/introducing_the_audio_api_extension/index.html b/files/zh-tw/introducing_the_audio_api_extension/index.html deleted file mode 100644 index cc33296a5d..0000000000 --- a/files/zh-tw/introducing_the_audio_api_extension/index.html +++ /dev/null @@ -1,181 +0,0 @@ ---- -title: 介紹音效 API -slug: Introducing_the_Audio_API_Extension -translation_of: Archive/Mozilla/Introducing_the_Audio_API_Extension ---- -

音效 API 是 HTML5 規範中的媒體元素 {{ HTMLElement("audio") }} 與 {{ HTMLElement("video") }} 的補充功能,它讓開發者可以存取音效的後設資料跟音頻本身的生資料。開發者可以具象化這些音效資料,分析這些資料,甚至是創造出新的音效資料。

-

讀取音頻串流

-

loadedmetadata 事件

-

當一個媒體的後設資料傳至使用者電腦的時候,一個 loadedmetadata 事件會被觸發。這個事件有以下這些屬性:

- -

這些資料在解碼音頻資料串流的的時候會用到。下面是一個從一個音頻元素取出這些資料的例子:

-
<!DOCTYPE html>
-<html>
-  <head>
-    <title>JavaScript 後設資料範例</title>
-  </head>
-  <body>
-    <audio id="audio-element"
-           src="song.ogg"
-           controls="true"
-           style="width: 512px;">
-    </audio>
-    <script>
-      function loadedMetadata() {
-        channels          = audio.mozChannels;
-        rate              = audio.mozSampleRate;
-        frameBufferLength = audio.mozFrameBufferLength;
-      }
-      var audio = document.getElementById('audio-element');
-      audio.addEventListener('loadedmetadata', loadedMetadata, false);
-    </script>
-  </body>
-</html>
-
-

MozAudioAvailable 事件

-

當播放一個音頻源的時候,樣本資料會被傳播至音頻處理層級而這些樣本也會被輸入進音頻緩衝(大小取決於mozFrameBufferLength)。當緩衝被填滿的時候,一個 MozAudioAvailable 事件會被觸發,而這個事件就含有一段時間內的樣本。這些樣本不一定在事件被觸發的時候已經被播放過,也不一定馬上反應媒體元素上的靜音設定或是音量調整。音頻的播放、暫停、跳躍都會影響生音頻資料串流。

-

MozAudioAvailable 事件有兩個屬性:

- -

frame緩衝含有一個音頻樣本的陣列。請注意樣本不會照對應的頻道分隔,而是混在一起。舉例來說,一個二頻道訊號:頻道1-樣本1 頻道2-樣本1 頻道1-樣本2 頻道2-樣本2 頻道3-樣本1 頻道3-樣本2。

-

讓我們擴充之前的範例,在一個 {{ HTMLElement("div") }} 元素裡顯示時間戳記跟首兩個樣本:

-
<!DOCTYPE html>
-<html>
-  <head>
-    <title>JavaScript 具象化範例</title>
-    <body>
-    <audio id="audio-element"
-           src="revolve.ogg"
-           controls="true"
-           style="width: 512px;">
-    </audio>
-	<pre id="raw">hello</pre>
-    <script>
-      function loadedMetadata() {
-        channels          = audio.mozChannels;
-        rate              = audio.mozSampleRate;
-        frameBufferLength = audio.mozFrameBufferLength;
-      }
-
-      function audioAvailable(event) {
-        var frameBuffer = event.frameBuffer;
-        var t = event.time;
-
-        var text = "Samples at: " + t + "\n"
-        text += frameBuffer[0] + "  " + frameBuffer[1]
-        raw.innerHTML = text;
-      }
-
-      var raw = document.getElementById('raw')
-      var audio = document.getElementById('audio-element');
-      audio.addEventListener('MozAudioAvailable', audioAvailable, false);
-      audio.addEventListener('loadedmetadata', loadedMetadata, false);
-
-    </script>
-  </body>
-</html>
-
-

產生一個音頻串流

-

產生並裝置一個由腳本撰寫的 {{ HTMLElement("audio") }} 元素(也就是沒有 src 屬性)也是可以的。你可以用腳本設定音頻串流,然後寫入音頻樣本。網頁製作者必須產生一個音頻物件然後使用 mozSetup() 函式來設定頻道的數量跟頻率(赫茲)。舉例來說:

-
// 產生一個新的音頻元素
-var audioOutput = new Audio();
-// 設定此音頻元素的串流為「雙聲道,44.1千赫」
-audioOutput.mozSetup(2, 44100);
-
-

再來就需要做樣本。這些樣本和 mozAudioAvailable 事件的樣本用的格式是一樣的。這些樣本可以用 mozWriteAudio() 函式來寫入音頻串流。請注意並不是所有的樣本都會被寫入串流。函示會回傳被寫入串流的樣本數,這對於下一次要寫入資料的時候的很好用。請看下面的例子:

-
// 用JS陣列來寫樣本
-var samples = [0.242, 0.127, 0.0, -0.058, -0.242, ...];
-var numberSamplesWritten = audioOutput.mozWriteAudio(samples);
-
-// 用參數化陣列來寫樣本
-var samples = new Float32Array([0.242, 0.127, 0.0, -0.058, -0.242, ...]);
-var numberSamplesWritten = audioOutput.mozWriteAudio(samples);
-
-

我們在下一個範例做一個脈動:

-
<!doctype html>
-<html>
-  <head>
-     <title>及時產生音頻</title>
-   <script type="text/javascript">
-     function playTone() {
-       var output = new Audio();
-      output.mozSetup(1, 44100);
-       var samples = new Float32Array(22050);
-       var len = samples.length;
-
-       for (var i = 0; i < samples.length ; i++) {
-         samples[i] = Math.sin( i / 20 );
-       }
-              output.mozWriteAudio(samples);
-     }
-   </script>
- </head>
- <body>
-   <p>當你按下以下的按鈕之後,這個demo會撥一秒鐘的音調。</p>
-   <button onclick="playTone();">播放</button>
- </body>
- </html>
-

mozCurrentSampleOffset() 方法回傳音頻串流的「可聽位置」,也就是最後一次被播放的樣本的位置。

-
// 取得當時後端音頻串流的可聽位置(以樣本數計算)。
-var currentSampleOffset = audioOutput.mozCurrentSampleOffset();
-
-

對於正在被播放的樣本(正在被硬體播放的樣本位置可以由 mozCurrentSampleOffset() 取得),為了保持一點點的領先(「一點點」一般大約是500 ms),你應該定期地用 mozWriteAudio() 寫入固定額度的音頻資料。舉例來說,假如我們設此音頻為雙聲道與每秒44100個樣本、間隔時間為100 ms、pre-buffer為500 ms,則我們每次需要寫 (2 * 44100 / 10) = 8820 個樣本,總計的樣本數是 (currentSampleOffset + 2 * 44100 / 2)。(譯注:個人覺得這段寫得很怪,直接看例子可能會比較好懂。)

-

為了讓聲音的播放不間斷但是在寫入音頻資料資料與播放的時間差為最小,自動偵測最小的pre-buffer也是可能的。為了達到這個目的,你可以在一開始的時候寫入很小部份的資料,當看到 mozCurrentSampleOffset() 的回傳值大於 0 的時候測量其時間差。

-
var prebufferSize = sampleRate * 0.020; // 初使緩衝為 20 ms
-var autoLatency = true, started = new Date().valueOf();
-...
-// 延遲(Latency)的自動偵測
-if (autoLatency) {
-  prebufferSize = Math.floor(sampleRate * (new Date().valueOf() - started) / 1000);
-  if (audio.mozCurrentSampleOffset()) { // 開始播放了嗎?
-    autoLatency = false;
-}
-
-

處理音頻串流

-

由於 MozAudioAvailable 事件與 mozWriteAudio() 方法都是使用 Float32Array 為傳值,把一個音頻串流的輸出直接接上(或是處理過後接上)另一個是可以做到的。你應該將第一個音頻串流設為靜音使得只有第二音頻元素能被聽到。

-
<audio id="a1"
-       src="song.ogg"
-       controls>
-</audio>
-<script>
-var a1 = document.getElementById('a1'),
-    a2 = new Audio(),
-    buffers = [];
-
-function loadedMetadata() {
-  // 將音頻 a1 設為靜音
-  a1.volume = 0;
-  // 講 a2 的設定弄成與 a1 相等,然後由這個播放。
-  a2.mozSetup(a1.mozChannels, a1.mozSampleRate);
-}
-
-function audioAvailable(event) {
-  // 寫入當下的 framebuffer
-  var frameBuffer = event.frameBuffer;
-  writeAudio(frameBuffer);
-}
-
-a1.addEventListener('MozAudioAvailable', audioAvailable, false);
-a1.addEventListener('loadedmetadata', loadedMetadata, false);
-
-function writeAudio(audio) {
-  buffers.push(audio);
-
-  // 有在緩衝裡的資料的話,寫入該資料
-  while(buffers.length > 0) {
-    var buffer = buffers.shift();
-    var written = a2.mozWriteAudio(buffer);
-    // 如果非所有資料都被寫進去的話,將之留在緩衝裡:
-    if(written < buffer.length) {
-      buffers.unshift(buffer.slice(written));
-      return;
-    }
-  }
-}
-</script>
-
-

參見

- -

{{ languages( { "en": "en/Introducing_the_Audio_API_Extension"} ) }}

diff --git a/files/zh-tw/localization_quick_start_guide/index.html b/files/zh-tw/localization_quick_start_guide/index.html deleted file mode 100644 index 51fb9d4f8e..0000000000 --- a/files/zh-tw/localization_quick_start_guide/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: Localization quick start guide -slug: Localization_Quick_Start_Guide -tags: - - Localization - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Localization/Quick_start_guide ---- -

Welcome to Mozilla localization (l10n for short)!

-

Whether you're here to start up your own localization in the Mozilla project or to join the efforts of an existing localization, you've come to the right place. This guide is filled with all of the basic, technical information you need to get involved in the Mozilla l10n program. We will take you through the steps to get started, from the initial environment setup to testing and releasing your own localization. Along the way, you'll learn about the variety of projects you can contribute to and the tools used to localize them.

-

When we get to specific examples, we'll take them from the Firefox project, as it is the most widely localized project within Mozilla. As you near the end of this guide, you should be able to make a change to Firefox in your local setting and then see that change in the Firefox interface. In closing, when you finish this guide, you will have all the tools necessary to start contributing!

-

Remember, this guide will instruct you on the technical aspects of Mozilla l10n only. Visit the L10n Process page to learn about the whole process.

-
-

Initial setup

- Tech prep work before localizing.
-
-

Translation phase

- L10n tools tutorials for translation.
-
-

QA phase

- L10n testing tutorials.
-
-

Release phase

- Steps to shipping your localization work.
-
- These four stages make up tech side of the l10n program. To learn more about any of these, click on any of the links above. To get the big picture, we suggest you start with the green bubble and move from stage to stage.
-

 

-
- Note: This guide is written for two types of contributors: those starting a new localization and those joining an existing localization. It is important to know which information applies to which type of contributor. To help you filter through to the most applicable information, note that all information that is unique to those starting a new localization will be in orange font. All information that is unique to those joining an existing localization will be in blue font.
-

 

-

{{ Next("Localization_Quick_Start_Guide/Initial_setup") }}

diff --git a/files/zh-tw/localization_quick_start_guide/initial_setup/index.html b/files/zh-tw/localization_quick_start_guide/initial_setup/index.html deleted file mode 100644 index 00400f6dac..0000000000 --- a/files/zh-tw/localization_quick_start_guide/initial_setup/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: Initial setup -slug: Localization_Quick_Start_Guide/Initial_setup -translation_of: Mozilla/Localization/Quick_start_guide/Initial_setup ---- -

在你参与到本地化项目之前,你要做几件事情:获取源码、获取相关工具、配置好本地环境(你的电脑)。同时你也要看一下项目里面是不是已经有你母语的本地化工作已经在进行。下面就来谈谈上面说的这几个事情。

-

新项目还是正在进行的项目

-

首先你要确定你参与的项目是新项目还是正在进行的项目。只有知道了项目的类型,你才能明白在接下来的教程里面哪些信息是针对你的。

-

你可以这么做:

-

浏览 localization community directory to see if one already exists for your locale.

-
    -
  1. If a community already exists, reach out to them and ask how you can help.
  2. -
  3. If a community doesn't exist, send an email to the new-locales newsgroup for additional guidance.
  4. -
-

Accounts

-

There are a handful of accounts that you need to be aware as you begin. They're not required for you to begin contributing, but will be required when you are preparing to produce an official release. For now, simply be aware that these will become important as your efforts progress. These accounts will store your code, contributions, and help you produce an official localization.

-
-
- hg (Mercurial)
-
- Mercurial is the revision control environment that houses the main Mozilla source code as well as localized code for each official Mozilla localization. You will need this for localizing Mozilla applications. For anyone to gain access to hg repos, you must visit the Mozilla Commiter page and follow the process outlined there. Here is an example bug that illustrates the process well. Use this bug template when filing your hg account registration bug. Add a request about creating your locale's repository to the new locales newsgroup.
-
- SVN
-
- SVN is a revision control environment that Mozilla uses to house Mozilla source websites and their localizations for each official Mozilla localization. See this wiki page about how to gain access to SVN. Add a request about creating your locale's repository to the new locales newsgroup.
-
-
-
- Web-based L10n tools
-
- We'll talk about these in a little bit. For now, just be aware that should you choose to use them, you may need to create a personal account.
-
- Mozilla LDAP
-
- You will need a Mozilla LDAP account once you're ready to have your localization registered on the main Mozilla repositories. Add a request about creating your LDAP account to the new locales newsgroup.
-
- Locale-specific Bugzilla component
-
- Having a Bugzilla component specific to your locale will help us to track your localization's progress from first steps to official release. It will also notify us when you're having problems unique to your localization team's work. Add a request about creating your locale's Bugzilla component to the new locales newsgroup.
-
-

Local environment tools

-

Similar to accounts, there is a number of environment tools that you should install on your personal computer. These tools will help you to store your contributions, build Mozilla applications and language packs, and test your work.

-
-
- Hg (Mercurial)
-
- As noted above, we use Mercurial for maintaining Mozilla source code and localized code. Not only will you need a localization repository to store your localizations, but you need to have it installed and configured on your personal computer as well. You can find everything you need to know about installing and configuring Mercurial for your localization work here.
-
-
-
- compare-locales
-
- compare-locales is a Python script that helps you check your work without needing to run Firefox or another application. Install intructions are located here.
-
- L10n checks
-
- L10n checks is another Python script that helps you check your work without running an application. Install instructions are located here.
-
- autoconf 2.13
-
- autoconf is a utility that is vital to manually creating Mozilla application builds and language packs. We use version 2.13 and higher for these builds. You can find the source files and install instructions here.
-
- wget
-
- wget is a command-line utility that allows you to retrieve files using internet protocols. We use it for retrieving files from repositories. You can find the source files and install instructions here.
-
- Perl
-
- Perl is a programming language that will help you create Mozilla application builds and language packs. You can find the source files and install instructions here.
-
- Python
-
- Python is a programming language in which many of our L10n testing scripts are written. You can find the source files and install instructions here.
-
- Locale Switcher or Quick Locale Switcher
-
- Both Locale Switcher and Quick Locale Switcher are add-ons for Mozilla applications. Either one is necessary to enable you to see your work within a Mozilla application. You can install either by searching for them in Firefox's add-ons manager or following these links.
-
- A solid, Unicode-based, text editor
-
- Here are some suggestions: - -
-
- GNU make
-
- Make is a tool which controls the generation of executables. You can find version 3.79.1 or higher here. Unfortunately, other varieties of make won't do.
-
-

End of initial setup

-

Now that you've finished your initial setup, it's time for the best part: translating!

-

{{ PreviousNext("Localization_Quick_Start_Guide", "Localization_Quick_Start_Guide/Translation_phase") }}

diff --git a/files/zh-tw/mercurial/index.html b/files/zh-tw/mercurial/index.html deleted file mode 100644 index 1a375a0643..0000000000 --- a/files/zh-tw/mercurial/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Mercurial -slug: Mercurial -translation_of: Mozilla/Mercurial ---- -

Mercurial (also known as "hg"), is the distributed version control software used for the development of Firefox, Thunderbird, and the shared Gecko core. It replaced CVS after Mozilla 1.9 was branched.

-

hg is the Mercurial command-line tool, Hg being the chemical symbol for the element mercury.

-

Learning to use Mercurial

-

First, read every word of Mercurial basics, before you do anything else.

-

Then, the Mercurial FAQ is a decent place to start.

-

See Getting Mozilla Source Code Using Mercurial for getting a tree to build.

-

See Mercurial Queues for managing queues of patches, and how to integrate Mercurial with Bugzilla.

-

Further reading

-

The hg book is the definitive Mercurial user guide.

-

The Mercurial tag lists the Mercurial-related articles on MDC.

-

And on wiki.mozilla.org, these helpful pages:

- -

{{ languages( { "es": "es/Mercurial", "fr": "fr/Mercurial", "ja": "ja/Mercurial" } ) }}

diff --git a/files/zh-tw/mozilla/add-ons/add-on_debugger/index.html b/files/zh-tw/mozilla/add-ons/add-on_debugger/index.html deleted file mode 100644 index 2b3106d6af..0000000000 --- a/files/zh-tw/mozilla/add-ons/add-on_debugger/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: 附加元件除錯工具箱 -slug: Mozilla/Add-ons/Add-on_Debugger -translation_of: 'https://extensionworkshop.com/documentation/develop/debugging/' ---- -

{{AddonSidebar}}

- -

附加元件除錯工具箱提供 Firefox 工具箱中的部分工具,能在附加元件的作用範圍中除錯:

- - - -

需要重新啟動瀏覽器的 XUL overlay 附加元件無法使用附加元件除錯工具箱,這類的元件請使用瀏覽器工具箱

- -

請看這段影片,快速認識附加元件除錯工具箱:

- -

{{EmbedYouTube("KU3Xsck7qy0")}}

- -

啟用附加元件除錯工具箱

- -
-

如欲啟用附加元件除錯工具箱,您必須啟用 Firefox 裡的「啟用瀏覽器 chrome 與附加元件除錯工具箱」及「啟用遠端除錯」兩項設定。您可開啟網頁工具箱裡的設定,而後在「進階設定」一區中啟用上述選項。

-
- -

開啟附加元件除錯工具箱

- -

註:如前所述,附加元件除錯工具是專供不需重新啟動、以 SDK 製作的附加元件使用。若想為其他類型的附加元件除錯,請使用瀏覽器工具箱裡的工具。

- -

Now open the Add-on Manager. Next to the entry for your add-on you will see a button labeled "Debug". Click this button to launch the debugger.

- -

Next you'll see a dialog asking you to accept an incoming connection. Click "OK", and the debugger will start in a separate window. Note that sometimes the debugger window is hidden by the main Firefox window.

- -

{{EmbedYouTube("DvNpUVJcG_E")}}

- -

使用附加元件除錯工具

- -

The Add-on Debugger looks and behaves very much like the Browser Toolbox, except that while the scope of the Browser Toolbox is the whole browser, the Add-on Debugger is focused on the specific add-on for which you launched it. Like the Browser Toolbox, a toolbar along the top lets you switch between a number of different tools. In Firefox 31 there's only one such tool, the JavaScript Debugger, but with Firefox 32 you also get the Console and Scratchpad.

- -

JavaScript 除錯器

- -

This behaves just like the normal JavaScript Debugger, except its scope is the add-on rather than a web page. On the left-hand side it lists JavaScript sources:

- - - -

Content scripts

- -

Content scripts are only listed if and when they are loaded. So, if your Add-on loads a content script with contentScriptFile, the file will not appear in the debugger sources until you go to a page that loads the content script.

- -

If you set a breakpoint in a content script, it will not be active for instances of the content script which are loaded after the breakpoint is set.

- -

For example, suppose you have an add-on that attaches a content script to every tab the user loads. The content script adds a click handler to the page. As soon as you open a tab, this content script will be listed in the debugger. If you then set a breakpoint in the content script's click handler, then execution will pause whenever you click the page. But if you open a new tab, there are now two instances of the content script, and the breakpoint will not be enabled for the second instance You'll need to set a new breakpoint now if you want to it work for the second instance.

- -

We're investigating improvements to this in bug 1016046.

- -

主控台

- -

The Console behaves just like the Web Console, but its scope is the add-on rather than the web page.

- -

However, note that it actually runs in the context of the add-on's bootstrap.js, which may not be what you expect if your add-on uses the SDK: you won't see any objects defined in your add-on's main.js, and you won't see require() either. This issue is being tracked as bug 1005193.

- -

You can execute Console statements in the context of main.js while execution is paused inside main.js.

- -

程式碼速記本

- -

The Scratchpad behaves just like the normal Scratchpad, but its scope is the add-on rather than the web page.

- -

Like the Console, the add-on Scratchpad runs in the context of the add-on's bootstrap.js even if the add-on uses the SDK, and as with the Console you can execute Scratchpad code in the context of main.js while execution is paused inside main.js.

- -

為 chrome: 或 about: 頁面除錯

- -

從 Firefox 37 起,一般的除錯工具已經可以用來為 chrome: 及 about: 兩類頁面除錯,使用方法同一般網頁除錯。

diff --git a/files/zh-tw/mozilla/add-ons/add-on_guidelines/index.html b/files/zh-tw/mozilla/add-ons/add-on_guidelines/index.html deleted file mode 100644 index fe05866a87..0000000000 --- a/files/zh-tw/mozilla/add-ons/add-on_guidelines/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: Add-on guidelines -slug: Mozilla/Add-ons/Add-on_guidelines -translation_of: 'https://extensionworkshop.com/documentation/publish/add-on-policies/' ---- -

These add-on guidelines were created to foster an open and diverse add-on developer community while ensuring an excellent user experience. They apply to all add-ons and add-on updates regardless of where they are hosted, and also apply to customizations performed by installers that configure Firefox without using an add-on. Add-ons hosted on AMO are subject to additional policies.

-

Be Transparent

- -

Be Respectful to Users

- -

Be Safe

- -

Be Stable

- -

Exceptions

- -

Other exceptions may apply.

-

Enforcement

-

Add-ons that do not follow these guidelines may qualify for blocklisting, depending on the extent of the violations. Guidelines qualified with the word - - must - are especially important, and violations thereof will most likely result in a blocklisting nomination.

-

The Add-ons Team will do their best to contact the add-on's developers and provide a reasonable time frame for the problems to be corrected before a block is put in place. If an add-on is considered malicious or its developers have proven unreachable or unresponsive, or in case of repeat violations, blocklisting may be immediate.

-

Guideline violations should be reported via Bugzilla, under Tech Evangelism > Add-ons. Questions can be posted in the #addons IRC channel.

-

These guidelines may change in the future. All updates will be announced in the Add-ons Blog.

diff --git a/files/zh-tw/mozilla/add-ons/amo/index.html b/files/zh-tw/mozilla/add-ons/amo/index.html deleted file mode 100644 index 3857ed65ca..0000000000 --- a/files/zh-tw/mozilla/add-ons/amo/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: AMO -slug: Mozilla/Add-ons/AMO -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/AMO ---- -

Content to be added.

diff --git a/files/zh-tw/mozilla/add-ons/amo/policy/index.html b/files/zh-tw/mozilla/add-ons/amo/policy/index.html deleted file mode 100644 index 8ac1738387..0000000000 --- a/files/zh-tw/mozilla/add-ons/amo/policy/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: AMO 政策 -slug: Mozilla/Add-ons/AMO/Policy -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/AMO/Policy ---- -

{{AddonSidebar}}

- -

Mozilla 致力於確保套件的用戶與開發者,都有著良好的體驗。提交套件以前,請閱讀以下政策。

- -
-
Developer Agreement
-
Effective January 5, 2016
Review Process
-
Add-ons extend the core capabilities of Firefox, allowing users to modify and personalize their Web experience. A healthy add-on ecosystem, built on trust, is vital for developers to be successful and users to feel safe making Firefox their own. For these reasons, Mozilla requires all add-ons to comply with the following set of policies on acceptable practices. The below is not intended to serve as legal advice, nor is it intended to serve as a comprehensive list of terms to include in your add-on’s privacy policy.
Featured Add-ons
-
How up-and-coming add-ons become featured and what's involved in the process.
聯絡我們 - -

如何就這些套件的政策,與我們取得聯繫

- -
diff --git "a/files/zh-tw/mozilla/add-ons/amo/policy/\350\201\257\347\265\241\350\263\207\350\250\212/index.html" "b/files/zh-tw/mozilla/add-ons/amo/policy/\350\201\257\347\265\241\350\263\207\350\250\212/index.html" deleted file mode 100644 index 7358e5f642..0000000000 --- "a/files/zh-tw/mozilla/add-ons/amo/policy/\350\201\257\347\265\241\350\263\207\350\250\212/index.html" +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: 附加元件聯絡資訊 -slug: Mozilla/Add-ons/AMO/Policy/聯絡資訊 -translation_of: Mozilla/Add-ons#Contact_us ---- -

誠摯的感謝您連絡 Mozilla 附加元件團隊,淺請先閱讀本頁說明以確保您的訊息被正確的遞送。

- -

附加元件支援服務

- -

若你需要特定附加元件的支援訊息,比如說 "我該如何使用這個附加元件?" 或 "它怎麼不能...?",請透過列於附加元建列表中的聯絡方式,聯絡該附加元件的開發者。

- -

附加元件編輯者審閱

- -

若你有任何關於某個附加元件的編輯者審閱(Editor's review)的疑問,或想回報政策違反,請 E-mail 至 amo-editors@mozilla.orgAlmost all add-on reports fall under this category. Please be sure to include a link to the add-on in question and a detailed description of your question or comment.

- -

Add-on Security Vulnerabilities

- -

If you have discovered a security vulnerability in an add-on, even if it is not hosted here, Mozilla is very interested in your discovery and will work with the add-on developer to correct the issue as soon as possible. Add-on security issues can be reported confidentially in Bugzilla or by emailing amo-admins@mozilla.org.

- -

Website Functionality & Development

- -

If you've found a problem with the site, we'd love to fix it. Please file a bug report in Bugzilla, including the location of the problem and how you encountered it.

- -

How to get in touch with us regarding these policies or your add-on.

diff --git a/files/zh-tw/mozilla/add-ons/firefox_for_android/api/index.html b/files/zh-tw/mozilla/add-ons/firefox_for_android/api/index.html deleted file mode 100644 index a8e6ebf9e0..0000000000 --- a/files/zh-tw/mozilla/add-ons/firefox_for_android/api/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: API -slug: Mozilla/Add-ons/Firefox_for_Android/API -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Add-ons/Legacy_Firefox_for_Android/API ---- -

There are a couple of differences between desktop Firefox and Firefox for Android that are particularly relevant to add-on developers:

- - - -

Instead, Firefox for Android provides its own APIs:

- - - -

In these pages we've documented the main functions and properties exposed by these objects. To see all the details, refer to the code at browser.js.

diff --git a/files/zh-tw/mozilla/add-ons/firefox_for_android/index.html b/files/zh-tw/mozilla/add-ons/firefox_for_android/index.html deleted file mode 100644 index 8ade48ff37..0000000000 --- a/files/zh-tw/mozilla/add-ons/firefox_for_android/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: Extensions for Firefox for Android -slug: Mozilla/Add-ons/Firefox_for_Android -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Add-ons/Legacy_Firefox_for_Android ---- -

Firefox for Android supports add-ons using the same extension system used by all other Gecko-based applications. You can use the Add-on SDK or build manually bootstrapped restartless add-ons. You can even develop traditional restart-required add-ons, although the other two approaches are preferable.

- -

Add-ons that work with desktop Firefox do not automatically work in Firefox for Android:

- - - -

The following articles provide help with developing extensions for Firefox on Android. In addition, please refer to the general extension documentation that applies to all Mozilla applications.

- -
-
-

Tutorials

- -
-
Walkthrough
-
Developing, packaging and installing a simple add-on for Firefox for Android.
-
Firefox Hub Walkthrough
-
How to develop a Firefox Hub add-on to add content to the Firefox for Android home page.
-
Add-on SDK
-
How to develop Firefox for Android add-ons using the Add-on SDK.
-
- -

Sample code

- -
-
Code Snippets
-
Code samples for common tasks.
-
Initialization and Cleanup
-
How to initialize your add-on when it is started and clean up when it is shut down.
-
Firefox for Android Add-ons Github Repo
-
A collection of JS modules, sample code, and boilerplate repos to help you build add-ons for Firefox for Android.
-
-
- -
-

API reference

- -
-
NativeWindow
-
Create native Android UI widgets.
-
BrowserApp
-
Access browser tabs and the web content they host.
-
Prompt.jsm
-
Show native Android dialogs.
-
HelperApps.jsm
-
Query and launch native apps installed on the system.
-
Notifications.jsm
-
Use extended properties for Android system notifications.
-
Home.jsm
-
Customize the home page.
-
HomeProvider.jsm
-
Store data to display on the home page.
-
 
-
-
-
- -

 

diff --git a/files/zh-tw/mozilla/add-ons/sdk/builder/index.html b/files/zh-tw/mozilla/add-ons/sdk/builder/index.html deleted file mode 100644 index f7dc93a009..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/builder/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Builder -slug: Mozilla/Add-ons/SDK/Builder -translation_of: Archive/Add-ons/Add-on_SDK/Builder ---- -

Add-on Builder 是 Web-based 的開發環境,讓開發者能以 SDK API 來開發附加元件,而不必使用 cfx 命令列工具。Add-on Builder 已經於 2014 年 4 月 1 日下架,而原本的網址「builder.addons.mozilla.org」則轉至此頁。
-
- 若您過去使用 Builder 來開發採用 SDK 的附加元件,便已獲得絕大部分以 SDK 直接開發的必備知識。Builder 中的 high-levellow-level API,就跟 SDK 裡的一模一樣。改用 SDK 很簡單:

- diff --git a/files/zh-tw/mozilla/add-ons/sdk/guides/index.html b/files/zh-tw/mozilla/add-ons/sdk/guides/index.html deleted file mode 100644 index f4e37d9e10..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/guides/index.html +++ /dev/null @@ -1,115 +0,0 @@ ---- -title: Guides -slug: Mozilla/Add-ons/SDK/Guides -translation_of: Archive/Add-ons/Add-on_SDK/Guides ---- -

This page lists more theoretical in-depth articles about the SDK.

-
-

Contributor's guide

-
-
-
-
- Getting Started
-
- Learn how to contribute to the SDK: getting the code, opening/taking a bug, filing a patch, getting reviews, and getting help.
-
- Modules
-
- Learn about the module system used by the SDK (which is based on the CommonJS specification), how sandboxes and compartments can be used to improve security, and about the built-in SDK module loader, known as Cuddlefish.
-
- Classes and Inheritance
-
- Learn how classes and inheritance can be implemented in JavaScript, using constructors and prototypes, and about the helper functions provided by the SDK to simplify this.
-
-
-
-
-
- Private Properties
-
- Learn how private properties can be implemented in JavaScript using prefixes, closures, and WeakMaps, and how the SDK supports private properties by using namespaces (which are a generalization of WeakMaps).
-
- Content Processes
-
- The SDK was designed to work in an environment where the code to manipulate web content runs in a different process from the main add-on code. This article highlights the main features of that design.
-
-
-
-
-

SDK infrastructure

-
-
-
-
- Module structure of the SDK
-
- The SDK, and add-ons built using it, are of composed from reusable JavaScript modules. This explains what these modules are, how to load modules, and how the SDK's module tree is structured.
-
- SDK API lifecycle
-
- Definition of the lifecycle for the SDK's APIs, including the stability ratings for APIs.
-
-
-
-
-
- Program ID
-
- The Program ID is a unique identifier for your add-on. This guide explains how it's created, what it's used for and how to define your own.
-
- Firefox compatibility
-
- Working out which Firefox releases a given SDK release is compatible with, and dealing with compatibility problems.
-
-
-
-
-

SDK idioms

-
-
-
-
- Working With Events
-
- Write event-driven code using the the SDK's event emitting framework.
-
- Content scripts guide
-
- An overview of content scripts, including: what they are, what they can do, how to load them, how to communicate with them.
-
-
-
-
-
- Two Types of Scripts
-
- This article explains the differences between the APIs available to your main add-on code and those available to content scripts.
-
-
-
-
-

XUL migration

-
-
-
-
- XUL Migration Guide
-
- Techniques to help port a XUL add-on to the SDK.
-
- XUL versus the SDK
-
- A comparison of the strengths and weaknesses of the SDK, compared to traditional XUL-based add-ons.
-
-
-
-
-
- Porting Example
-
- A walkthrough of porting a relatively simple XUL-based add-on to the SDK.
-
-
-
-

 

diff --git a/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/context-menu/index.html b/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/context-menu/index.html deleted file mode 100644 index 42c5e0ca85..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/context-menu/index.html +++ /dev/null @@ -1,588 +0,0 @@ ---- -title: context-menu -slug: Mozilla/Add-ons/SDK/High-Level_APIs/context-menu -translation_of: Archive/Add-ons/Add-on_SDK/High-Level_APIs/context-menu ---- -
-

Stable

-
-

加入選單項目、子選單、選單分隔線到頁面右鍵選單。

-

用法

-

Instead of manually adding items when particular contexts occur and then removing them when those contexts go away, you bind items to contexts, and the adding and removing is automatically handled for you. Items are bound to contexts in much the same way that event listeners are bound to events. When the user invokes the context menu, all of the items bound to the current context are automatically added to the menu. If no items are bound, none are added. Likewise, any items that were previously in the menu but are not bound to the current context are automatically removed from the menu. You never need to manually remove your items from the menu unless you want them to never appear again.

-

For example, if your add-on needs to add a context menu item whenever the user visits a certain page, don't create the item when that page loads, and don't remove it when the page unloads. Rather, create your item only once and supply a context that matches the target URL.

-

Context menu items are displayed in the order created or in the case of sub menus the order added to the sub menu. Menu items for each add-on will be grouped together automatically. If the total number of menu items in the main context menu from all add-ons exceeds a certain number (normally 10 but configurable with the extensions.addon-sdk.context-menu.overflowThreshold preference) all of the menu items will instead appear in an overflow menu to avoid making the context menu too large.

-

Specifying Contexts

-

As its name implies, the context menu should be reserved for the occurrence of specific contexts. Contexts can be related to page content or the page itself, but they should never be external to the page.

-

For example, a good use of the menu would be to show an "Edit Image" item when the user right-clicks an image in the page. A bad use would be to show a submenu that listed all the user's tabs, since tabs aren't related to the page or the node the user clicked to open the menu.

-

The Page Context

-

First of all, you may not need to specify a context at all. When a top-level item does not specify a context, the page context applies. An item that is in a submenu is visible unless you specify a context.

-

The page context occurs when the user invokes the context menu on a non-interactive portion of the page. Try right-clicking a blank spot in this page, or on text. Make sure that no text is selected. The menu that appears should contain the items "Back", "Forward", "Reload", "Stop", and so on. This is the page context.

-

The page context is appropriate when your item acts on the page as a whole. It does not occur when the user invokes the context menu on a link, image, or other non-text node, or while a selection exists.

-

宣告式場景條件(Declarative Contexts)

-

當你藉由設定 context 屬性(該屬性為: 傳給 constructor 的選項物件之屬性)來新增選單項目時,你可以指定一些簡單的宣告式場景條件, 如下:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "My Menu Item",
-  context: cm.URLContext("*.mozilla.org")
-});
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Constructor選單項目出現的條件
PageContext() 當場景為網頁時.
SelectionContext() 當使用者在網頁上選取項目時.
SelectorContext(selector) 當選單在符合下述條件之一的節點上顯示: selector匹配, CSS 選擇器, 或 其祖先節點匹配選擇器. selector可以有多個(以逗點分隔), 例如, "a[href], img".
URLContext(matchPattern) 特定網址的網頁. matchPattern is a match pattern string or an array of match pattern strings. 當 matchPattern 是陣列, 網址符合任何陣列元素之一時. These are the same match pattern strings that you use with the page-mod include property. Read more about patterns.
PredicateContext(predicateFunction)當選單被觸發時,predicateFunction 函數被呼叫,若函數傳回值為真值,則選單項目顯示。這函數傳入一物件,物件有著描述選單觸發場景條件的屬性.
arrayAn array of any of the other types. This context occurs when all contexts in the array occur.
-

選單項目也有 context 屬性,可以用在新增或移除宣告式場景條件,當建構後. 例如:

-
var context = require("sdk/context-menu").SelectorContext("img");
-myMenuItem.context.add(context);
-myMenuItem.context.remove(context);
-

當選單項目被指定了多個場景條件, 選單項目顯示於所有場景條件皆成立時.

-

In Content Scripts

-

宣告式場景條件很容易使用,但功能不強. 舉例來說, 你希望選單項目出現的條件為:「有著至少一張圖片的頁面」, 但宣告式場景條件並不能達成這一點.

-

當你需要對選單項目的出現時機有著更多的控制, 你可以使用 content scripts. 如同 SDK 的其他 APIs 一樣, context-menu API 使用 content scripts 以讓你的附加元件與瀏覽器中的頁面互動. 在最上層選單的每一個選單項目可以使用 content script.

-

每當選單即將顯示時,一個特殊事件,其名為 "context" ,觸發於你的 content scripts. 如果你為這個事件註冊了偵聽(listener)函數,當函數傳回真值時, 與偵聽函數關聯的選單項目會被顯示於選單中.

-

下例中, 當選單觸發於「有著至少一張圖片的頁面」時,顯示選單項目.

-
require("sdk/context-menu").Item({
-  label: "This Page Has Images",
-  contentScript: 'self.on("context", function (node) {' +
-                 '  return !!document.querySelector("img");' +
-                 '});'
-});
-

需要注意的是偵聽函數有一個參數叫 node. 這個 node 指的是使用者在頁面上按右鍵來觸發選單的頁面觸發節點. 你可以使用它來決定是否要顯示選單項目.

-

你可以在 content script 中,同時指定宣告式場景條件和 context 偵聽函數. 在這種情況下, 先評估宣告式場景條件, 然後你的選單項目顯示條件為:所有宣告式場景條件成立,並且你的 context 偵聽函數傳回真值.

-

如果任一宣告式場景條件未成立, 那麼你的 context 偵聽函數不會被呼叫. 下面的例子利用了這點. 確保了偵聽函數只在 image node 上觸發選單時,才會被呼叫:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "A Mozilla Image",
-  context: cm.SelectorContext("img"),
-  contentScript: 'self.on("context", function (node) {' +
-                 '  return /mozilla/.test(node.src);' +
-                 '});'
-});
-

However, if you do combine SelectorContext and the "context" event, be aware that the node argument passed to the "context" event will not always match the type specified in SelectorContext.

-

SelectorContext will match if the menu is invoked on the node specified or any descendant of that node, but the "context" event handler is passed the actual node on which the menu was invoked. 上個例子有作用,是因為 <IMG> 元素內不能包含其他元素, 但底下的例子裡, node.nodeName 不能保證是 "P" - 例如說, 當使用者在一個段落(<P>)的連結(<A>)上點右鍵時,它不會是 "P" :

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "A Paragraph",
-  context: cm.SelectorContext("p"),
-  contentScript: 'self.on("context", function (node) {' +
-                 '  console.log(node.nodeName);' +
-                 '  return true;' +
-                 '});'
-});
-

The content script is executed for every page that a context menu is shown for. It will be executed the first time it is needed (i.e. 當右鍵選單第一次顯示,並且選單項目的所有宣告式場景條件皆成立時) ,接著處於作用中,直到你銷毀你的選單項目或者關閉頁面.

-

處理選單項目上的點擊

-

content script 除了上述所說的功能(用來偵聽 "context" 事件)以外,你可以使用 content script 來處理選單項目上的點擊. 當使用者點擊選單項目時,一個名為 "click" 的事件在選單項目的 content script 內被觸發.

-

因此, 欲處理選單項目上的點擊, 可以藉由偵聽選單項目 content script 內的 "click" 事件, 如下:

-
require("sdk/context-menu").Item({
-  label: "My Item",
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  console.log("Item clicked!");' +
-                 '});'
-});
-

注意:偵聽函數有兩參數 nodedata.

-

"node" 參數

-

node 是使用者右鍵點擊所觸發選單的節點.

- -

例如, 假設你的附加元件看起來像這樣:

-
var script = "self.on('click', function (node, data) {" +
-             "  console.log('clicked: ' + node.nodeName);" +
-             "});";
-
-var cm = require("sdk/context-menu");
-
-cm.Item({
-  label: "body context",
-  context: cm.SelectorContext("body"),
-  contentScript: script
-});
-

這個附加元件建立了一個右鍵選單項目,該項目使用 SelectorContext 來顯示項目,顯示時機為:右鍵選單觸發於 <BODY> 元素的任何後代元素之上時. 點擊時, 項目記錄了 nodeName 屬性(觸發選單的節點名稱)傳給點擊事件處理器.

-

如果你執行這個附加元件,你將看到它總是記錄 "BODY", 即使你點擊的是頁面上的段落元素<P>:

-
info: contextmenu-example: clicked: BODY
-

與上面對比, 底下的附加元件使用了 PageContext:

-
var script = "self.on('click', function (node, data) {" +
-             "  console.log('clicked: ' + node.nodeName);" +
-             "});";
-
-var cm = require("sdk/context-menu");
-
-cm.Item({
-  label: "body context",
-  context: cm.PageContext(),
-  contentScript: script
-});
-

它將記錄實際點擊的節點名稱:

-
info: contextmenu-example: clicked: P
-

"data" 參數

-

data 是使用者所點擊選單項目的 data屬性. 注意: 當你有一個多層的選單(項目)時,點擊事件會被傳給被點擊的項目的所有祖先(項目),所以一定要驗證 data 值傳給你所期待的項目. 你可以使用 "data" 參數來簡化點擊事件處理 by providing just a single click listener on a Menu that reacts to clicks for any child items.:

-
var cm = require("sdk/context-menu");
-cm.Menu({
-  label: "My Menu",
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  console.log("You clicked " + data);' +
-                 '});',
-  items: [
-    cm.Item({ label: "Item 1", data: "item1" }),
-    cm.Item({ label: "Item 2", data: "item2" }),
-    cm.Item({ label: "Item 3", data: "item3" })
-  ]
-});
-
-

和附加元件通訊

-

時常,你需要收集一些訊息,在點擊偵聽函數內和執行一個無關於頁面動作. 為了與關聯於 content script 的選單項目通訊, content script 可以呼叫附屬於全域 self 物件的 postMessage 函數, 傳給它一些 JSON-able 資料. 選單項目的 "message" 事件偵聽函數將被呼叫(前述的 JSON-able 資料作為參數傳入).

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Edit Image",
-  context: cm.SelectorContext("img"),
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  self.postMessage(node.src);' +
-                 '});',
-  onMessage: function (imgSrc) {
-    openImageEditor(imgSrc);
-  }
-});
-

更新選單項目的文字標籤

-

Each menu item must be created with a label, but you can change its label later using a couple of methods.

-

最簡單的方法是設定選單項目的 label 屬性. 下面的例子更新選單項目的文字標籤為它被點擊的次數:

-
var numClicks = 0;
-var myItem = require("sdk/context-menu").Item({
-  label: "Click Me: " + numClicks,
-  contentScript: 'self.on("click", self.postMessage);',
-  onMessage: function () {
-    numClicks++;
-    this.label = "Click Me: " + numClicks;
-    // Setting myItem.label is equivalent.
-  }
-});
-

Sometimes you might want to update the label based on the context. For instance, if your item performs a search with the user's selected text, it would be nice to display the text in the item to provide feedback to the user. 在這些情況下,你可以使用第二種方法 . 回想一下,你的 content scripts 可以偵聽 "context" 事件,如果你的偵聽函數傳回真值, 與 content scripts 關聯的選單項目會顯示在選單中. 除了傳回真值, 你的 "context" 偵聽函數也可以傳回字串. 當 "context" 偵聽函數傳回字串, 字串成為選單項目的新文字標籤.

-

This item implements the aforementioned search example:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Search Google",
-  context: cm.SelectionContext(),
-  contentScript: 'self.on("context", function () {' +
-                 '  var text = window.getSelection().toString();' +
-                 '  if (text.length > 20)' +             // 若太長
-                 '    text = text.substr(0, 20) + "...";' + // 則截短
-                 '  return "Search Google for " + text;' +  // 後綴到固定字串上傳回
-                 '});'
-});
-

"context" 偵聽函數取得使用者所選取的文字, 如果字串太長則截短它, 並後綴到固定字串上傳回. 當選單項目顯示, 它的文字標籤將是 "Search Google for text", 此處的 text 是被截短的 使用者所選取的文字.

-

隱私視窗

-

If your add-on has not opted into private browsing, then any menus or menu items that you add will not appear in context menus belonging to private browser windows.

-

To learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.

-

更多例子

-

For conciseness, these examples create their content scripts as strings and use the contentScript property. In your own add-on, you will probably want to create your content scripts in separate files and pass their URLs using the contentScriptFile property. See Working with Content Scripts for more information.

-
-

Unless your content script is extremely simple and consists only of a static string, don't use contentScript: if you do, you may have problems getting your add-on approved on AMO.

-

Instead, keep the script in a separate file and load it using contentScriptFile. This makes your code easier to maintain, secure, debug and review.

-
-

Show an "Edit Page Source" item when the user right-clicks a non-interactive part of the page:

-
require("sdk/context-menu").Item({
-  label: "Edit Page Source",
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  self.postMessage(document.URL);' +
-                 '});',
-  onMessage: function (pageURL) {
-    editSource(pageURL);
-  }
-});
-

Show an "Edit Image" item when the menu is invoked on an image:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Edit Image",
-  context: cm.SelectorContext("img"),
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  self.postMessage(node.src);' +
-                 '});',
-  onMessage: function (imgSrc) {
-    openImageEditor(imgSrc);
-  }
-});
-

Show an "Edit Mozilla Image" item when the menu is invoked on an image in a mozilla.org or mozilla.com page:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Edit Mozilla Image",
-  context: [
-    cm.URLContext(["*.mozilla.org", "*.mozilla.com"]),
-    cm.SelectorContext("img")
-  ],
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  self.postMessage(node.src);' +
-                 '});',
-  onMessage: function (imgSrc) {
-    openImageEditor(imgSrc);
-  }
-});
-

Show an "Edit Page Images" item when the page contains at least one image:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Edit Page Images",
-  // This ensures the item only appears during the page context.
-  context: cm.PageContext(),
-  contentScript: 'self.on("context", function (node) {' +
-                 '  var pageHasImgs = !!document.querySelector("img");' +
-                 '  return pageHasImgs;' +
-                 '});' +
-                 'self.on("click", function (node, data) {' +
-                 '  var imgs = document.querySelectorAll("img");' +
-                 '  var imgSrcs = [];' +
-                 '  for (var i = 0 ; i < imgs.length; i++)' +
-                 '    imgSrcs.push(imgs[i].src);' +
-                 '  self.postMessage(imgSrcs);' +
-                 '});',
-  onMessage: function (imgSrcs) {
-    openImageEditor(imgSrcs);
-  }
-});
-

Show a "Search With" menu when the user right-clicks an anchor that searches Google or Wikipedia with the text contained in the anchor:

-
var cm = require("sdk/context-menu");
-var googleItem = cm.Item({
-  label: "Google",
-  data: "http://www.google.com/search?q="
-});
-var wikipediaItem = cm.Item({
-  label: "Wikipedia",
-  data: "http://en.wikipedia.org/wiki/Special:Search?search="
-});
-var searchMenu = cm.Menu({
-  label: "Search With",
-  context: cm.SelectorContext("a[href]"),
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  var searchURL = data + node.textContent;' +
-                 '  window.location.href = searchURL;' +
-                 '});',
-  items: [googleItem, wikipediaItem]
-});
-

Globals

-

Constructors

-

Item(options)

-

建立一個有文字標籤的選單項目,當點擊它時,可以執行一些動作.

-
參數
-

options : 物件
- options 物件的必要屬性:

- - - - - - - - - - - - - - - -
名稱型別 
label字串 -

選單項目的文字標籤. It must either be a string or an object that implements toString().

-
-

options 物件的可選屬性:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名稱型別 
image字串 -

選單項目的圖示, a string URL. The URL can be remote, a reference to an image in the add-on's data directory, or a data URI.

-
data字串 -

An optional arbitrary value to associate with the item. It must be either a string or an object that implements toString(). It will be passed to click listeners.

-
accessKey只有單一字元的字串 -
-

New in Firefox 35.

-
-

選單項目的快捷鍵. Pressing this key selects the item when the context menu is open.

-
contextvalue -

If the item is contained in the top-level context menu, this declaratively specifies the context under which the item will appear; see Specifying Contexts above.

-
contentScript字串, 陣列 -

If the item is contained in the top-level context menu, this is the content script or an array of content scripts that the item can use to interact with the page.

-
contentScriptFile字串, 陣列 -

If the item is contained in the top-level context menu, this is the local file URL of the content script or an array of such URLs that the item can use to interact with the page.

-
onMessage函數 -

If the item is contained in the top-level context menu, this function will be called when the content script calls self.postMessage. It will be passed the data that was passed to postMessage.

-
- -

建立一個有文字標籤的選單項目,用以展開子選單.

-
參數
-

options : 物件
- options 物件的必要屬性:

- - - - - - - - - - - - - - - - - - - - -
名稱型別 
label字串 -

選單項目的文字標籤. It must either be a string or an object that implements toString().

-
items陣列 -

選單項目構成的陣列,這些選單項目會被子選單所包含. 陣列中的元素須為 Item, Menu, 或 Separator.

-
-

options 物件的可選屬性:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名稱型別 
image字串 -

The menu's icon, a string URL. The URL can be remote, a reference to an image in the add-on's data directory, or a data URI.

-
contextvalue -

If the menu is contained in the top-level context menu, this declaratively specifies the context under which the menu will appear; see Specifying Contexts above.

-
contentScript字串, 陣列 -

If the menu is contained in the top-level context menu, this is the content script or an array of content scripts that the menu can use to interact with the page.

-
contentScriptFile字串, 陣列 -

If the menu is contained in the top-level context menu, this is the local file URL of the content script or an array of such URLs that the menu can use to interact with the page.

-
onMessage函數 -

If the menu is contained in the top-level context menu, this function will be called when the content script calls self.postMessage. It will be passed the data that was passed to postMessage.

-
-

Separator()

-

Creates a menu separator.

-

PageContext()

-

Creates a page context. See Specifying Contexts above.

-

SelectionContext()

-

Creates a context that occurs when a page contains a selection. See Specifying Contexts above.

-

SelectorContext(selector)

-

Creates a context that matches a given CSS selector. See Specifying Contexts above.

-
Parameters
-

selector : string
- A CSS selector.

-

URLContext(matchPattern)

-

Creates a context that matches pages with particular URLs. See Specifying Contexts above.

-
Parameters
-

matchPattern : string,array
- A match pattern string, regexp or an array of match pattern strings or regexps.

-

PredicateContext(predicateFunction)

-
-

New in Firefox 29

-
-

Creates a context that occurs when predicateFunction returns a true value. See Specifying Contexts above.

-
Parameters
-

predicateFunction : function(context)
- A function which will be called with an object argument that provide information about the invocation context. context object properties:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyDescription
documentTypeThe MIME type of the document the menu was invoked in. E.g. text/html for HTML pages, application/xhtml+xml for XHTML, or image/jpeg if viewing an image directly.
documentURLThe URL of the document the menu was invoked in.
targetNameThe name of the DOM element that the menu was invoked on, in lower-case.
targetIDThe id attribute of the element that the menu was invoked on, or null if not set.
isEditabletrue if the menu was invoked in an editable element, and that element isn't disabled or read-only.  This includes non-input elements with the contenteditable attribute set to true.
selectionTextThe current selection as a text string, or null. If the menu was invoked in an input text box or area, this is the selection of that element, otherwise the selection in the contents of the window.
srcURLThe src URL of the element that the menu was invoked on, or null if it doesn't have one.
linkURLThe href URL of the element that the menu was invoked on, or null if it doesn't have one.
valueThe current contents of a input text box or area if the menu was invoked in one, null otherwise.
-

Item

-

A labeled menu item that can perform an action when clicked.

-

Methods

-

destroy()

-

Permanently removes the item from its parent menu and frees its resources. The item must not be used afterward. If you need to remove the item from its parent menu but use it afterward, call removeItem() on the parent menu instead.

-

Properties

-

label

-

The menu item's label. You can set this after creating the item to update its label later.

-

image

-

The item's icon, a string URL. The URL can be remote, a reference to an image in the add-on's data directory, or a data URI. You can set this after creating the item to update its image later. To remove the item's image, set it to null.

-

data

-

An optional arbitrary value to associate with the item. It must be either a string or an object that implements toString(). It will be passed to click listeners. You can set this after creating the item to update its data later.

-

context

-

A list of declarative contexts for which the menu item will appear in the context menu. Contexts can be added by calling context.add() and removed by called context.remove().

-

parentMenu

-

The item's parent Menu, or null if the item is contained in the top-level context menu. This property is read-only. To add the item to a new menu, call that menu's addItem() method.

-

contentScript

-

The content script or the array of content scripts associated with the menu item during creation.

-

contentScriptFile

-

The URL of a content script or the array of such URLs associated with the menu item during creation.

-

Events

-

message

-

If you listen to this event you can receive message events from content scripts associated with this menu item. When a content script posts a message using self.postMessage(), the message is delivered to the add-on code in the menu item's message event.

-
Arguments
-

value : Listeners are passed a single argument which is the message posted from the content script. The message can be any JSON-serializable value.

- -

A labeled menu item that expands into a submenu.

-

Methods

-

addItem(item)

-

Appends a menu item to the end of the menu. If the item is already contained in another menu or in the top-level context menu, it's automatically removed first. If the item is already contained in this menu it will just be moved to the end of the menu.

-
Parameters
-

item : Item,Menu,Separator
- The Item, Menu, or Separator to add to the menu.

-

removeItem(item)

-

Removes the given menu item from the menu. If the menu does not contain the item, this method does nothing.

-
Parameters
-

item : Item,Menu,Separator
- The menu item to remove from the menu.

-

destroy()

-

Permanently removes the menu from its parent menu and frees its resources. The menu must not be used afterward. If you need to remove the menu from its parent menu but use it afterward, call removeItem() on the parent menu instead.

-

Properties

-

label

-

The menu's label. You can set this after creating the menu to update its label later.

-

items

-

An array containing the items in the menu. The array is read-only, meaning that modifications to it will not affect the menu. However, setting this property to a new array will replace all the items currently in the menu with the items in the new array.

-

image

-

The menu's icon, a string URL. The URL can be remote, a reference to an image in the add-on's data directory, or a data URI. You can set this after creating the menu to update its image later. To remove the menu's image, set it to null.

-

context

-

A list of declarative contexts for which the menu will appear in the context menu. Contexts can be added by calling context.add() and removed by called context.remove().

-

parentMenu

-

The menu's parent Menu, or null if the menu is contained in the top-level context menu. This property is read-only. To add the menu to a new menu, call that menu's addItem() method.

-

contentScript

-

The content script or the array of content scripts associated with the menu during creation.

-

contentScriptFile

-

The URL of a content script or the array of such URLs associated with the menu during creation.

-

Events

-

message

-

If you listen to this event you can receive message events from content scripts associated with this menu item. When a content script posts a message using self.postMessage(), the message is delivered to the add-on code in the menu item's message event.

-
Arguments
-

value : Listeners are passed a single argument which is the message posted from the content script. The message can be any JSON-serializable value.

-

Separator

-

A menu separator. Separators can be contained only in Menus, not in the top-level context menu.

-

Methods

-

destroy()

-

Permanently removes the separator from its parent menu and frees its resources. The separator must not be used afterward. If you need to remove the separator from its parent menu but use it afterward, call removeItem() on the parent menu instead.

-

Properties

-

parentMenu

-

The separator's parent Menu. This property is read-only. To add the separator to a new menu, call that menu's addItem() method.

diff --git a/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/index.html b/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/index.html deleted file mode 100644 index 32b39d045b..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: High-Level APIs -slug: Mozilla/Add-ons/SDK/High-Level_APIs -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Add-ons/Add-on_SDK/High-Level_APIs ---- -

Modules listed on this page implement high-level APIs for building add-ons: creating user interfaces, interacting with the web, and interacting with the browser.

-

Unless the documentation explicitly says otherwise, all these modules are "Stable": we'll avoid making incompatible changes to them. {{ LandingPageListSubpages ("/en-US/Add-ons/SDK/High-Level_APIs", 5) }}

diff --git a/files/zh-tw/mozilla/add-ons/sdk/index.html b/files/zh-tw/mozilla/add-ons/sdk/index.html deleted file mode 100644 index 2937b883d7..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/index.html +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: Add-on SDK -slug: Mozilla/Add-ons/SDK -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Add-ons/Add-on_SDK ---- -

有了附加元件開發套件(Add-on SDK),您可以使用標準的JavaScript、HTML、CSS等語法來建立Firefox的附加元件。SDK包含用來製作附加元件的JavaScript API,及建立、測試、運行或包裝附加元件的相關工具。

- -
-

入門

- -
-
-
-
從此開始
-
如何安裝 SDK 使用 cfx tool 來建立、測試或包裝附加元件。
-
和瀏覽器互動
-
開啟網頁監測頁面載入以及列出已開啟頁面
-
開發技巧
-
學習常用開發技術,如單元測試紀錄建立可重用模組在地化流動裝置
-
-
- -
-
-
建立使用者介面的元件
-
工具列按鈕內文選單選單項目對話框等等。
-
修改網頁
-
修改符合網址模式的頁面或動態修改特定分頁
-
整合各項
-
以 Annotator(一個顯示註解的附加元件)為例顯示製作流程。
-
-
-
- -
-

指引

- -
- - - -
- -
-

參考資料

- -
-
-
-
高階 API
-
高階 SDK API 的參考文件。
-
工具參考
-
Reference documentation for the cfx tool used to develop, test, and package add-ons, the console global used for logging, and the package.json file.
-
-
- -
-
-
低階 API
-
低階 SDK API 的參考文件。
-
-
-
diff --git a/files/zh-tw/mozilla/add-ons/sdk/low-level_apis/index.html b/files/zh-tw/mozilla/add-ons/sdk/low-level_apis/index.html deleted file mode 100644 index 2108d30783..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/low-level_apis/index.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Low-Level APIs -slug: Mozilla/Add-ons/SDK/Low-Level_APIs -translation_of: Archive/Add-ons/Add-on_SDK/Low-Level_APIs ---- -

Modules in this section implement low-level APIs. These modules fall roughly into three categories:

- -

These modules are still in active development, and we expect to make incompatible changes to them in future releases.

-

{{ LandingPageListSubpages ("/en-US/Add-ons/SDK/Low-Level_APIs", 5) }}

-

 

diff --git a/files/zh-tw/mozilla/add-ons/themes/obsolete/index.html b/files/zh-tw/mozilla/add-ons/themes/obsolete/index.html deleted file mode 100644 index d420b6ebf0..0000000000 --- a/files/zh-tw/mozilla/add-ons/themes/obsolete/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Obsolete -slug: Mozilla/Add-ons/Themes/Obsolete -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/Themes/Obsolete ---- -

This page collects theme docs that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs.

-

{{ ListSubPages ("/en-US/Add-ons/Themes/Obsolete", 5) }}

diff --git a/files/zh-tw/mozilla/adding_phishing_protection_data_providers/index.html b/files/zh-tw/mozilla/adding_phishing_protection_data_providers/index.html deleted file mode 100644 index 14b56484b5..0000000000 --- a/files/zh-tw/mozilla/adding_phishing_protection_data_providers/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: 新增偽造網站清單來源 -slug: Mozilla/Adding_phishing_protection_data_providers -tags: - - 待翻譯 -translation_of: Mozilla/Adding_phishing_protection_data_providers ---- -

詐騙網站偵測技術讓 Firefox 能將當前網頁與黑名單兩相比對,藉此得知此網站是否為詐騙網站,並於確認後提醒使用者。

- -

安裝新資料來源

- -

要安裝詐騙網站清單的資料來源,必須調整一些相關設定,以便提供資料來源的細節。

- -

每個資料來源都有其獨一無二的 ID 號碼,而 ID 號碼為 0 者即是 Firefox 出廠時的預設資料來源。當安裝新的資料來源時,你應該指定另一個未使用的號碼。

- -

要知道哪些號碼能用,必須以迴圈循序取出設定值,例如先是 browser.safebrowsing.provider.0.name、而後為browser.safebrowsing.provider.1.name,以此類推。當取值時無傳回內容,代表這個數字可以用。

- -

你可以從為擴充套件新增偏好設定文章中找到讀寫設定值的相關範例。

- -

必備設定

- -
-
browser.safebrowsing.provider.idnum.name
-
資料來源的名稱,讓使用者方便識別。
-
- -
-
browser.safebrowsing.provider.idnum.keyURL
-
用來為其他要求編碼的私鑰 URL。
-
- -
-
browser.safebrowsing.provider.idnum.lookupURL
-
The URL to use to look up URLs to see if they're blacklisted. This request must be encrypted using the private key returned by the keyURL request.
-
- -

選用設定

- -
-
browser.safebrowsing.provider.idnum.reportURL
-
An URL used for reporting when users visit phishing pages and whether or not they decided to heed the warning or to ignore it.
-
- -
-
browser.safebrowsing.provider.idnum.updateURL
-
An URL used to request an updated list of phishing sites. The server either provides a full list or incremental updates in order to bring the client's tables up to date.
-
- -
-
browser.safebrowsing.provider.idnum.reportGenericURL
-
Not currently used; intended for use in reporting other issues with the phishing protection service.
-
- -
-
browser.safebrowsing.provider.idnum.reportErrorURL
-
An URL to which the user is directed in order to report a safe page that is incorrectly being reported as a phishing site.
-
- -
-
browser.safebrowsing.provider.idnum.reportPhishURL
-
An URL to which the user is directed in order to report a phishing site that isn't detected by the phishing protection system.
-
- -

Determining the currently-selected data provider

- -

If you need to determine the ID number of the currently selected anti-phishing data provider, you can look at the current value of the preference browser.safebrowsing.dataProvider.

diff --git a/files/zh-tw/mozilla/chrome_registration/index.html b/files/zh-tw/mozilla/chrome_registration/index.html deleted file mode 100644 index f2cde3f964..0000000000 --- a/files/zh-tw/mozilla/chrome_registration/index.html +++ /dev/null @@ -1,348 +0,0 @@ ---- -title: Chrome registration -slug: Mozilla/Chrome_Registration -translation_of: Mozilla/Chrome_Registration ---- -

馬桶裡有個 chrome?

- -

Chrome 是一拖拉庫在文件 window 範圍之外 AP 視窗的 UI 元件。 管它 Toolbars 、 menu bars、progress bars 還是 window title bars 基本上都是 chrome 的一部份。

- -
-

Mozilla 會尋找並讀取主題佈景和附加元件根目錄的 chrome.manifest 檔。

-
- -
-

古早的 Gecko 1.9.2 (及更古早版本),Mozilla 是從 AP 讀取chrome/*.manifest 檔。 從 Gecko 2.0 {{ geckoRelease("2.0") }} 開始,就只剩根目錄的 chrome.manifest 還有再用;若要增加更多的內容,就在其中利用 manifest 指令來擴充。

-
- -

Chrome providers

- -

基於某種 window type (例如針對 browser window) 提供 chrome 者稱為 chrome provider。所有的 provider 同心協力針對特定的 window 提供整套的 chrome,從工具列上的圖案到文字或內容描述檔,以及 window 本身的外觀。

- -

以下是三種基本的 chrome provider :

- -
-
Content
-
視窗描述主要是來自於 content provider,格式可以是任何一種 Mozilla 看得懂的類型。通常會是個  XUL file,因為它本來就是專門設計來描述 window 和 dialog 的。用來定義 UI 的 JavaScript 檔也會跟在這包,多數的 XBL binding files 也是。
-
Locale
-
多語系的應用程式會將語系資訊交給 locale providers。醬子譯者就可以翻譯並插進一個另外的 chrome package 而不去更動其它的程式。Java-style properties 檔和 DTD 檔是兩種主要的多語系檔案類型。
-
Skin
-
Skin provider 就負責 chrome 整套外觀的描述檔,通常是 CSS 和圖形。
-
- -
-

註: 從 skin packages 載入的 scripts (包括 XBL 裡的) 並不會執行喔。

-
- -

Chrome 登錄 (chrome registry)

- -

Gecko runtime 會保持一份稱為 chrome registry 的記錄,用來對登錄 chrome package 名稱和實際檔案路徑。

- -

Chrome registry 可以設定並且會保存;且有賴於 xpinstall 和 extension manager,這樣 user 就可以很多套 chrome provider 然後選擇喜歡的語系和外觀。

- -

XULRunner application、主題布景或附加元件要讓 chrome registry 知道有這麼一個 chrome,那就要在自己的根目錄下放一個 純文字格式的 manifest,也就是 `chrome.manifest`。

- -

這個純文字的 manifests 是簡單的逐行格式,會被一行一行地解析。 chrome registry 看懂一行就處理一行,看不懂就跳過;當然,有問題的會 log 在 console 中。

- -
locale packagename localename path/to/files
-skin packagename skinname path/to/files
-
- -

Firefox 2 、 Thunderbird 2 和 SeaMonkey 1.1 無法辨識大小寫夾雜的 packagename 。 要是把範例中的 packagename 改成 CamelCasePackage 就會跑出類似 "No chrome registered for chrome://camelcasepackage/path/to/files" 的訊息。 Firefox 3 、 Thunderbird 3 還有 SeaMonkey 2 已經支援這個功能。Bug resolved 於 Mozilla 1.9; see {{bug(132183)}}.

- -

Manifest 指令

- -

comments

- -

如果一行的開頭是 '#' 那這整行就變成註解。

- -
# this line is a comment - you can put whatever you want here
-
- -

manifest

- -

{{ gecko_minversion_inline("2.0b4") }}

- -
manifest subdirectory/foo.manifest [flags]
-
- -

這行會載入另一份 manifest 檔。這在拆分元件、chrome 登錄項或是各平台相依登錄資料時尤其有用。

- -

binary-component

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
binary-component components/mycomponent.dll [flags]
-
- -

叫 Mozilla 登錄並應用 binary component,由於 binary components 為 ABI-specific,應與 abi flag 並用。 在 Firefox 4 之前 ,components 資料夾裡的檔案會自動被登錄。

- -

interfaces

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
interfaces component/mycomponent.xpt [flags]
-
- -

叫 Mozilla 從經由 XPIDL 產生的 typelib 檔載入 interface 資訊。在 Firefox 4 之前,components 資料夾裡的檔案會自動被登錄。

- -

component

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
component {00000000-0000-0000-0000-000000000000} components/mycomponent.js [flags]
-
- -

告訴 Mozilla 一個由 XPCOM 元件以 JavaScript (或是其它可接受的 scripting language) 實作之元件的 CID。ClassID {0000 ...} 一定要和該元件所實現的 ClassID 相同。可利用程式或線上 UUID 產生器產生唯一的 ClassID。

- -

contract

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
contract @foobar/mycontract;1 {00000000-0000-0000-0000-000000000000} [flags]
-
- -

將特定實作的 contract ID (一個語意化字串) 對應到 ClassID。通常 contract ID 就和它頂頭所列的 component entry 一組。
-  

- -

category

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
category category entry-name value [flags]
-
- -

登錄在 category manager ,至於項目的格式和用意就要看它是哪個 category 了。

- -

content

- -

下面這行登錄一個 content package :

- -
content packagename uri/to/files/ [flags]
-
- -

這會將 package 登錄在一個像 `chrome://packagename/content/..` 的位置,也就是之後它被存取的位置。這個 URI 可以是絕對位置或是相對於 manifest file 的位置,但要注意結尾的 '/' 不可省略。

- -

locale

- -

下面這行登錄一個 locale package :

- -
locale packagename localename uri/to/files/ [flags]
-
- -

這會將 locale package 登錄在解析 `chrome://packagename/locale/..` 所用的位置。 localename 通常直接用語系名稱像是 "zh" 或有時候用 語系-地區 像 "zh-TW"。如果同一 package 有多個語系 chrome registry 會根據使用者偏好中的設定值選擇最接近的語系。

- -

skin

- -

下面這行登錄一個 skin package :

- -
skin packagename skinname uri/to/files/ [flags]
-
- -

這會將 skin package 登錄在 chrome://packagename/skin/.. , skinname is 是用來識別所安裝 skin 的一個非透明化字串。同樣地,若同一 package 登記了多個 skin , chrome registry 會根據使用者偏好中的設定值選擇最合適的。

- -

style

- -

Style overlay (套用在chrome page上的自訂 CSS) 以下列語法登錄:

- -
style chrome://URI-to-style chrome://stylesheet-URI [flags]
-
- -
注意: 只有位於 chrome URI 的 stylesheet 可以這樣用。
- -

override

- -

chrome 登錄 manifest 允許 override 指令以便讓某些 extension 或其它嵌入物件可以改寫 XULRunner 或 AP 預設的 chrome file 設定。

- -
override chrome://package/type/original-uri.whatever new-resolved-URI [flags]
-
- -

注意:override 路徑不會遞迴 (所以將 chrome://foo/content/bar/ override 為 file:///home/john/blah/ 之後,其行為通常不會是預期的那樣)。而且 override 之後路徑是相對於被重寫掉的路徑而不是用來重寫的路徑 (從 CSS 的角度來說,這搞不好是個偏門也搞不好使人抓狂) 。

- -
-

在 Gecko 1.8.1.5 (Firefox 2.0.0.5) 和較早的版本中有個 new-resolved-URI 參數 只能用絕對路徑而不能用相對路徑的 bug。詳見: {{ Bug(323455) }}.

-
- -

resource

- -

{{ Fx_minversion_inline("3") }}

- -

在 extension 和 AP 中使用 Components.utils.import 來載入 JavaScript code modules 時,建立 resource protocol 別名 (aliases) 有時是必須的。請使用 resource 指令來建立別名:

- -
resource aliasname uri/to/files/ [flags]
-
- -

這會將目的路徑對映到 resource://<aliasname>/.. 。

- -
-

沒有安全性限制防止網頁內容 include 以 resource: 開頭的 URI,故請留意此處所開啟的能見度

-
- -

Manifest 旗號

- -

Manifest 指令行允許多個以空白分隔的旗號附加於行尾。這些旗號將會設定 package 中 chrome 的特殊屬性,或限制這些指令行本身於什麼條件下作用。

- -

application

- -

Extension 可以安裝於多個應用程式,而有些 chrome registration 可能只需作用於特定的應用程式。以下旗號

- -
application=app-ID
-
- -

代表這個指令只應在 extension 安裝於符合 app-ID 的應用程式時作用。同一行可以指定多個應用程式,此時只要其中一項符合即會作用。

- -

以下示範如何為多個應用程是分別指定 overlay :

- -
overlay chrome://browser/content/browser.xul chrome://myaddon/content/ffOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myaddon/content/tbOverlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}
-overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://myaddon/content/sbOverlay.xul application=songbird@songbirdnest.com
-
- -

appversion

- -

Extension 可以安裝於同一應用程式的多個不同版本,而有些 chrome registration 可能只需作用於特定的版本。以下旗號

- -
appversion=version
-appversion<version
-appversion<=version
-appversion>version
-appversion>=version
-
- -

代表這個指令只應在 extension 安裝於符合特定版本的應用程式時作用。同一行可以指定多個 appversion ,此時只要其中一項符合即會作用。版本字串應遵循 Toolkit version format

- -
-

Gecko 在 1.8.0.13 之前以及版本 1.8.1.5 有一個 bug , 就是本字串必須超過一個字元(也就是最少兩個) 才能使用 < 、 > 及 =,否則會在 console 中收到 appversion flag was not recognized 的錯誤訊息。參見: {{ Bug(380398) }} 。

-
- -

platformversion

- -

{{ gecko_minversion_inline("8.0") }} 當附加元件尤其是 binary components支援一種以上的應用程式時,若能指定所相容的 Gecko 版本將為其帶來更多的方便性。若某些 chrome registration 只作用於定特定 Gecko 版本,以下旗號

- -
platformversion=version
-platformversion<version
-platformversion<=version
-platformversion>version
-platformversion>=version
-
- -

代表這個指令只應在 extension 安裝於符合特定 Gecko 版本的應用程式時作用。同一行可以指定多個 platformversion,此時只要其中一項符合即會作用。

- -

contentaccessible

- -

{{ Fx_minversion_inline("3") }} Chrome resources 已不能被非信任來源內容中的 <img>、<script> 及其他包含或添加的 elements 所參照。 這個限制不僅適用於非信任來源中所定義的 elements , 同時也適用於受信任的附加元件中所定義的 elements。若參照需要明確地被允許,請將 contentaccessible 旗號設定為 yes 來達到如舊版 Firefox 中的行為。 See {{ bug("4369")}}

- -

contentaccessible 只能用於 content package ,言下之意,它不會被 locale 或 skin registration 所識別。好在於 content package 所對應到的 locale 和 skin packages 對 content 而言是可見的。

- -

注意:由於舊版的 Firefox 根本看不懂 contentaccessible flag , 若要讓附加元件同時支援 Firefox 3 及古董版的話就得來個倒退嚕,您倒是看看:

- -
content packagename chrome/path/
-content packagename chrome/path/ contentaccessible=yes
-
- -

os

- -

{{ Fx_minversion_inline("3") }} Extensions (or themes) may offer different features depending on the operating system on which Firefox is running. The value is compared to the value of OS_TARGET for the platform.

- -
os=WINNT
-os=Darwin
-
- -

See OS_TARGET for a more complete list of os names. The os name is case insensitive.

- -

osversion

- -

{{ Fx_minversion_inline("3") }} An extension or theme may need to operate differently depending on which version of an operating system is running. For example, a theme may wish to adopt a different look on Mac OS X 10.5 than 10.4:

- -
osversion>=10.5
-
- -

abi

- -

{{ Fx_minversion_inline("4") }} If a component is only compatible with a particular ABI, it can specify which ABI/OS by using this directive. The value is taken from the nsIXULRuntime OS and XPCOMABI values (concatenated with an underscore). For example:

- -
binary-component component/myLib.dll abi=WINNT_x86-MSVC
-binary-component component/myLib.so abi=Linux_x86-gcc3 
-
- -

See XPCOM ABI for more details.

- -

platform (Platform-specific packages)

- -

Some packages are marked with a special flag indicating that they are platform specific. Some parts of content, skin, and locales may be different based on the platform being run. These packages contain three different sets of files, for Windows and OS/2, Macintosh, and Unix-like platforms. For example, the order of the "OK" and "Cancel" buttons in a dialog is different, as well as the names of some items.

- -

The "platform" modifier is only parsed for content registration; it is not recognized for locale or skin registration. However, it applies to content, locale, and skin parts of the package, when specified.

- -

To indicate that a package is platform-specific, add the "platform" modifier to the "content" line after the path, for example:

- -
content global-platform jar:toolkit.jar!/toolkit/content/global-platform/ platform
-
- -

Once that is specified in your manifest you then ensure that under the directory global-platform are subdirectories win (Windows/OS2), mac (OS9/OSX), or unix (Everything Else). Anything residing outside of these subdirectories will be ignored.

- -

xpcnativewrappers

- -

Chrome packages can decide whether to use the XPCNativeWrapper security mechanism to automatically protect their code against malicious content that they might access. See Safely accessing content DOM from chrome for details.

- -

This flag is enabled by default since Firefox 1.5. Disabling it manually was possible by specifying xpcnativewrappers=no until Firefox 4.

- -
-

{{ gecko_callout_heading("2.0") }}

- -

Support for this flag has been removed in Gecko 2.0 {{ geckoRelease("2.0") }}. You can no longer disable XPCNativeWrappers. To update your add-on to work without this flag:

- - -
- -

The xpcnativewrappers flag applies only to content packages; it is not recognized for locale or skin registration.

- -

Example chrome manifest

- -
content       necko                   jar:comm.jar!/content/necko/
-locale        necko       en-US       jar:en-US.jar!/locale/en-US/necko/
-content       xbl-marquee             jar:comm.jar!/content/xbl-marquee/
-content       pipnss                  jar:pipnss.jar!/content/pipnss/
-locale        pipnss      en-US       jar:en-US.jar!/locale/en-US/pipnss/
-# Firefox-only
-overlay chrome://browser/content/pageInfo.xul           chrome://pippki/content/PageInfoOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-# SeaMonkey-only
-overlay chrome://navigator/content/pageInfo.xul         chrome://pippki/content/PageInfoOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-overlay chrome://communicator/content/pref/preftree.xul chrome://pippki/content/PrefOverlay.xul
-content       pippki                  jar:pippki.jar!/content/pippki/
-locale        pippki      en-US       jar:en-US.jar!/locale/en-US/pippki/
-content       global-platform         jar:toolkit.jar!/content/global-platform/ platform
-skin          global      classic/1.0 jar:classic.jar!/skin/classic/global/
-override chrome://global/content/netError.xhtml jar:embedder.jar!/global/content/netError.xhtml
-content       inspector               jar:inspector.jar!/content/inspector/
-
- -

Instructions supported in bootstrapped add-ons

- -

The following instructions are supported in Bootstrapped extensions:

- - - -

Debugging a chrome manifest file

- -

The Chrome List extension (for Firefox 3.6 and older) shows all registered chrome. This is very helpful when trying to write a chrome.manifest file as you can inspect where the files are being mapped from (jar files, local directory, etc.)

- -

Old-style contents.rdf manifests

- -

Before the plaintext manifests were introduced (which happened in Firefox 1.5, Toolkit 1.8), RDF manifests named "contents.rdf" were used to register chrome. This format is deprecated; however, SeaMonkey versions before version 2 do not support the plaintext manifest format yet, so contents.rdf manifests are required for extensions that wish to maintain backwards compatibility with Firefox 1.0 or the suite.

- -

{{ gecko_minversion_note("1.9.2", "The contents.rdf manifest format is no longer supported at all starting with Gecko 1.9.2; add-ons already installed using this format will continue to work but can no longer be installed. Be sure to remove your add-on and reinstall it to ensure that it installs correctly after updating it to use a plaintext manifest.") }}

- -

Official references for Toolkit API

- -

{{ page("en-US/docs/Toolkit_API/Official_References") }}

- -

{{ languages( { "fr": "fr/Enregistrement_chrome", "ja": "ja/Chrome_Registration", "pl": "pl/Rejestracja_Chrome" ,"zh-cn":"zh-cn/Chrome_Registration"} ) }}

diff --git a/files/zh-tw/mozilla/connect/index.html b/files/zh-tw/mozilla/connect/index.html deleted file mode 100644 index 2e7b782447..0000000000 --- a/files/zh-tw/mozilla/connect/index.html +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: Connect with Mozilla -slug: Mozilla/Connect -tags: - - 繁體中文TW -translation_of: Mozilla/Connect ---- -
-

Enable, inspire and collaborate to make the Web the primary platform used to create experiences across all connected devices.

-
- -
-
-
- -
- -
- -
- -
- -
-
- -
-

與 Mozilla 連結

- -

Developers are creating the future by building services and apps for people all over the world. The goal of Mozilla Developer Relations is to help developers to use open and standardized web technologies to succeed in achieving their goals. In addition to the documentation here on MDN, we offer help and other resources towards this goal, through various channels. We invite you to connect, learn, and share your own knowledge.

- -

We are offering help through Q&A on Stack Overflow, to solve specific technical issues and challenges you might have. We also have a newsletter keeping you informed on the latest happenings in the web scene around web apps and more. Subscribe to the Apps & Hacks newsletter.

- -

If you share Mozilla's mission and principles, and want to help spread them to more developers, check out the ways you can get involved with technical evangelism, and join our evangelism discussion group.

- -

We have a lot of plans and ideas for iteratively expanding our Developer Relations offerings, and we want you involved as we do so! So, follow the tags on Stack Overflow, subscribe to the Hacks blog, subscribe to the newsletter, and sign up for an account!

- -

加入 Mozilla

- -

If you want to go beyond connecting with Mozilla, you can join Mozilla and help realize Mozilla's mission of building a better Internet. As a developer, you have skills to contribute in many areas, as well as the opportunity to enhance your skills. Mozilla is an open source project, so we "default to open." You can "view source" and contribute to our software development projects, like the Firefox browser for desktop and Android, Firefox OS, and Mozilla's own websites. You can become part of an international community and get recognition for your efforts. Here are some of the advantages of contributing to the Mozilla project.

- -

學習新東西的機會

- -
-

In writing code for an open source project, you may face problems you have not encountered before, which present learning opportunities for you. You can try out new tools and techniques in an open source project. For example, if you've never done any unit testing, and cannot get permission from your boss to do so in your regular job, writing some code for an open source project would be an excellent place to try it out. Contributing to open source gives you the opportunity to collaborate with and get to know many people around the world who have similar interests. Moreover, an open source organization like Mozilla has many contributors who can help you in solving problems you encounter. If you're just getting started contributing, you can look for "mentored" bugs, where an experienced contributor has offered to help a newcomer fix them.

- -

我可以從貢獻中得到什麼?

- -

Exploring many things and getting recognition in the community -- these are the intangible benefits of contributing to Mozilla. While we can't guarantee specific tangible benefits, many valued contributors receive free Mozilla gear and invitations to Mozilla-related events, and are first in line to be considered for internships. Moreover, your experience in contributing to an open source project might help you find a job. More and more employers of developers are looking at open source contributions. They like to see that you're blogging and contributing to mailing lists, and they really like to see you listed as a committer on an open source project. It can also help with the work experience section of your resume.

- -

我可以如何貢獻 Mozilla?

- -

There are many project area for which you can contribute to Mozilla. You can find a current, complete list on the main Mozilla Get Involved page. Some areas that may interest you as a developer include:

- - -
-
- -
-
-

Stack Overflow 上的問與答 查看所有 Q&A…

- -

We have Q&A to discuss challenges and issues when developing, in particular for Firefox OS and the Open Web on mobile. It's available on Stack Overflow under the easy URL http://stackoverflow.com/r/mozilla.

- -
Stack form
- -

最新 Q&A 主題

-
- -
 
-
- -

Developers at a Firefox OS workshop in Madrid.

- -
-
-

Mozilla 在哪裡? 在活動頁面上查看訪客與詳細說明…

- -

Here is a listing of events where Mozilla representatives will be speaking. Make sure to talk to them!

-
- - -
-
diff --git a/files/zh-tw/mozilla/creating_mozsearch_plugins/index.html b/files/zh-tw/mozilla/creating_mozsearch_plugins/index.html deleted file mode 100644 index d41978c6ee..0000000000 --- a/files/zh-tw/mozilla/creating_mozsearch_plugins/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: 製作 MozSearch 搜尋模組 -slug: Mozilla/Creating_MozSearch_plugins -tags: - - 搜尋模組 -translation_of: Mozilla/Creating_MozSearch_plugins ---- -

Firefox 2 使用簡化的 OpenSearch 格式儲存搜尋模組,而 MozSearch 搜尋模組則是描述搜尋引擎、URL 及相關參數的 XML 檔。 -

-
警告:MozSearch 並非標準格式,也只應於 Mozilla 專案內部使用。除非要包裝在 Firefox 擴充套件中或直接與 Firefox 安裝檔一起發佈,否則不該使用這種格式。要製作能由網頁安裝的搜尋模組,請參考製作 OpenSearch 搜尋模組
-

搜尋模組檔

-

MozSearch 格式檔與 OpenSearch 格式很像,只是根元素及 XML 名稱空間不同。 -

-

範例:Yahoo! 搜尋

-

下列 XML 是內建於英文版 Firefox 2 的 Yahoo! 搜尋模組: -

-
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
-<ShortName>Yahoo</ShortName>
-<Description>Yahoo Search</Description>
-<InputEncoding>UTF-8</InputEncoding>
-<Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAJECAP8AAAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIplI+py+0NogQuyBDEnEd2kHkfFWUamEzmpZSfmaIHPHrRguUm/fT+UwAAOw==</Image>
-<Url type="application/x-suggestions+json" method="GET"
-     template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchTerms}" />
-<Url type="text/html" method="GET" template="http://search.yahoo.com/search">
-  <Param name="p" value="{searchTerms}"/>
-  <Param name="ei" value="UTF-8"/>
-
-  <MozParam name="fr" condition="pref" pref="yahoo-fr" />
-</Url>
-<SearchForm>http://search.yahoo.com/</SearchForm>
-</SearchPlugin>
-
-

假設使用者選擇 Yahoo! 搜尋模組,然後在搜尋欄內輸入「mozilla」後按下 Enter 鍵。接著 Firefox 會依據上面的搜尋模組敘述前往這個搜尋 URL: -

-
http://search.yahoo.com/search?p=mozilla&ei=UTF-8&fr=moz2
-
-

若使用者只單純按下搜尋欄的放大鏡圖示,或者在搜尋欄隱藏時點選「工具>網路搜尋」,則瀏覽器會前往 <SearchForm> 指定的 <tt>http://search.yahoo.com/</tt>。 -

-

範例:搜尋 MDC

-

此搜尋模組能協助你輕鬆搜尋 Mozilla 開發者中心英文版的文件: -

-
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
-<ShortName>MDC</ShortName>
-<Description>Mozilla Developer Center search</Description>
-<InputEncoding>UTF-8</InputEncoding>
-<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz%2F%2Fz8DJQAggJiQOe%2Ffv2fv7Oz8rays%2FN%2BVkfG%2FiYnJfyD%2F1%2BrVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw%2F8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi%2FG%2BQKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo%2BMXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia%2BCuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq%2FvLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg%2FkdypqCg4H8lUIACnQ%2FSOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD%2BaDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg%3D%3D</Image>
-<Url type="text/html" method="GET" template="http://developer.mozilla.org/en/docs/Special:Search?search={searchTerms}"/>
-<SearchForm>http://developer.mozilla.org/en/docs/Special:Search</SearchForm>
-</SearchPlugin>
-
-

這個範例中單純將參數加到 URL 中,而不是使用 <Param> 指定參數。這也是使用 GET 時的建議做法,而 <Param> 應於以 POST 方式傳送表單時才使用。 -

-

延伸閱讀

- -{{ languages( { "ca": "ca/Creaci\u00f3_de_connectors_MozSearch", "en": "en/Creating_MozSearch_plugins", "es": "es/Creaci\u00f3n_de_plugins_MozSearch", "fr": "fr/Cr\u00e9ation_de_plugins_MozSearch", "ja": "ja/Creating_MozSearch_plugins", "it": "it/Creare_Plugin_MozSearch", "pl": "pl/Tworzenie_wtyczek_MozSearch" } ) }} diff --git a/files/zh-tw/mozilla/firefox/developer_edition/index.html b/files/zh-tw/mozilla/firefox/developer_edition/index.html deleted file mode 100644 index d912a36470..0000000000 --- a/files/zh-tw/mozilla/firefox/developer_edition/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Firefox 開發者版本 -slug: Mozilla/Firefox/Developer_Edition -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Firefox/Developer_Edition ---- -
{{FirefoxSidebar}}

一個專為 Web 開發者量身定做的 Firefox 版本。

- -

下載 Firefox 開發者版本

- -
-
-
-

最新的 Firefox 功能

- -

Firefox Developer Edition 取代了 Firefox 釋出流程中的 Aurora 頻道。如同 Aurora,各功能會在 Nightly builds 中穩定下來後,每隔六週下放到 Developer Edition 裡面。

- -

透過 Developer Edition,您可以在至少 12 週前接觸到 Firefox 正式釋出的工具及平台功能。

- -

來看看 Developer Edition 有哪些新功能

-
- -
-

清晰的界面

- -

更快找到開發者工具。

- -

實驗性的開發者工具

- -

我們加入了尚未準備好正式釋出的實驗性工具。

- -

例如,Developer Edition 加入了 Valence 附加元件,一個可以讓您透過 Firefox 開發者工具連到其他瀏覽器,像是 Android 上面的 Chrome 及 iOS 上面的 Safari。

-
-
- -
-
-

獨立的設定檔

- -

Firefox Developer Edition 使用一個獨立於其他已經安裝在您電腦上 Firefox 版本的設定檔。這意味著您可以簡單的在執行 Developer Edition 的同時使用正式或測試版的 Firefox。

- -
-

註:這表示在您第一次啟動  Developer Edition 後,將會看到一個完全沒有自訂外觀﹑沒有擴充套件、沒有書籤、也沒有歷史紀錄的瀏覽器。若您想讓您的  Developer Edition 跟您其他版本的  Firefox 使用一樣的設定,您可以使用  Firefox Sync 來達成同步。

-
-
- -
-

針對 Web 開發者的設置

- -

我們針對 Web 開發者的需求調整了預設的設定值。例如,chrome 及遠端除錯功能預設為開啟。

-
-
- -

 

diff --git a/files/zh-tw/mozilla/firefox/developer_edition/reverting/index.html b/files/zh-tw/mozilla/firefox/developer_edition/reverting/index.html deleted file mode 100644 index 0a83335196..0000000000 --- a/files/zh-tw/mozilla/firefox/developer_edition/reverting/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: 回到過去 -slug: Mozilla/Firefox/Developer_Edition/Reverting -translation_of: Mozilla/Firefox/Developer_Edition/Reverting ---- -
{{FirefoxSidebar}}

換掉 Developer Edition 佈景主題

- -


- 如果您想繼續使用 Developer Edition, 可是比較喜歡目前套用在 Firefox 及 Firefox Beta 的 Australis 界面,您可以切換到一般的 Firefox 佈景主題:只要打開「自訂模式」面板並點擊「使用 Firefox Developer Edition 佈景主題」按鈕即可。

- -

{{EmbedYouTube("OvJwofTjsNg")}}

- -

注意,目前 Developer Edition 佈景主題尚未與個性面板相容。所以如果您想套用個性面板,您必須先切回 Australis 界面。

- -

回到 Firefox Aurora

- -


- 如果您想保留所有 Firefox Developer Edition 的前期測試功能,但是又不想要有其他的改變,您可以回復到看起來就像是以前的 Firefox Aurora。請依序執行下面兩步驟:

- -
    -
  1. 開啟 Developer Edition 的選項頁面,並將「允許 Firefox Developer Edition 與 Firefox 同時執行」選項的勾選取消掉。您將會收到重新啟動瀏覽器的提示。
  2. -
  3. 瀏覽器重新啟動後,您可以打開「自訂模式」面板並點擊「使用 Firefox Developer Edition 佈景主題」按鈕來關閉 Developer Edition 佈景主題。
  4. -
- -

{{EmbedYouTube("0Ofq-vlw8Qw")}}

diff --git a/files/zh-tw/mozilla/firefox/multiprocess_firefox/index.html b/files/zh-tw/mozilla/firefox/multiprocess_firefox/index.html deleted file mode 100644 index 6afe2dd67d..0000000000 --- a/files/zh-tw/mozilla/firefox/multiprocess_firefox/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: 多處理程序的 Firefox -slug: Mozilla/Firefox/Multiprocess_Firefox -tags: - - Elecrolysis - - Firefox - - Multiprocess - - e10s -translation_of: Mozilla/Firefox/Multiprocess_Firefox ---- -
{{FirefoxSidebar}}

在舊的 Firefox 桌面版本中,整個瀏覽器都是執行在單一的作業系統處理程序裡。特別是用來執行瀏覽器使用者介面(又稱為「chrome code」)的 JavaScript 和網頁裡的程式碼(又稱為「內容」或「網頁內容」)都在同一個處理程序中。
-
-最新版的 Firefox 會分別在單獨的處理程序中執行瀏覽器的介面和網頁內容。在這個架構的第一個版本中,所有瀏覽器分頁在同一個處理程序中執行,而瀏覽器介面則在另外的一個處理程序中。在未來幾個版本後,我們希望能有不只一個處理程序。這個提供多處理程序 Firefox 的專案稱為 Electrolysis,有時候會縮寫成 e10s。

- -

多處理程序的 Firefox 不會影響一般的網頁。只有 Firefox 本身和附加元件的開發者們需要直接存取網頁內容時才會受到影響。

- -

使用者介面的 chrome JavaScript 必須使用 message manager 來間接存取網頁內容。為了緩解過渡期的影響,我們已經實作了 Cross Process Object Wrappers 和一些給附加元件開發者的相容替代方案。如果你是附加元件的開發者,想知道這會不會影響到你,請參閱多處理程序 Firefox 的工作指南

- -
-
-
-
-
技術總覽
-
非常高階的多處理程序 Firefox 實作解釋。
-
網頁內容相容性指南
-
過渡期可能出現的潛在網站相容性問題的指南和細節。提示:不是很多!
-
用語表
-
多處理程序 Firefox 的術語參考。
-
Message manager
-
溝通介面與內容的元件完整指南。
-
基於 SDK 的附加元件
-
如何移植使用 Add-on SDK 開發的附加元件。
-
各種 URIs 在哪裡載入
-
URIs(chrome:, about:, file:, resource:)在哪個處理程序中載入的快速指南。
-
-
- -
-
-
動機
-
為什麼我們要實作多處理程序的 Firefox:效能、安全和穩定。
-
附加元件移植指南
-
如果你是附加元件的開發者,來這裡看看你要如何處理程式碼。
-
跨處理程序元件包裝(Cross Process Object Wrappers)
-
Cross Process Object Wrappers 是一個移植工具,讓 chrome code 可以同步存取內容。
-
內容處理程序的除錯
-
如何在內容處理程序、包含框架和處理程序腳本中進行除錯。
-
多處理程序 Firefox 的分頁處理
-
在多處理程序的 Firefox 中分頁是如何切換的。
-
-
-
- -
-
-
-
-
Chrome 程式碼的限制
-
不再有用的 Chrome 程式碼,以及如何修正。
-
-
- -
-
-
框架程式碼的限制
-
不再有用的框架程式碼,以及如何替代。
-
-
-
- -
-

聯絡我們

- -

了解更多關於項目、參與、或者來問問題。

- - diff --git a/files/zh-tw/mozilla/firefox/privacy/index.html b/files/zh-tw/mozilla/firefox/privacy/index.html deleted file mode 100644 index 1f42ab5be0..0000000000 --- a/files/zh-tw/mozilla/firefox/privacy/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: 隱私 -slug: Mozilla/Firefox/Privacy -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Firefox/Privacy ---- -
{{FirefoxSidebar}}

{{ ListSubpages () }}

diff --git a/files/zh-tw/mozilla/firefox/privacy/tracking_protection/index.html b/files/zh-tw/mozilla/firefox/privacy/tracking_protection/index.html deleted file mode 100644 index a52f8b815d..0000000000 --- a/files/zh-tw/mozilla/firefox/privacy/tracking_protection/index.html +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: 追蹤保護 -slug: Mozilla/Firefox/Privacy/Tracking_Protection -translation_of: Mozilla/Firefox/Privacy/Tracking_Protection ---- -
{{FirefoxSidebar}}

追蹤保護是什麼?

- -

在第 42 版後,Firefox Desktop 與 Firefox for Android 導入了追蹤保護。在隱私視窗(Firefox for Android 則是隱私標籤)內,Firefox 會封鎖從其他用戶追蹤網站載入的內容。

- -

有些被封鎖的內容,屬於頁面排版的一部分。如果 Firefox 因為封鎖了這些內容而造成跑版,用戶很可能會注意到。但如果針對遭封鎖的元素,以其他元素填充的話,用戶也可能完全不會注意到。

- -

當 Firefox 封鎖內容的時候,網頁主控台的訊息會跳出如下面般的紀錄:

- -
因為啟用了追蹤保護,位於「http://some/url」的資源已被封鎖。
- -

請記得在使用 Firefox for Android 的時候,你可以透過遠端除錯訪問主控台。

- -

Firefox UI 會在封鎖內容的時候告訴用戶,並同時告知用戶可以在此次瀏覽階段解除封鎖。用戶也可以選擇完全停用追蹤保護。

- -

Firefox 如何決定封鎖什麼?

- -

載入內容的封鎖與否,取決於該內容來自哪個網域。

- -

Firefox 會傳送一個確定參與用戶追蹤的網域列表。當追蹤保護啟動的時候,Firefox 會封鎖來自列表網站的內容。

- -

追蹤用戶的網站通常來自第三方廣告網站與分析網站。

- -

這對我的網站有什麼意義?

- -

當追蹤保護啟用時,最明顯的意義是:

- - - -

更值得注意的是,如果你的網站有部分依賴於追蹤器的運作程式碼,那這些追蹤程式碼將會被封鎖和禁止並可能導致你的網站失去正常運作當追蹤保護被啟用。例如,當你的網站包含程式碼,那些程式碼依賴於追蹤網站所提供的程式碼的功能,那麼這些追蹤網站的程式碼的功能將會失敗,不會運作,停止呼叫程式碼,失去網站的運作功能。

- -

像是說,不要這樣用 Google Analytics:

- -
<a href="http://www.example.com" onclick="trackLink('http://www.example.com', event);">Visit example.com</a>
-<script>
-function trackLink(url,event) {
-    event.preventDefault();
-    ga('send', 'event', 'outbound', 'click', url, {
-     'transport': 'beacon',
-     'hitCallback': function() {
-       document.location = url;
-     }
-   });
-}
-</script>
- -

而是要在使用物件以前偵測該物件是否存在或被停用,防止程式運作的失敗。像是:

- -
<a href="http://www.example.com" onclick="trackLink('http://www.example.com', event);">Visit example.com</a>
-<script>
-function trackLink(url,event) {
-    event.preventDefault();
-    if (window.ga && ga.loaded) {
-         ga('send', 'event', 'outbound', 'click', url, {
-         'transport': 'beacon',
-         'hitCallback': function() { document.location = url; }
-       });
-    } else {
-        document.location = url;
-    }
-}
-</script>
-
- -

關於此技術的詳細資訊可參見 Google Analytics, Privacy, and Event Tracking.

- -

取決於那些第三方網站程式的程式碼寫法和運作方式,這樣的程式碼寫法不會是適合和適用於你的網站的程式碼。所以說,你的網站將會失敗停止運作如果這些第三方外掛程式碼回應過慢或不可用或追蹤程式碼被外掛程式停用。

diff --git a/files/zh-tw/mozilla/firefox/releases/3/firefox_3_css_improvement/index.html b/files/zh-tw/mozilla/firefox/releases/3/firefox_3_css_improvement/index.html deleted file mode 100644 index bbad0696a8..0000000000 --- a/files/zh-tw/mozilla/firefox/releases/3/firefox_3_css_improvement/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Firefox 3 CSS Improvement -slug: Mozilla/Firefox/Releases/3/Firefox_3_CSS_Improvement -translation_of: Mozilla/Firefox/releases/3/CSS_improvements ---- -
{{FirefoxSidebar}}

Firefox 3 CSS 的改善

- -

參考資訊

- -

延伸閱讀

- diff --git a/files/zh-tw/mozilla/gecko/chrome/api/browser_api/index.html b/files/zh-tw/mozilla/gecko/chrome/api/browser_api/index.html deleted file mode 100644 index faa28e0f03..0000000000 --- a/files/zh-tw/mozilla/gecko/chrome/api/browser_api/index.html +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: Browser API -slug: Mozilla/Gecko/Chrome/API/Browser_API -translation_of: Mozilla/Gecko/Chrome/API/Browser_API/Using ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('privileged') }}

-

摘要

-

HTML Browser API 其實是 HTML <iframe> 元素的延伸,可讓 Web Apps 建構瀏覽器或類似瀏覽器的 Apps。主要可分為 2 大項:

- -

另在「嵌入式內容就是 1 個 Open Web App」的情況下,將於合適的 Apps 環境 (如權限) 中載入該內容。

-

用途

-

設定了 mozbrowser 屬性之後,即可將 <iframe> 轉為瀏覽器框架:

-
<iframe src="http://hostname.tld" mozbrowser>
-

如果要嵌入 Open Web Apps,就必須提供 mozapp 屬性,且導向 Apps 的 manifest 檔案之路徑應為:

-
<iframe src="http://hostname.tld" mozapp='http://path/to/manifest.webapp' mozbrowser>
-

最後透過 remote 屬性,<iframe> 內容可載入至本身的子處理程序 (Child process) 中,藉以分離出「嵌入此 <iframe> 頁面」的處理程序。

-
<iframe src="http://hostname.tld" mozbrowser remote>
-
-

警告:因應安全考量,若要從未知/未經信任的來源下載內容,則必備最後一項屬性。若要略過此屬性,則 Apps 可能受到惡意網站的危害。

-
-

權限

-

任何 Apps 若要嵌入瀏覽器框架,則其 app manifest 檔案中必備 browser 權限。

-
{
-  "permissions": {
-    "browser": {}
-  }
-}
-

此外,若要嵌入 Open Web Apps,則該 App 亦需具備 embed-apps 權限。

-
{
-  "permissions": {
-    "browser": {},
-    "embed-apps": {}
-  }
-}
-

其他函式

-

為因應瀏覽器 <iframe> 的需求,Firefox OS 另擴充了 HTMLIFrameElement DOM 介面。下列新函式將為 <iframe> 提供更多功能:

-

存取 (Navigation) 函式

-

這些函式可存取 <iframe> 的瀏覽記錄,為建構「停止」、「上一頁」、「下一頁」、「重新載入」等按鈕所必備。

- -

效能函式

-

這些函式可管理瀏覽器 <iframe> 所使用的資源。特別適於建構分頁式瀏覽器的應用。

- -

事件函式

-

為了管理瀏覽器 <iframe> 的內容,另新增了許多新事件 (如下所示)。下列函式即用以處理這些事件:

- -

其他函式

-

這些函式適於使用瀏覽器 <iframe> 的 Apps。

- -

事件

-

若要讓 Apps 管理瀏覽器 <iframe>,則該 Apps 將監聽瀏覽器 <iframe> 中發生的新事件。監聽的新事件如下:

- -

範例

-

此範例可建構最基本的瀏覽器 Apps。

-

HTML

-

在 HTML 中,我們只要新增 1 組 URL 位址列、1個「Go」與「Stop」按鈕、1 組瀏覽器 <iframe>

-
<header>
-  <input id="url">
-  <button id="go">Go</button>
-  <button id="stop">Stop</button>
-</header>
-
-<iframe src="about:blank" mozbrowser remote></iframe>
-
-

CSS

-

變個小小的 CSS 戲法,即可切換按鈕為「Go」與「Stop」。

-
button:disabled {
-  display: none;
-}
-

JavaScript

-

現在可加進必要的功能:

-
document.addEventListener("DOMContentLoaded", function () {
-  var url  = document.getElementById("url");
-  var go   = document.getElementById("go");
-  var stop = document.getElementById("stop");
-
-  var browser = document.getElementsByTagName("iframe")[0];
-
-  // This function is used to switch the Go and Stop button
-  // If the browser is loading content, "Go" is disabled and "Stop" is enabled
-  // Otherwise, "Go" is enabled and "Stop" is disabled
-  function uiLoading(isLoading) {
-      go.disabled =  isLoading;
-    stop.disabled = !isLoading;
-  }
-
-  go.addEventListener("touchend", function () {
-    browser.setAttribute("src", url.value);
-  });
-
-  stop.addEventListener("touchend", function () {
-    browser.stop();
-  });
-
-  // When the browser starts loading content, we switch the "Go" and "Stop" buttons
-  browser.addEventListener('mozbrowserloadstart', function () {
-    uiLoading(true);
-  });
-
-  // When the browser finishes loading content, we switch back the "Go" and "Stop" buttons
-  browser.addEventListener('mozbrowserloadend', function () {
-    uiLoading(false);
-  });
-
-  // In case of error, we also switch back the "Go" and "Stop" buttons
-  browser.addEventListener('mozbrowsererror', function (event) {
-    uiLoading(false);
-    alert("Loading error: " + event.detail);
-  });
-
-  // When a user follows a link, we make sure the new location is displayed in the address bar
-  browser.addEventListener('mozbrowserlocationchange', function (event) {
-    url.value = event.detail;
-  });
-});
-

另可參閱

- diff --git a/files/zh-tw/mozilla/gecko/chrome/api/index.html b/files/zh-tw/mozilla/gecko/chrome/api/index.html deleted file mode 100644 index 7c32384981..0000000000 --- a/files/zh-tw/mozilla/gecko/chrome/api/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Chrome-only API reference -slug: Mozilla/Gecko/Chrome/API -translation_of: Mozilla/Gecko/Chrome/API ---- -
{{FirefoxSidebar}}
- -

此頁面列出了僅能在 Gecko Chrome 中執行的 APIs(and sometimes in other privileged circumstances.)。

- -
-

Note: Most of the APIs exposed to the Web in general are also usable in Chrome code: see Web APIs for a list of these.

-
- -

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/mozilla/gecko/chrome/index.html b/files/zh-tw/mozilla/gecko/chrome/index.html deleted file mode 100644 index 5701f56b12..0000000000 --- a/files/zh-tw/mozilla/gecko/chrome/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Gecko Chrome -slug: Mozilla/Gecko/Chrome -tags: - - Chrome - - Gecko - - Mozilla - - Overview -translation_of: Mozilla/Gecko/Chrome ---- -
{{FirefoxSidebar}}
- -

此頁面包含了於 Gecko 中執行 Chrome 程式碼的相關資訊。

- -

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/mozilla/gecko/index.html b/files/zh-tw/mozilla/gecko/index.html deleted file mode 100644 index ce55ea402f..0000000000 --- a/files/zh-tw/mozilla/gecko/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Gecko -slug: Mozilla/Gecko -translation_of: Mozilla/Gecko ---- -
-

Gecko是一個排版引擎,一開始叫做NGLayout,屬於Mozilla專案。Gecko的功能就是讀取網頁內容,如 HTML, CSS, XUL, JavaScript,然後解析將內容顯示在螢幕上或印出來,在以XUL為基礎的應用程式中,Gecko也是用來解析生成應用程式的UI介面。

-
- -

許多應用程式中都有使用到Gecko,包括一些瀏覽器,如Firefox, SeaMonkey等等 (完整列表請參考維基百科Gecko的文章.) 。使用相同版本Gecko的程式對於標準都有著相同的支援。

- - - - - - - - -
-

文件

- -
-
Chrome
-
-

這個頁面包含 Gecko 運行 Chrome 專有程式碼的訊息。

-
-
- -
-
Gecko FAQ
-
常見問題
-
Gecko DOM 參考
-
DOM參考文件
-
Gecko 事件參考
-
Gecko和Mozilla程式內各項事件的參考文件;對於網頁標準的DOM事件,請參考 DOM event reference.
-
Gecko 版本和對應的應用程式
-
Geck版本和各應用程式所用的Gecko版本列表
-
Mozilla 的排版介紹
-
排版相關的技術探討
-
應用 Mozilla
-
在你自己的應用程式中使用Gecko
-
Gecko支援的字符集
-
Gecko支援的字符集列表
-
HTML 解析器運作
-
HTML解析器相關的執行緒探討
-
{{interwiki('wikimo', 'Gecko:Home_Page', 'Gecko Homepage on MozillaWiki')}}
-
使用者、產品規劃圖和最新資源的入口首頁
-
- -

全部...

-
-

社群

- -
    -
  • View Mozilla forums... {{DiscussionList("dev-tech-layout", "mozilla.dev.tech.layout")}}
  • -
- - - -
-
Web Standards, XUL, Embedding Mozilla, Developing Mozilla
-
-
- -

 

diff --git a/files/zh-tw/mozilla/infallible_memory_allocation/index.html b/files/zh-tw/mozilla/infallible_memory_allocation/index.html deleted file mode 100644 index 06844eedd5..0000000000 --- a/files/zh-tw/mozilla/infallible_memory_allocation/index.html +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: 絕對可靠的記憶體配置 -slug: Mozilla/Infallible_memory_allocation -tags: - - 分配 - - 記憶體 -translation_of: Mozilla/Infallible_memory_allocation ---- -
{{gecko_minversion_header("2.0")}}
- -

There's ongoing work to implement infallible memory allocators. These are memory allocation routines that never return null; that is, they always successfully return the requested block of memory. This is in contrast to a traditional, fallible memory allocator that can return null indicating that the request failed.

- -

Currently, while code is transitioned to be compatible with infallible memory allocators, you have to explicitly decide whether to use infallible allocation or not. Eventually, however, the generic memory allocators (malloc() and realloc()) will become infallible.

- -

記憶體配置要怎樣才能萬無一失?

- -

「萬無一失」這個詞代表了配置記憶體時絕對會成功:你的程式碼永遠不會看到請求失敗,也就無須對失敗的情況做出處置。

- -

平常在配置記憶體時,情況則不太一樣。在有限記憶體的狀況下,記憶體配置是有可能失敗的。然而,在平常配置失敗的程序中程式將不會返回到你的程式碼中,而是直接停止程式。不過這情況可能有點少見,因為記憶體管理系統通常都會為你要求的記憶體想盡辦法找到空間。

- -

選擇記憶體分配器

- -

當你在寫需要配置記憶體的程式時,可能需要遵守幾個規則以便幫助你決定是否在分配器使用萬無一失的策略:

- - - -

明示的萬無一失記憶體分配器

- -

下面的記憶體分配器都明確地標示出他們是萬無一失的,並且會一直保持下去。他們保證會回傳可用的記憶體指標:

- -
p = moz_xmalloc();
-p = moz_xrealloc();
-
- -
f = new Foo();
-fArray = new Foo[];
-
- -
n = ::operator new(...);
-nArray = ::operator new[](...);
-
- -

Explicitly fallible memory allocators

- -

These memory allocators are explicitly fallible, and will remain so. When using these, you must check to ensure the resulting value isn't null before attempting to use the returned memory.

- -
p = moz_malloc();
-p = moz_realloc();
-
- -
namespace mozilla {
-  f = new (fallible) Foo();
-  fArray = new (fallible) Foo[];
-}
-
- -
namespace mozilla {
-  n = ::operator new(..., fallible);
-  nArray = ::operator new[](..., fallible);
-}
-
- -

最終萬無一失分配器

- -

下面的記憶體目前是可能出錯的,但在未來將會變成萬無一失的:

- -
p = malloc();
-p = realloc();
-
- -

你也可以參看

- - diff --git a/files/zh-tw/mozilla/introduction_to_layout_in_mozilla/index.html b/files/zh-tw/mozilla/introduction_to_layout_in_mozilla/index.html deleted file mode 100644 index 0c0c5388db..0000000000 --- a/files/zh-tw/mozilla/introduction_to_layout_in_mozilla/index.html +++ /dev/null @@ -1,358 +0,0 @@ ---- -title: Introduction to Layout in Mozilla -slug: Mozilla/Introduction_to_Layout_in_Mozilla -translation_of: Mozilla/Introduction_to_Layout_in_Mozilla ---- -

概要

- - - -

基本數據流

- - - -

- -

關鍵數據結構

- -

- - - -

- -

關鍵數據結構

- - - -

詳細執行步驟

- - - -

設置

- - - -

- -

內容模型的構建

- - - -

- -

框架 Frame 的構建

- - - -

- -

Style 選定

- - - -

回流

- - - -

回流

- - - -

增量回流

- -

- - - -

增量回流

- -

- - - -

增量回流

- -

- - - -

增量回流

- -

- - - -

繪畫

- - - -

漸進

- - - -

- -

未來(?)技術講座

- - - -

結論

- - - -
-

原始文檔信息

- - -
diff --git a/files/zh-tw/mozilla/javascript_code_modules/index.html b/files/zh-tw/mozilla/javascript_code_modules/index.html deleted file mode 100644 index 72f737df9e..0000000000 --- a/files/zh-tw/mozilla/javascript_code_modules/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: JavaScript code modules -slug: Mozilla/JavaScript_code_modules -tags: - - Add-ons - - Extensions - - JavaScript - - Landing - - Modules - - NeedsTranslation - - TopicStub - - XPCOM -translation_of: Mozilla/JavaScript_code_modules ---- -
{{gecko_minversion_header("1.9")}}
- -

JavaScript code modules let multiple privileged JavaScript scopes share code. For example, a module could be used by Firefox itself as well as by extensions, in order to avoid code duplication.

- -

General topics

- -
-
Using JavaScript code modules
-
An introduction to how to use JavaScript code modules.
-
Components.utils.import
-
How to import a JavaScript code module.
-
Components.utils.unload {{gecko_minversion_inline("7.0")}}
-
How to unload a JavaScript code module.
-
Code snippets: Modules
-
Examples of how to use code modules.
-
Mozilla Labs JS Modules
-
This page features a list of JS modules, along with download links and documentation, that extension developers can use in their code.
-
- -
-
- -

Standard code modules

- -
-
AddonManager.jsm {{gecko_minversion_inline("2.0")}}
-
Interface to install, manage, and uninstall add-ons.
-
AddonRepository.jsm {{gecko_minversion_inline("2.0")}}
-
Allows searching of the add-ons repository.
-
Assert.jsm {{gecko_minversion_inline("28.0")}}
-
Implements the CommonJS Unit Testing specification version 1.1, which provides a basic, standardized interface for performing in-code logical assertions with optional, customizable error reporting.
-
ctypes.jsm {{fx_minversion_inline("3.6")}}
-
Provides an interface that allows JavaScript code to call native libraries without requiring the development of an XPCOM component.
-
CustomizableUI.jsm {{fx_minversion_inline("29")}}
-
Allows you to interact with customizable buttons and items in Firefox's main window UI.
-
DeferredTask.jsm {{gecko_minversion_inline("18.0")}}
-
Run a task after a delay.
-
Dict.jsm {{gecko_minversion_inline("5.0")}}
-
Provides an API for key/value pair dictionaries.
-
DownloadLastDir.jsm {{gecko_minversion_inline("2.0")}}
-
Provides the path to the directory into which the last download occurred.
-
Downloads.jsm {{gecko_minversion_inline("23.0")}}
-
Provides a single entry point to interact with the downloading capabilities of the platform.
-
FileUtils.jsm {{gecko_minversion_inline("1.9.2")}}
-
Provides helpers for dealing with files.
-
Geometry.jsm {{gecko_minversion_inline("2.0")}}
-
Provides routines for performing basic geometric operations on points and rectangles.
-
HTTP.jsm {{gecko_minversion_inline("25.0")}}
-
A wrapper for XMLHttpRequest that provides convenient and simplified API for dealing with HTTP requests.
-
JNI.jsm {{fx_minversion_inline("17.0")}}
-
Abstracts the js-ctypes to provide an interface that allows JavaScript code to call code running in native JVMs.
-
ISO8601DateUtils.jsm
-
Provides routines to convert between JavaScript Date objects and ISO 8601 date strings.
-
Log.jsm (formerly log4moz) {{gecko_minversion_inline("27.0")}}
-
Provides a log4j style API for logging log messages to various endpoints, such as the Browser Console or a file on disk. This module was formerly
-
NetUtil.jsm
-
Provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously.
-
openLocationLastURL.jsm {{gecko_minversion_inline("1.9.1.4")}}
-
Provides access to the last URL opened using the "Open Location" option in the File menu.
-
OSFile.jsm {{gecko_minversion_inline("16.0")}}
-
Provides routines to access files. Read, write, rename, create directories, ...
-
PerfMeasurement.jsm {{fx_minversion_inline("4.0")}}
-
Provides access to low-level hardware and OS performance measurement tools.
-
PluralForm.jsm
-
Provides an easy way to get the correct plural forms for the current locale, as well as ways to localize to a specific plural rule.
-
PopupNotifications.jsm {{gecko_minversion_inline("2.0")}}
-
Provides an easy way to present non-modal notifications to users.
-
Promise.jsm {{gecko_minversion_inline("25.0")}}
-
Implements the Promises/A+ proposal as known in April 2013.
-
PromiseWorker.jsm {{gecko_minversion_inline("20.0")}}
-
A version of {{domxref("ChromeWorker")}} which uses promises to return the worker's result instead of using an event to do so.
-
Services.jsm {{gecko_minversion_inline("2.0")}}
-
Provides getters for conveniently obtaining access to commonly-used services.
-
source-editor.jsm {{fx_minversion_inline("11.0")}}
-
The Source Editor is used by developer tools such as the Style Editor; this interface implements the editor and lets you interact with it.
-
Sqlite.jsm {{gecko_minversion_inline("20.0")}}
-
A Promise-based API to {{ interface("mozIStorage") }}/SQLite.
-
Task.jsm {{gecko_minversion_inline("17.0")}}
-
Implements a subset of Task.js to make sequential, asynchronous operations simple, using the power of JavaScript's yield operator.
-
Timer.jsm {{gecko_minversion_inline("22.0")}}
-
A pure JS implementation of window.setTimeout.
-
Webapps.jsm {{gecko_minversion_inline("??.0")}}
-
Provides an interface to manager Open Web Apps.
-
WebRequest.jsm {{gecko_minversion_inline("41.0")}}
-
Provides an API to add event listeners for the various stages of making an HTTP request. The event listener receives detailed information about the request, and can modify or cancel the request.
-
XPCOMUtils.jsm
-
Contains utilities for JavaScript components loaded by the JS component loader.
-
diff --git a/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/index.html b/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/index.html deleted file mode 100644 index fc54b6e846..0000000000 --- a/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/index.html +++ /dev/null @@ -1,144 +0,0 @@ ---- -title: Promise.jsm -slug: Mozilla/JavaScript_code_modules/Promise.jsm -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/JavaScript_code_modules/Promise.jsm ---- -

{{ gecko_minversion_header("25") }}

- -

The Promise.jsm JavaScript code module implements the Promises/A+ proposal as known in April 2013.

- -
-

This module was used before DOM Promises were made globally available in Gecko 29. Its usage is not suggested for new code.

- -

If you just need a Promise, consider using a DOM Promise instead.

- -

If you need a Deferred, because you want to create a Promise and manually resolve or reject it, consider using PromiseUtils.jsm instead.

-
- -

To use it, you first need to import the code module into your JavaScript scope:

- -
Components.utils.import("resource://gre/modules/Promise.jsm");
-
- -
-

Note: A preliminary promise module is also available starting from Gecko 17, though it didn't conform to the Promises/A+ proposal until Gecko 25:

- -
Components.utils.import("resource://gre/modules/commonjs/promise/core.js");     // Gecko 17 to 20
-Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js"); // Gecko 21 to 24
-
- -

This implementation also includes helper functions that are specific to the Add-on SDK. While you may still import this module from the above paths, the recommended way for loading it is through the Add-on SDK loader.

-
- -

Introduction

- -

For an introduction to promises, you may start from the Add-on SDK documentation, keeping in mind that only the core subset is implemented in this module.

- -

A promise is an object representing a value that may not be available yet. Internally, a promise can be in one of three states:

- - - -

A reference to an existing promise may be received by different means, for example as the return value of a call into an asynchronous API. In this case, the state of the promise can be observed but not directly controlled.

- -

To observe the state of a promise, its then method must be used. This method registers callback functions that are called as soon as the promise is either fulfilled or rejected. The method returns a new promise, that in turn is fulfilled or rejected depending on the state of the original promise and on the behavior of the callbacks. For example, unhandled exceptions in the callbacks cause the new promise to be rejected, even if the original promise is fulfilled. See the documentation of the then method for details.

- -

Promises may also be created using the new Promise() constructor.

- -

Method overview

- - - - - - - - - - - - - -
Deferred defer(); {{ obsolete_inline("30") }}
Promise resolve([optional] aValue);
Promise reject([optional] aReason);
- -

Methods

- -

defer()

- -

Creates a new pending promise and provides methods to resolve or reject it.

- -
Deferred defer(); {{ obsolete_inline("30") }}
-
- -
Parameters
- -

None.

- -
Return value
- -

A new object, containing the new promise in the promise property, and the methods to change its state in the resolve and reject properties. See the Deferred documentation for details.

- -

resolve()

- -

Creates a new promise fulfilled with the specified value, or propagates the state of an existing promise.

- -
Promise resolve(
-  aValue
-);
-
- -
Parameters
- -
-
aValue {{ optional_inline() }}
-
If this value is not a promise, including undefined, it becomes the fulfillment value of the returned promise. If this value is a promise, then the returned promise will be resolved with the value, i.e. it will eventually assume the same state as the provided promise.
-
- -
Return value
- -

A promise that can be pending, fulfilled, or rejected.

- -

reject()

- -

Creates a new promise rejected with the specified reason.

- -
Promise reject(
-  aReason
-);
-
- -
Parameters
- -
-
aReason {{ optional_inline() }}
-
-

The rejection reason for the returned promise. Although the reason can be undefined, it is generally an Error object, like in exception handling.

- -
Note: This argument should not be a promise. Specifying a rejected promise would make the rejection reason equal to the rejected promise itself, and not its rejection reason.
-
-
- -
Return value
- -

A rejected promise.

- -

Examples

- -

See the examples page.

- -

See also

- - diff --git a/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/promise/index.html b/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/promise/index.html deleted file mode 100644 index 44c0b22181..0000000000 --- a/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/promise/index.html +++ /dev/null @@ -1,215 +0,0 @@ ---- -title: Promise -slug: Mozilla/JavaScript_code_modules/Promise.jsm/Promise -tags: - - JavaScript - - Promise.jsm -translation_of: Mozilla/JavaScript_code_modules/Promise.jsm/Promise ---- -

一個 Promise 物件代表一個可能還不能使用的值。

- -

可以用不同的方式接收一個 promise 的參照,比如作為一個異步 API 的回傳值。一但你有了 promise 的參照,你就可以呼叫它的 then() 方法來在它的值準備好後,或是,當錯誤發生時執行一些動作。

- -

Promises 物件也可以透過 new Promise() 建構子來創建。當你使用一個 Promise 物件的參照時,並不需要額外引入 Promise.jsm 模組 。

- -

一個 promise 可以處於三種內部狀態:

- - - -
-

註: 你永遠應該處理、轉送或是回報錯誤(或是拒絕的原因)。如果你看到 "A promise chain failed to handle a rejection",那很有可能是程式碼中有東西需要修正。請參考 handling errors and common pitfalls 。

-
- -

文件規範

- -

在說明文件中,完成值的型別通常被定義在角括號中。舉例來說,OS.File.exists 方法回傳的 promise 最終將會履行一個 boolean。

- -
Promise<boolean> exists(string path);
-
- -

拒絕原因通常可以分別在方法的文件中定義,而且當沒有特別說明時它將被當作是一個 Error 物件。

- -

方法總覽

- - - - - - - - - - -
Promise then([optional] Function onFulfill, [optional] Function onReject);
Promise catch([optional] Function onReject);
- -

建構子

- -

創建一個新的 promise ,初始化等待狀態,並提供一些 resolving 方法的參照,這些方法將可以用來改變它的狀態。

- -
new Promise(executor);
-
- -

參數

- -
-
executor
-
-

這個方法將立刻被呼叫,伴隨著兩個 resolving 方法作為其參數:

- -
executor(resolve, reject);
-
- -

建構子在 executor 結束之前不會結束。那些 resolving 方法可以在任何時候被使用,包含 executor 完成前和完成後,用來控制 promise 的最終狀態。如果 executor 拋出了例外,例外的值將被當作參數傳入 reject 方法。

-
-
- -

Resolving 方法

- -

resolve()

- -

執行將特定值連結到 promise 的工作,或是傳遞狀態到一個已存在的 promise。如果被連結的 promise 已經處於被解決的狀態,無論是被連結到值、拒絕原因、或另外一個 promise,這個方法將不會做任何事。

- -
註: 用一個等待中的 promise 當作此方法的 aValue 參數,並在這個 promise 被解決或被拒絕前再次呼叫此方法,第二次的呼叫並不會有任何效果,因為原本的 promise 已經被連結到這個等待中的 promise。
- -
void resolve(
-  aValue
-);
-
- -
參數
- -
-
aValue Optional
-
如果這個值不是一個 promise,包含 undefined,它將成為被連結 promise 的完成值。如果這個值是一個 promise,則被連結的 promise 將會連結到這個傳入的 promise,並和它保持一樣的狀態(包含任何未來的轉變)。
-
- -

reject()

- -

用指定的原因拒絕被連結的 promise。如果該 promise 已經被解決,無論是連結到值、拒絕原因、或另外一個 promise,這個方法將不會做任何事。

- -
void reject(
-  aReason
-);
-
- -
參數
- -
-
aReason Optional
-
-

被連結 promise 的拒絕原因。雖然原因可以是 undefined,它通常會是一個 Error 物件對象,就像例外處理那樣。

- -
註: 這個參數不應該是一個 promise。指定一個拒絕 promise 作為拒絕原因會讓拒絕原因等於這個拒絕 promise 物件本身,而不是該 promise 的拒絕原因。
-
-
- -

方法

- -

then()

- -

在 promise 被完成或是被拒絕後立刻呼叫提供的方法。一個新的 promise 將被回傳,新 promise 的狀態改變將基於此 promise 和提供的 callback 方法。

- -

一個適當的 callback 總是在這個方法回傳後調用,無論此 promise 是否已經被完成或是被拒絕。你也可以在同一個 promise 上多次呼叫 then 方法,callback 們將被依照它們的註冊順序依序被調用。

- -
-

警告: 如果 onFulfill callback 拋出例外, onReject callback 並不會被調用,錯誤也不會顯示在 console(你將會看到 promise 鍊失敗錯誤)。作為替代方法,你可以在你準備回傳的 promise 上註冊一個拒絕 callback 方法(使用 catch() 或是 then()),用於處理任何此 promise 上註冊的 callback 中拋出的例外。

-
- -
註: 當你在同一個 promise 上呼叫多次 then 方法時,註冊的 callback 們將被獨立的調用。舉例來說,如果任何例外發生在其中一個 callback 中,它將不會影響其餘 callback 的執行。callback 的行為只會影響它註冊的 then 方法回傳的 promise。實際上,每次調用 then 方法將回傳完全不同的 promise。
- -
Promise then(
-  Function onFulfill,
-  Function onReject
-);
-
- -
參數
- -
-
onFulfill Optional
-
如果 promise 被完成,這個方法將被調用,完成值將作為它的唯一參數,此方法的回傳值將決定 then 方法回傳的新 promise 的狀態。若此參數不是一個方法(通常為null),then 方法回傳的新 promise 將被用和原本 promise 相同的完成值完成。
-
onReject Optional
-
-

如果 promise 被拒絕,這個方法將被調用,拒絕原因將作為它的唯一參數,此方法的回傳值將決定 then 方法回傳的新 promise 的狀態。若此參數不是一個方法(通常為null),then 方法回傳的新 promise 將被用和原本 promise 相同的拒絕原因拒絕。

-
-
- -
回傳值
- -

一個預設等待的 promise ,接著可以假設其狀態基於 callback 方法的結果:

- - - -

catch()

- -

相當於呼叫 then() ,並使用 undefined 作為 onFulfill 參數的值。如果你串接 then(onFulfile).catch(onReject)onFulfill 拋出的例外將會被攔截並傳入 onReject ,這和直接將 onReject 傳入 then() 中不同。

- -
Promise catch(
-  Function onReject
-);
-
- -

因此以下的呼叫是等價的:

- -
p.then(undefined, logError);
-p.catch(logError);
-
- -

除錯

- -

基於 promise 的設計, promise 對象的狀態和值無法在不調用 then() 的前提下同步地檢視。

- -

為了幫助除錯,只有在手動檢視 promise 對象時,才能看到更多資訊,這些資訊是代碼無法訪問的特殊屬性(目前,這是透過隨機化屬性名稱來實現的,因為缺少更複雜的語言或調適器的支持)。

- -

這些代碼無法訪問,可檢視的屬性為:

- - - -

Promise properties are visible in the debugger.Promise handlers can be watched from the Console.

- -

範例

- -

參見 examples.

- -

錯誤處理和常見的陷阱

- -

你應該回報沒有被處理的錯誤,除非你將 promise 移交給調用者或是交給其他的代碼來處理這些錯誤。

- -
// ###### WRONG: Silently drops any rejection notified by "OS.File.Exists".
-OS.File.exists(path).then(exists => { if (exists) myRead(path); });
-
-// ###### WRONG: Silently drops any exception raised by "myRead".
-OS.File.exists(path).then(exists => { if (exists) myRead(path); }, Components.utils.reportError);
-
-// CORRECT (for example, might report the exception "myRead is not defined")
-OS.File.exists(path).then(exists => { if (exists) myRead(path); })
-                    .catch(Components.utils.reportError);
-
-// CORRECT (the function returns a promise, and the caller will handle the rejection)
-function myReadIfExists(path)
-{
-  return OS.File.exists(path).then(exists => { if (exists) myRead(path); });
-}
- -

參見

- - diff --git a/files/zh-tw/mozilla/js-ctypes/index.html b/files/zh-tw/mozilla/js-ctypes/index.html deleted file mode 100644 index a49961f677..0000000000 --- a/files/zh-tw/mozilla/js-ctypes/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: js-ctypes -slug: Mozilla/js-ctypes -translation_of: Mozilla/js-ctypes ---- -

{{jsctypesSidebar("Introduction")}}

- -

js-ctypes allows application and extension code to call back and forth to native code written in C. C++ support is possible through vtable pointers see 使用 COM. For a discussion on extended C++ support see {{bug("505907")}}. Unlike binary XPCOM components, It allows developers to ship a single binary for use with multiple versions of Firefox.

- -
Note: js-ctypes 只能使用在 chrome 的應用程式和擴展裡,
- - - - - - - - -
-

文件

- -
-
使用 JS-Ctypes
-
- -
-
JS-ctypes 參考
-
參考 js-ctypes API. - -
-
- -

View All...

- -

範例

- -
-
Add to iPhoto
-
A Firefox extension that uses js-ctypes to call Carbon and Core Foundation framework routines on Mac OS X to implement an "Add image to iPhoto" feature in Firefox.
-
使用 C 結構和指針
-
 
-
使用 COM
-
 
-
使用 Objective-C
-
- -

使用 JNI/Java

- -
-
Github :: ochameau / jscpptypes
-
A mangling library to use C++ from js-ctypes
-
-
-

社群

- - - - - - -
- -

 

diff --git a/files/zh-tw/mozilla/localization/index.html b/files/zh-tw/mozilla/localization/index.html deleted file mode 100644 index eee1265f5f..0000000000 --- a/files/zh-tw/mozilla/localization/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Mozilla 在地化 -slug: Mozilla/Localization -tags: - - Landing - - Localization - - Mozilla - - NeedsTranslation - - TopicStub - - Translation - - l10n -translation_of: Mozilla/Localization ---- -

在地化(Localization、L10n)指的是翻譯軟體的使用者介面,從一個語言到另一個語言,並調整到適合該語言的文化。這些資源提供給所有對於在地化的技術層面感興趣的人。像是開發者和貢獻者。

- -

延伸閱讀

- -
-
Localizing MDN
-
這些資源涵蓋了 MDN 文件的在地化。
-
App localization
-
這一系列文件特別用於在地化應用程式,包含 Firefox OS 應用程式。
-
L10n
-
Mozilla 用於在地化 Firefox OS 的 L10n API 參考文件。
-
diff --git a/files/zh-tw/mozilla/localization/localizing_with_pontoon/index.html b/files/zh-tw/mozilla/localization/localizing_with_pontoon/index.html deleted file mode 100644 index 08461fecd6..0000000000 --- a/files/zh-tw/mozilla/localization/localizing_with_pontoon/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: 使用 Pontoon 來在地化 -slug: Mozilla/Localization/Localizing_with_Pontoon -translation_of: Mozilla/Localization/Localizing_with_Pontoon ---- -

Pontoon 是一個基於web網頁的、所見即所得(WYSIWYG)的在地化(l10n即localization)工具。在Mozilla基金會,我們使用Pontoon本地化Mozilla網站和Firefox OS(火狐移動操作系統)的應用層(app)接口,就是Gaia。 Pontoon是一個非常簡單和直觀的,僅需要很少甚至沒有技術背景,就能在l10n本地化工作流程中,學會使用的工具。以下,我們將討論如何在本地化項目中使用Pontoon,從最初的註冊登錄到最終面對你的貢獻者(參與該項目的志願者或工作人員)。在這個過程中,我們將挑出Pontoon的一些貼心特性,那將使你十分有效率,並將使l10n本地化共享項目變得更容易。

- -
-

你是位開發者嗎? 閱讀 在你的網站上使用 Pontoon 或學習如何在 GitHub 上使用。

-
- -

第一步

- -

Pontoon 的首頁 is very easy to use. To begin localizing the project, click on the Persona icon and sign in. Next, simply select the project you want to work on and your locale from the dropdown menus. Pontoon will automatically open that locale's project for you to get started. Note that for our purposes here, we'll be using Firefox Affiliates website to demo Pontoon's functionality and workflow. And there it is, opened inside Pontoon:

- -

Browser app and workspace

- -

主要工具列

- -

如你所見,most of the interface is taken by the website being translated. Only the toolbar on top belongs to Pontoon, containing the following items (from left to right):

- -

Main toolbar

- -

字串列表

- -

Opens a sidebar with a list of all strings to localize.

- -

Project selector (Affiliates)

- -

Switches between projects to localize.

- -

Resource selector (Homepage)

- -

Switches between project resources to localize, like subpages or localization files. Hidden if no resources available for project.

- -

- -
-
- -

Locale selector (Slovenian)

- -

Switches between languages to localize.

- -

Go

- -

Opens project-resource-locale selection.

- -

Progress indicator

- -

Displays your progress on the resource being localized. More details are available in the popup.

- -
-
- -

使用者清單

- -

Allows for user-specific tasks, like commiting to repository, downloading files and signing out.

- -

資訊清單

- -

Gives important information, like the anticipated project timeline and a list of keyboard shortcuts.

- -
-
- -

好了,我們現在是不是該來翻譯啦~

- -
-
- -

翻譯字串

- -

當使用 Pontoon 來在地化時,你有多種選擇來翻譯你的字串,你可以直接修改內容、在內容外或是兩種混和。We'll start with looking at in-context translation.

- -

內容中

- -

Pontoon's in-context translation mode is what puts it above others. It opens a web page (or web app) and enables real-time editing of that page. Here's how you translate your first string:

- -

In-context localization

- -
    -
  1. Hover over the text you want to translate with your mouse.
  2. -
  3. An edit button appears over that text. Click on it to enable the translate mode.
  4. -
  5. Replace the original text with its translation into your language.
  6. -
  7. Click the save button to save your translation.
  8. -
- -
-

內容外

- -

Some strings are impossible to translate in-context, e.g. the contents of the <title> tag in websites and strings with placeables or different plural forms. By clicking on the hamburger icon in the main toolbar, a list of all strings and available translations will open in the sidebar. You can also use the sidebar for out-of-context localization:

- -

Out-of-context localization: list Out-of-context localization: translate

- -
    -
  1. 點擊你想要翻譯的字串。
  2. -
  3. Translation panel with original string and its details (e.g. comments) opens.
  4. -
  5. Translate the string in the translation area below.
  6. -
  7. 按下儲存按鈕來儲存你的翻譯。
  8. -
- -

當你在內容外翻譯,成果將會直接在內容上呈現,if they could also be translated in-context.

- -

翻譯小助手

-
- -

如你所見,suggestions from history, translation memory, machine translation and other locales are also available in the out-of-context translation panel. We call all of these translation helpers and here's how each of them will help you as you translate strings:

- -

Translation helpers: History Translation helpers: Machinery Translation helpers: Other locales Translation helpers: Search

- -

歷史紀錄

- -

Displays previously suggested translations, including from other users.

- -

Machinery

- -

Displays matches from various services: internal translation memory, Mozilla Transvision, open source translation memory, Microsoft terminology and machine translation.

- -

其他語言

- -

Displays matching translations from other locales.

- -

搜尋

- -

Almost like machinery, but takes provided keyword as input parameter instead of the original string.

- -

By clicking a suggestion, it gets copied into translation area.

- -
-
- -

發布你的在地化

- -

Suppose you now want to publish your l10n work by committing it to a repo. Pontoon lets you do that too! Actually, it does that for you by automatically syncing with repositories on hourly basis. You can now pat yourself on the back, do a little dance, go to sleep or do something else to celebrate your work!

diff --git a/files/zh-tw/mozilla/mathml_project/index.html b/files/zh-tw/mozilla/mathml_project/index.html deleted file mode 100644 index dea19cfe6f..0000000000 --- a/files/zh-tw/mozilla/mathml_project/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Mozilla MathML Project -slug: Mozilla/MathML_Project -tags: - - MathML - - MathML Project - - NeedsTranslation - - TopicStub -translation_of: Mozilla/MathML_Project ---- -

The Mozilla MathML project is Mozilla's project to build and enhance MathML support within Firefox and other Mozilla-based applications. For a quick overview, see the slides for the innovation fairs at Mozilla Summit 2013.

-

Updates

-

Mathzilla

- -

Community

- - - -

Sample MathML Documents

- -

Create MathML Documents

- -
-

Original Document Information

- -
-

 

diff --git a/files/zh-tw/mozilla/mathml_project/screenshots/index.html b/files/zh-tw/mozilla/mathml_project/screenshots/index.html deleted file mode 100644 index 880c0ddd35..0000000000 --- a/files/zh-tw/mozilla/mathml_project/screenshots/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: MathML 快照 -slug: Mozilla/MathML_Project/Screenshots -translation_of: Mozilla/MathML_Project/Screenshots ---- - diff --git "a/files/zh-tw/mozilla/mathml_project/\351\226\213\351\240\255/index.html" "b/files/zh-tw/mozilla/mathml_project/\351\226\213\351\240\255/index.html" deleted file mode 100644 index 6572d9e913..0000000000 --- "a/files/zh-tw/mozilla/mathml_project/\351\226\213\351\240\255/index.html" +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: 使用 MathML -slug: Mozilla/MathML_Project/開頭 -tags: - - MathML -translation_of: Mozilla/MathML_Project/Start ---- -

使用 MathML

-

你有看到這頁面理那些精巧的數學算式嗎? 沒有嗎? 太糟糕了, 來這邊看一下你錯過了什麼東西吧。 並快下載支援這個功能的 Mozilla 板本來補救這哀傷的場面!

-

還是你發現你看到的畫面根螢幕截圖不一樣呢? 這牆況通常是因為你少了某些關鍵的 MathML 字型

-

現在準備萬全了, 你應該看得到這個行內等式的尖角符號: x ^ + xy ^ + xyz ^ .  旁邊這個則是小小的公式, det | a c b d | = a d - b c , 也可以被設定成這樣的顯示方式: det | a b c d | = a d - b c .

-

數學的排版非常的挑剔。 MathML in Mozilla 正是著眼於實踐 MathML 標準 - - - 以能達到 所標記即所得 、或者說 所製即所得 - - - ,簡短點就是所謂的 "WYSIWYM"。 而這兩者的差異可以在下面的兩行算式表現出來!( ... ( ( a 0 + a 1 ) n 1 + a 2 ) n 2 + ... + a p ) n p ( ... ( ( a 0 + a 1 ) n 1 + a 2 ) n 2 + ... + a p ) n p

-

而這粗體等式的根 y 3 + p y + q = 0  也用粗體呈現 y = - q 2 + q 2 4 + p 3 27 2 3 + - q 2 - q 2 4 + p 3 27 2 3 .

-

而等式 a x 2 + b x + c = 0 ,  的根 在下面的黃色區域內點可以縮放它

-
-

Zoomable Math

-

HTML Content

-
    <p>
-      <math display="block">
-        <mstyle id="zoomableMath" mathbackground="yellow">
-          <mrow>
-            <mi>x</mi>
-            <mo>=</mo>
-            <mfrac>
-              <mrow>
-                <mrow>
-                  <mo>-</mo>
-                  <mi>b</mi>
-                </mrow>
-                <mo>&#xB1;</mo>
-                <msqrt>
-                  <mrow>
-                    <msup>
-                      <mi>b</mi>
-                      <mn>2</mn>
-                    </msup>
-                    <mo>-</mo>
-                    <mrow>
-                      <mn>4</mn>
-                      <mi>a</mi>
-                      <mi>c</mi>
-                    </mrow>
-                  </mrow>
-                </msqrt>
-              </mrow>
-              <mrow>
-                <mn>2</mn>
-                <mi>a</mi>
-              </mrow>
-            </mfrac>
-          </mrow>
-        </mstyle>
-      </math>
-    </p>
-
-
-

JavaScript Content

-
      function zoomToggle()
-      {
-      if (this.hasAttribute("mathsize")) {
-      this.removeAttribute("mathsize");
-      } else {
-      this.setAttribute("mathsize", "200%");
-      }
-      }
-
-      function load()
-      {
-      document.getElementById("zoomableMath").
-      addEventListener("click", zoomToggle, false);
-      }
-
-      window.addEventListener("load", load, false);
-
-

{{ EmbedLiveSample('Zoomable_Math') }}

-

還這邊這個有趣的筆記 { u t + f ( u ) x = 0 u ( 0 , x ) = { u - if  x < 0 u + if  x > 0

-

或是這個複雜的筆記 Ell ^ Y ( Z ; z , τ ) := Y ( l ( y l 2 π i ) θ ( y l 2 π i - z ) θ ( 0 ) θ ( - z ) θ ( y l 2 π i ) ) × ( k θ ( e k 2 π i - ( α k + 1 ) z ) θ ( - z ) θ ( e k 2 π i - z ) θ ( - ( α k + 1 ) z ) ) π ( n ) = m = 2 n ( k = 1 m - 1 ( m / k ) / m / k ) - 1 ϕ W s k ( Ω g ) ( | α | k α ϕ ξ α L s ( Ω g ) s ) 1 / s

-

想要看更多的範例你可以點 MathML Project 頁面的任一連結; 如果你有在編譯自己的版本,可以看一下這個資料夾 - - mozilla/layout/mathml/tests - 。

-

所以你可以做些什麼呢? 你在 Mozilla 上使用時有沒有遇到任何 MathML 標準是沒正常運作的? 或者是一些煩人的東西你覺得需要改進? 或是你之前做的某些東西沒辦法正常運作了(像是 迴歸 )? 如果有遇到這些狀況,快去 BugZilla 回報這些異常吧。BugZilla 世有辦法收錄這些東西的。而且,如果你遇到問題不回報,我們也沒辦法去修正啊?!

-

如果你想要讓 Gecko 成為一個更精巧更完善的 MathML 繪製引擎,加入我們。 你的回應可以以 網站上的 MathML 內容呈現、或者去 BugZilla 回報錯誤。或者,如果你能在在程式碼方面提供協助, 來 檢查或改進目前的程式碼 , 或者是處理我們待處理清單的項目。

-
-  
diff --git a/files/zh-tw/mozilla/performance/about_colon_memory/index.html b/files/zh-tw/mozilla/performance/about_colon_memory/index.html deleted file mode 100644 index f9895899dd..0000000000 --- a/files/zh-tw/mozilla/performance/about_colon_memory/index.html +++ /dev/null @@ -1,188 +0,0 @@ ---- -title: 'about:memory' -slug: 'Mozilla/Performance/about:memory' -translation_of: 'Mozilla/Performance/about:memory' ---- -

about:memory 在Firefox 裡是個特別分頁可讓你你看、存、讀、Firefox 的記憶體處理詳細測量出的差異。 此頁也讓你進行其他記憶體相關的操作例如觸發垃圾回收 (GC) 和循環回收 (CC)、轉存 GC & CC 紀錄和轉存無效堆疊偵測 ( DMD) 報告。 此頁出現在所有版本且不須任何準備即可用它。

- -

如何產生記憶體報告

- -

讓我們假設你想去量測 Firefox 的記憶體使用量。 或許你想自己去調查它、也或許某人要球你使用 about:memory 去產生"記憶體報告"以讓他們可以研究你碰到的問題。 跟著下列步驟走:

- - - -

注意在兩個例子中產生的資料含有私人敏感的細節例如你開在其他分頁的完整清單。如果你不想分享這些訊息,你可以選擇 "anonymize" 核取格,在按下 "Measure and save..." 或 "Measure..."之前。 這將造成私人敏感資料被剝掉,但也可能會造成其他人難以去研究記憶體用量。

- -

從檔案讀取記憶體報告

- -

最簡單的方法從檔案讀取記憶體報告就是用 "Load..." 按鈕。 你也可以用 "Load and diff..." 按鈕去獲得在兩個記憶體報告檔中的差異。

- -

單一記憶體報告檔也可以自動被讀取,當附加一個檔案查詢字串,例如:

- -
about:memory?file=/home/username/reports.json.gz
-
- -

這是從其他Firefox裝置系統讀取記憶體報告檔最有用的。

- -

記憶體報告被儲存到壓縮的格式 (gzipped JSON)。 這些檔案可以被直接讀或解壓縮後讀入。

- -

解釋記憶體報告

- -

幾乎在 about:memory 中你看到東西都有工具提示的解釋。停留在任何按鈕將看到它作用的描述。停留在任何文字量測值上將看到它意義的描述。

- -

量測基本

- -

大多數量測使用位元組為他們的單位,但某些是百分比計算。

- -

多數量測值表示在樹狀目錄結構中。例如:

- -
 585 (100.0%) -- preference-service
- └──585 (100.0%) -- referent
-    ├──493 (84.27%) ── strong
-    └───92 (15.73%) -- weak
-        ├──92 (15.73%) ── alive
-        └───0 (00.00%) ── dead
-
- -

枝葉節點表示實際量測值:每個內部節點值是子節點的總和。

- -

樹狀目錄的使用允許量測值分成進一步的目錄、次目錄、次次目錄…….如果需要可到任意深度。一個目錄中所有的量測值不會重疊。

- -

樹狀可以用斜線 '/' 作為分隔符號被描寫。 例如, preference/referent/weak/dead 表示上列中到最後枝葉節點的路徑。

- -

次目錄按它可以被縮起或展開。如果你發現任何特別的樹狀目錄,這可以幫你馬上縮起主根下所有分枝,然後慢慢展開感興趣的。

- -

報告區間 Sections

- -

記憶體報告依照每個預處理原則、每個區間一個程序被顯示,在每個程序的量測值中,還有更多小區間。

- -

Explicit Allocations

- -

這個區間包含一個單一樹狀目錄,叫做 "explicit",量測所有經由表層呼叫(explicit calls)去堆疊配置函數和非堆疊配置函數(例如 mmap and VirtualAlloc)的記憶體。

- -

這裡是瀏覽器區間的例子,分頁打開了 cnn.com、 techcrunch.com、 和 arstechnica.com。不同的次目錄被展開,其他的因展示緣故被縮起。

- -
191.89 MB (100.0%) -- explicit
-├───63.15 MB (32.91%) -- window-objects
-│   ├──24.57 MB (12.80%) -- top(http://edition.cnn.com/, id=8)
-│   │  ├──20.18 MB (10.52%) -- active
-│   │  │  ├──10.57 MB (05.51%) -- window(http://edition.cnn.com/)
-│   │  │  │  ├───4.55 MB (02.37%) ++ js-compartment(http://edition.cnn.com/)
-│   │  │  │  ├───2.60 MB (01.36%) ++ layout
-│   │  │  │  ├───1.94 MB (01.01%) ── style-sheets
-│   │  │  │  └───1.48 MB (00.77%) -- (2 tiny)
-│   │  │  │      ├──1.43 MB (00.75%) ++ dom
-│   │  │  │      └──0.05 MB (00.02%) ── property-tables
-│   │  │  └───9.61 MB (05.01%) ++ (18 tiny)
-│   │  └───4.39 MB (02.29%) -- js-zone(0x7f69425b5800)
-│   ├──15.75 MB (08.21%) ++ top(http://techcrunch.com/, id=20)
-│   ├──12.85 MB (06.69%) ++ top(http://arstechnica.com/, id=14)
-│   ├───6.40 MB (03.33%) ++ top(chrome://browser/content/browser.xul, id=3)
-│   └───3.59 MB (01.87%) ++ (4 tiny)
-├───45.74 MB (23.84%) ++ js-non-window
-├───33.73 MB (17.58%) ── heap-unclassified
-├───22.51 MB (11.73%) ++ heap-overhead
-├────6.62 MB (03.45%) ++ images
-├────5.82 MB (03.03%) ++ workers/workers(chrome)
-├────5.36 MB (02.80%) ++ (16 tiny)
-├────4.07 MB (02.12%) ++ storage
-├────2.74 MB (01.43%) ++ startup-cache
-└────2.16 MB (01.12%) ++ xpconnect
- -

某些專家才需要瞭解這裡所有的細節,但有很多東西值得解釋。

- - - -

某些附加元件 add-ons 的記憶體用量有識別性, 像下列例子所示:

- -
├───40,214,384 B (04.17%) -- add-ons
-│   ├──21,184,320 B (02.20%) ++ {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0x100496800)/compartment([System Principal], jar:file:///Users/njn/Library/Application%20Support/Firefox/Profiles/puna0zr8.new/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js (from: resource://gre/modules/addons/XPIProvider.jsm:4307))
-│   ├──11,583,312 B (01.20%) ++ jid1-xUfzOsOFlzSOXg@jetpack/js-non-window/zones/zone(0x100496800)
-│   ├───5,574,608 B (00.58%) -- {59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
-│   │   ├──5,529,280 B (00.57%) -- window-objects
-│   │   │  ├──4,175,584 B (00.43%) ++ top(chrome://chatzilla/content/chatzilla.xul, id=4293)
-│   │   │  └──1,353,696 B (00.14%) ++ top(chrome://chatzilla/content/output-window.html, id=4298)
-│   │   └─────45,328 B (00.00%) ++ js-non-window/zones/zone(0x100496800)/compartment([System Principal], file:///Users/njn/Library/Application%20Support/Firefox/Profiles/puna0zr8.new/extensions/%7B59c81df5-4b7a-477b-912d-4e0fdf64e5f2%7D/components/chatzilla-service.js)
-│   └───1,872,144 B (00.19%) ++ treestyletab@piro.sakura.ne.jp/js-non-window/zones/zone(0x100496800)
- -

更多細節值得解釋如下:

- - - -

其他量測值

- -

這個區間包含多目錄,包括許多在 "explicit" 目錄中橫跨的量測值。 例如, 在 "explicit"目錄所有的 DOM 和 layout 量測值是被打散成一個又一個視窗, 但在 "Other Measurements" 這些量測值是整合為由整個瀏覽器來的總和, 如下例所示:

- -
26.77 MB (100.0%) -- window-objects
-├──14.59 MB (54.52%) -- layout
-│  ├───6.22 MB (23.24%) ── style-sets
-│  ├───4.00 MB (14.95%) ── pres-shell
-│  ├───1.79 MB (06.68%) ── frames
-│  ├───0.89 MB (03.33%) ── style-contexts
-│  ├───0.62 MB (02.33%) ── rule-nodes
-│  ├───0.56 MB (02.10%) ── pres-contexts
-│  ├───0.47 MB (01.75%) ── line-boxes
-│  └───0.04 MB (00.14%) ── text-runs
-├───6.53 MB (24.39%) ── style-sheets
-├───5.59 MB (20.89%) -- dom
-│   ├──3.39 MB (12.66%) ── element-nodes
-│   ├──1.56 MB (05.84%) ── text-nodes
-│   ├──0.54 MB (02.03%) ── other
-│   └──0.10 MB (00.36%) ++ (4 tiny)
-└───0.06 MB (00.21%) ── property-tables
- -

在這區間的某些目錄量測那些在 "explicit" 目錄中不是橫跨目錄的量測值,例如在上上個例子中的這個 "preference-service" 。

- -

最後, 在這區間結尾是獨立的量測值, 如下例所示:

- -
    0.00 MB ── canvas-2d-pixels
-    5.38 MB ── gfx-surface-xlib
-    0.00 MB ── gfx-textures
-    0.00 MB ── gfx-tiles-waste
-          0 ── ghost-windows
-  109.22 MB ── heap-allocated
-        164 ── heap-chunks
-    1.00 MB ── heap-chunksize
-  114.51 MB ── heap-committed
-  164.00 MB ── heap-mapped
-      4.84% ── heap-overhead-ratio
-          1 ── host-object-urls
-    0.00 MB ── imagelib-surface-cache
-    5.27 MB ── js-main-runtime-temporary-peak
-          0 ── page-faults-hard
-    203,349 ── page-faults-soft
-  274.99 MB ── resident
-  251.47 MB ── resident-unique
-1,103.64 MB ── vsize
- -

某些量測值標示如下:

- - - -

系統 System

- -

這區間只顯示在Firefox OS。 它包含全裝置從操作系統所測得值。在其之中, 這些區間有助於精確瞭解裝置的記憶體如何被使用。

- -

......翻譯完雖然瞭解不少,卻僅知哪些資訊可以給改善者參考,要解決使用者記憶體的問題,還是建議各位設計師可以整合One Tab之類的軟體,限制記憶體使用例如最大800MB,如果超過了,依使用者習慣分為100個分頁中有20個維持開啟活動、剩下的逐步變成例如完整保存的網頁檔之類,平時留個分頁籤名字只是看看而已,點到了才載入,就不會讓人難忍受了,也不會吃太多記憶體就依照個人使用狀況自行分配就好,畢竟閒置的除了影像外,很多只是在播放廣告,一點感想。

diff --git a/files/zh-tw/mozilla/performance/index.html b/files/zh-tw/mozilla/performance/index.html deleted file mode 100644 index f8261ab133..0000000000 --- a/files/zh-tw/mozilla/performance/index.html +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: Performance -slug: Mozilla/Performance -tags: - - NeedsTranslation - - Performance - - TopicStub -translation_of: Mozilla/Performance ---- -

被連接到此的這篇文章將幫助你改進效能,不論你是開發 Mozilla 核心碼或附加元件。

- - - - - - - - -
-

Documentation

- -
-
回報性能問題 Rorting a Performance Problem
-
對使用者友善的指導以報告性能問題。不需要開發環境。
-
性能最好的實踐在擴充元件中
-
給擴充元件開發者性能"最好的實踐"指引。
-
測量附加元件啟動效能
-
給附加元件開發者指引如何設定測試環境。
-
XUL School: 附加元件效能
-
給附加元件開發者提示去幫他們避免損害應用效能。
-
GPU 效能
-
當使用GPU時給研究和改進效能的可靠建議
-
- -

查看所有頁面以 "Performance" 標籤的...

- -

記憶體研究和漏洞偵測工具

- -
-
about:memory
-
about:memory 是最輕巧使用工具給量測記憶體用量使用在 Mozilla 程式碼,且是最好出發地。它也讓你進行其他記憶體相關的操作像觸發垃圾回收 (GC) 和循環回收 (CC)、轉存 GC & CC 紀錄和轉存無效堆疊偵測 ( DMD) 報告。 about:memory 是建立在 Firefox's memory reporting 構造上.
-
DMD
-
無效堆疊偵測 (DMD) 是個可識別在about:memory中的量測值問題點,而且可以作各式各樣的一般堆疊研究。
-
areweslimyet.com
-
areweslimyet.com (又名 AWSY) 是記憶體用和回歸偵測系統。
-
BloatView
-
BloatView 在配置和引用計數時列印按類別統計資料,且依類別提供記憶體中洩漏的分解總數目。它常用為 Mozilla持續整合測試的一部分。
-
引用計數追蹤與平衡
-
引用計數追蹤與平衡是個手段要追蹤由引用計數不正確的使用造成的洩漏。 他們遲緩又不那麼容易使用,且因此大多數適合專家級開發者使用。
-
GC and CC logs
-
觸發垃圾回收 (GC) 和循環回收 (CC)紀錄可被產生與分析以不同方式。特別是,他們能幫助瞭解為何特定勿建一直保持存在記憶體。
-
Valgrind
-
Valgrind 是個即時偵測種種記憶體相關的問題含洩漏的工具。 Valgrind 常作為Mozilla's持續整合測試的 部份  ,雖然Valgrind的遲緩讓應用範圍受限。
-
LeakSanitizer
-
LeakSanitizer (又叫 LSAN) 相似於 Valgrind。 但它跑得快一些因為它使用靜態來源碼架構。LSAN常作為Mozilla's持續整合測試的一部分,雖然多數測試執行時它也是 AddressSanitizer (又叫 ASAN) 測試工作的一部分。
-
Apple tools
-
Apple provides some tools for Mac OS X that report similar problems to those reported by LSAN and Valgrind. The "leaks" tool is not recommended for use with SpiderMonkey or Firefox, because it gets confused by tagged pointers and thinks objects have leaked when they have not (see bug 390944).
-
Leak Gauge
-
Leak Gauge is a tool that can be used to detect certain kinds of leaks in Gecko, including those involving documents, window objects, and docshells.
-
LogAlloc
-
LogAlloc is a tool that dumps a log of memory allocations in Gecko. That log can then be replayed against Firefox's default memory allocator independently or through another replace-malloc library, allowing the testing of other allocators under the exact same workload.
-
Memory Profiler
-
The memory profiler samples allocation events and provides different views to analyze the allocation characteristic.
-
- -

See also the documentation on Leak-hunting strategies and tips.

-
-

Profiling and performance tools

- -
-
Profiling with the Developer Tools Profiler
-
The profiler built into the developer tools has a high-level waterfall, detailed call tree, allocations and GC profiling, and flame graphs. It is available on all platforms and release channels, and also supports remote profiling b2g and Fennec.
-
- -
-
Profiling with the Gecko Profiler Addon {{ gecko_minversion_inline("16.0") }}
-
The Gecko Profiler Addon is a good tool to start with.
-
Profiling with Instruments
-
How to use Apple's Instruments tool to profile Mozilla code.
-
Profiling with Xperf
-
How to use Microsoft's Xperf tool to profile Mozilla code.
-
Profiling with Concurrency Visualizer
-
How to use Visual Studio's Concurrency Visualizer tool to profile Mozilla code.
-
Profiling with Zoom
-
Zoom is a profiler for Linux done by the people who made Shark
-
Measuring performance using the PerfMeasurement.jsm code module {{ gecko_minversion_inline("2.0") }}
-
Using PerfMeasurement.jsm to measure performance data in your JavaScript code.
-
Adding a new Telemetry probe
-
Information on how to add a new measurement to the Telemetry performance-reporting system
-
Profiling JavaScript with Shark {{ gecko_minversion_inline("1.9") }}
-
How to use the Mac OS X Shark profiler to profile JavaScript code in Firefox 3.5 or later.
-
Profiling with Shark
-
How to use Apple's Shark tool to profile Mozilla code.
-
Investigating CSS Performance
-
How to figure out why restyle is taking so long
-
- -

Power profiling

- -
-
Power profiling overview
-
This page provides an overview of relevant information, including details about hardware, what can be measured, and recommended approaches. It should be the starting point for anybody new to power profiling.
-
tools/power/rapl (Mac, Linux)
-
tools/power/rapl is a command-line utility in the Mozilla codebase that uses the Intel RAPL interface to gather direct power estimates for the package, cores, GPU and memory.
-
powermetrics (Mac-only)
-
powermetrics is a command-line utility that gathers and displays a wide range of global and per-process measurements, including CPU usage, GPU usage, and various wakeups frequencies.
-
TimerFirings logging (All platforms)
-
TimerFirings logging is a built-in logging mechanism that prints data on every time fired.
-
dtrace (Mac-only)
-
dtrace is a powerful kernel instrumentation tool. One of its many features is the ability to instrument wakeups in a high-context fashion.
-
Activity Monitor, Battery Status Menu and top (Mac-only)
-
The battery status menu, Activity Monitor and top are three related Mac tools that have major flaws but often consulted by users, and so are worth understanding.
-
Intel Power Gadget (Windows, Mac, Linux)
-
Intel Power Gadget provides real-time graphs for package and processor RAPL estimates. It also provides an API through which those estimates can be obtained.
-
perf (Linux-only)
-
perf is a powerful command-line utility that can measure many different things, including energy estimates and high-context measurements of things such as wakeups.
-
turbostat (Linux-only)
-
turbostat is a command-line utility that gathers and displays various power-related measurements, with a focus on per-CPU measurements such as frequencies and C-states.
-
powertop (Linux-only)
-
powertop is an interactive command-line utility that gathers and displays various power-related measurements.
-
- - - -
-
JavaScript, XPCOM, Developing Mozilla, Extensions, Addons
-
-
- -

 

diff --git a/files/zh-tw/mozilla/preferences/index.html b/files/zh-tw/mozilla/preferences/index.html deleted file mode 100644 index 1169ecabf1..0000000000 --- a/files/zh-tw/mozilla/preferences/index.html +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: Preferences -slug: Mozilla/Preferences -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Preferences ---- -

The preference system makes it possible to store data for Mozilla applications using a key/value pairing system. These articles provide information about how to use the preference system.

- - - - - - - -
-

Documentation

-
-
Preferences system
-
An introduction to using the preference system in Mozilla.
-
XUL School: Handling preferences
-
The XUL School tutorial chapter on preferences.
-
Mozilla preference reference
-
A reference guide to all Mozilla preferences; currently a work in progress.
-
A brief guide to Mozilla preferences
-
An introductory guide to where preferences are stored and other useful information about the core preference system.
-
Using preferences from application code {{gecko_minversion_inline("6.0")}}
-
Firefox 6 introduced static functions for accessing preferences efficiently from within application code. This API is not available for add-ons, but if you're working on a Gecko application, this API is the preferred way to access preferences.
-
Mozilla networking preferences
-
A guide to key networking-related preferences.
-
Mozilla preferences for uber-geeks
-
A guide to preferences that only truly elite geeks should play with.
-
-

View all pages tagged with "Preferences"...

-
-

Examples

-
-
Code snippets
-
Preference-related code snippets.
-
Adding preferences to an extension
-
How to add preferences to an existing extension.
-
- - -
diff --git a/files/zh-tw/mozilla/preferences/preferences_system/index.html b/files/zh-tw/mozilla/preferences/preferences_system/index.html deleted file mode 100644 index 965cd97480..0000000000 --- a/files/zh-tw/mozilla/preferences/preferences_system/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Preferences system -slug: Mozilla/Preferences/Preferences_system -tags: - - NeedsTranslation - - Preferences system - - TopicStub - - XUL -translation_of: Mozilla/Preferences/Preferences_system ---- -

This document describes Toolkit's preferences system. Using this system it is possible to create preferences windows that display and operate appropriately on various platforms (Windows, MacOS X and GNOME).

- -

The system is implemented through a few XUL elements and attributes. Reference information about them is available below:

-

Preferences System documentation:

-

Use

-

Code for a typical preferences window may look like this:

-
<prefwindow id="appPreferences"
-            xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <prefpane id="pane1" label="&pane1.title;">
-    <preferences>
-      <preference id="pref1" name="pref.name" type="bool"/>
-    </preferences>
-
-   .. UI elements that refer to the preferences above, e.g.:
-    <checkbox id="check1" preference="pref1"
-              label="&check1.label;" accesskey="&check1.accesskey;"/>
-  </prefpane>
-
-  <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/>
-</prefwindow>
-
-

Pane content can be specified inline or an external chrome URI supplied for pane content to be loaded in via a dynamic overlay. You should be careful to read the HIGs for the platforms you are targeting and use the XUL preprocessor if necessary to set different window titles as appropriate. You should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. Windows).

-

Usage in XULRunner applications

-

When calling openDialog() to open a preferences dialog, "toolbar" should be included in the features string.  Not using "toolbar" will cause the preferences dialog to only display one preference pane.

-

Example:

-
var features = "chrome,titlebar,toolbar,centerscreen,modal";
-window.openDialog(url, "Preferences", features);
-
-

Bugzilla

-

The component for bugs in the Preferences bindings (but not in Firefox/Thunderbird Options UI) is Toolkit:Preferences (file a bug list open bugs)

diff --git a/files/zh-tw/mozilla/preferences/preferences_system/new_attributes/index.html b/files/zh-tw/mozilla/preferences/preferences_system/new_attributes/index.html deleted file mode 100644 index f583b29b26..0000000000 --- a/files/zh-tw/mozilla/preferences/preferences_system/new_attributes/index.html +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: Preference XUL Attributes -slug: Mozilla/Preferences/Preferences_system/New_attributes -translation_of: Mozilla/Preferences/Preferences_system/New_attributes ---- -

 

-

<prefwindow> 裡的 Widgets 可能有下述屬性 (除此以外,尚有標準屬性).

-

preference

-

Specifies id of the linked <preference> element. preference 和 widget 兩者的 value 將保持同步.

-

如下例,當 pane 被載入時, textbox 從名稱 extensions.example.mypref 的 preference 來自動初始化它的 value ;反過來說,當使用者改變 textbox 的 value 時,<preference>元素的 value 會同步更新,並將在適當的時候儲存至 preferences system.

-
<preference id="my_pref" name="extensions.example.mypref" type="unichar"/>
-<textbox preference="my_pref"/>
-
-

preference-editable

-

By default, the <preference> element will automatically modify the value of a few standard widgets: checkbox, colorpicker, radiogroup, textbox, listitem, listbox, and menulist.

-

If you wish it to update the value of an element with different local name, for example your own XBL widget, you need to set the preference-editable="true" attribute on it.

-

For your widget to modify the <preference>'s value, you need to make sure a change, command, or input event is fired after the widget's value changes.

-

bug # or any testcases ? Note: this does not currently work on the tree widget. It may not work on anything so far (the API says it is to be available in version 1.8).

-

onsyncfrompreference/onsynctopreference

-

Often you will have UI whose construction does not map easily to a given preference type. 例如,你可能有一個 checkbox,當一個整數值是 3 時它被打勾,是 2 時不被打勾。為了初始化這個 UI 元素,你不能依賴預設的 initialization routine,因為這兩個數值對 checkbox 元素來說是無意義的. 你需要寫轉換函數來轉換 preference value 成 UI 元素可用的初始值,並且也轉換 UI 元素的 value 成某些格式來儲存至 preferences file. 這就是 onsyncfrompreference/onsynctopreference 的作用.

-

onsyncfrompreference 被呼叫,當一個元素從 preferences 被初始化。 明確地說, 當一個 preference 元素的 value 被載入, 所有使用那個 preference 的元素將使他們的 onsyncfrompreference handler 被呼叫.

-
- Be careful when writing onsyncfrompreference handlers.  <preference> elements defined after the preference element  being dealt with will not yet have their value set, so referring to them from the handler will lead to a null result. Reorder the <preference> elements or directly fetch the preference value via Services.prefs
-

If you supply an implementation of this event, your implementation will be invoked during initialization and you can return the value with which to initialize the UI element with, or undefined to tell the preferences system to initialize the UI element with the default value (i.e. to attempt to initialize with the preference value). In the above example, you might write the checkbox like this:

-
<checkbox preference="foo.bar" onsyncfrompreference="return onsyncfrompreference();"/>
-
-.. script:
-function onsyncfrompreference()
-{
-  var preference = document.getElementById("foo.bar");
-  // .value === undefined means the preference is set to the default value
-  var actualValue = preference.value !== undefined ?
-                      preference.value : preference.defaultValue;
-  // actualValue may be |null| here if the pref didn't have the default value.
-  return preference.value == 3;
-
-  // If foo.bar was boolean and we wanted to use its value to initialize
-  // the checkbox, we could still implement this method if we wanted to
-  // perform any other initialization actions at this time.
-}
-
-

onsynctopreference is called when preferences are being written - the preferences system asks each element to translate its current state into a value suitable for writing to the specified preference. You can return a special value or undefined to tell the preferences system to use its standard means for obtaining the value. In the above example:

-
<checkbox preference="foo.bar" onsynctopreference="return onsynctopreference();"/>
-.. script:
-function onsynctopreference()
-{
-  var checkbox = document.getElementById("checkbox");
-  return checkbox.checked ? 3 : 2;
-}
-
-// If foo.bar was boolean and we wanted to use its value to write to
-// preferences, we could still implement this method if we wanted to
-// perform any other initialization actions at this time.
-
-

Preferences System documentation:

diff --git a/files/zh-tw/mozilla/projects/index.html b/files/zh-tw/mozilla/projects/index.html deleted file mode 100644 index 7e832a9616..0000000000 --- a/files/zh-tw/mozilla/projects/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Projects -slug: Mozilla/Projects -tags: - - Landing - - Mozilla - - NeedsContent - - NeedsTranslation - - Projects - - TopicStub -translation_of: Mozilla/Projects ---- -

Below you'll find links to documentation about various Mozilla projects; these are often parts of Firefox or other products, but may also be used in other projects as well.

-

{{ LandingPageListSubpages() }}

diff --git a/files/zh-tw/mozilla/projects/nss/getting_started_with_nss/index.html b/files/zh-tw/mozilla/projects/nss/getting_started_with_nss/index.html deleted file mode 100644 index 83eb55baba..0000000000 --- a/files/zh-tw/mozilla/projects/nss/getting_started_with_nss/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: Getting Started With NSS -slug: Mozilla/Projects/NSS/Getting_started_with_NSS -translation_of: Mozilla/Projects/NSS/Getting_started_with_NSS ---- -

如何參與NSS

- -

網絡安全服務(NSS)是Mozilla軟件使用的加密算法和安全網絡協議的基礎庫。
-
- 您想參與並幫助我們改善Mozilla Firefox和其他使用NSS的應用程序的核心安全性嗎?我們期待著您的貢獻!
-
- 我們有大量任務等待您關注,我們很樂意協助您確定與您的興趣或技能相匹配的領域。您可以在Mozilla IRC#nss頻道中找到我們,也可以在mozilla.dev.tech.crypto新聞組中提問。

- -

NSS庫及其支持的命令行工具使用C編程語言編寫。它的構建系統和自動化測試基於makefile和bash腳本。

- -

隨著時間的流逝,已經產生了許多描述NSS各個方面的文檔。您可以從以下內容開始:

- - - -

(不幸的是,NSS項目目前沒有技術撰稿人,因此我們的文檔沒有我們想要的那樣井井有條。您可以通過更好的組織方式來做出貢獻。)

- -

NSS示例代碼

- -

由NSS開發人員維護的命令行工具是開始學習如何編寫NSS應用程序的好地方。您可以在子目錄mozilla / security / nss / cmd中找到它們

- -

或看看一些基本的NSS示例代碼

- -

目前正在開發和審查一組新的樣本,請參閱創建新的NSS樣本

- -

歡迎您通過以下方式下載示例:hg clone https://hg.mozilla.org/projects/nss; cd nss; hg更新SAMPLES_BRANCH

- -

如何貢獻

- -

...(此部分仍在建設中,但是有很多貢獻的機會)

- -

如果您沒有,請先在bugzilla.mozilla.org上打開一個bugzilla帳戶。

- -

NSS ::庫組件可解決您要處理的問題。我們維護了一個標記為“ good-first-bug”NSS錯誤列表,您可以查看這些錯誤

- -

創建補丁

- -

請參閱有關NSS來源,構建和測試的部分,以開始製作補丁。當您對此感到滿意時,就需要進行代碼審查。

- -

代碼審查

- -

http://phabricator.services.mozilla.com/是我們的代碼審查工具,它使用您的Bugzilla帳戶。使用我們的Phabricator用戶說明上傳補丁進行審核

- -

Github上的清單形式列出了一些在代碼審查期間將要評估的項目

- -

通過審查後,您的補丁程序可以由NSS小組的成員登陸。您可以在Mozilla IRC#nss頻道中找到我們。

- -

請注意,我們不會發布未經審查和測試的代碼。代碼僅在具有測試的情況下才有效,而測試僅在它們屬於自動化的一部分時才有效。

diff --git a/files/zh-tw/mozilla/projects/nss/index.html b/files/zh-tw/mozilla/projects/nss/index.html deleted file mode 100644 index 186df02c73..0000000000 --- a/files/zh-tw/mozilla/projects/nss/index.html +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: Network Security Services -slug: Mozilla/Projects/NSS -tags: - - JSS - - NSS - - NeedsMigration - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Projects/NSS ---- -

Network Security Services (NSS) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Applications built with NSS can support SSL v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security standards.

- -

For detailed information on standards supported, see Overview of NSS. For a list of frequently asked questions, see the FAQ.

- -

NSS is available under the Mozilla Public License. For information on downloading NSS releases as tar files, see Download PKI Source.

- -

If you're a developer and would like to contribute to NSS, you might want to read the documents highlevel overview of internal details of NSS and getting started with NSS.

- - - - - - - - -
-

Documentation

- -

Background Information

- -
-
Overview of NSS
-
Provides a brief summary of NSS and its capabilities.
-
NSS FAQ
-
Answers basic questions about NSS.
-
Introduction to Public-Key Cryptography
-
Explains the basic concepts of public-key cryptography that underlie NSS.
-
Introduction to SSL
-
Introduces the SSL protocol, including information about cryptographic ciphers supported by SSL and the steps involved in the SSL handshake.
-
- -

Getting Started

- -
-
NSS Releases
-
This page contains information about the current and past releases of NSS.
-
Get the source code and Build it
-
Instructions on how to build NSS on the different supported platforms.
-
Get Mozilla Source Code Using Mercurial
-
Information about with working with Mercurial.
-
Get Mozilla Source Code Using CVS (deprecated)
-
Old deprecated CVS documentation.
-
- -

NSS APIs

- -
-
Introduction to Network Security Services
-
Provides an overview of the NSS libraries and what you need to know to use them.
-
NSS SSL Public Functions
-
Summarizes the SSL APIs exported by the NSS shared libraries.
-
NSS SSL Reference
-
API used to invoke SSL operations.
-
NSS API Guidelines
-
Explains how the libraries and code are organized, and guidelines for developing code (naming conventions, error handling, thread safety, etc.)
-
NSS Technical Notes
-
Links to NSS technical notes, which provide latest information about new NSS features and supplementary documentation for advanced topics in programming with NSS.
-
- -

Tools, testing, and other technical details

- -
-
Build Instructions for NSS
-
Describe how to check out and build NSS releases.
-
- -
-
NSS Developer Tutorial
-
How to make changes in NSS. Coding style, maintaining ABI compatibility.
-
- -
-
NSS Tools
-
Tools for developing, debugging, and managing applications that use NSS.
-
Sample Code
-
Demonstrates how NSS can be used for cryptographic operations, certificate handling, SSL, etc.
-
Third-Party Code
-
A list of third-party code included in the NSS library.
-
NSS 3.2 Test Suite
-
Archived version. Describes how to run the standard NSS tests.
-
NSS Performance Reports
-
Archived version. Links to performance reports for NSS 3.2 and later releases.
-
Encryption Technologies Available in NSS 3.11
-
Archived version. Lists the cryptographic algorithms used by NSS 3.11.
-
NSS 3.1 Loadable Root Certificates
-
Archived version. Describes the scheme for loading root CA certificates.
-
cert7.db
-
Archived version. General format of the cert7.db database.
-
- -

PKCS #11 information

- - - -
-
- -

CA certificates pre-loaded into NSS

- - - -
-
- -

NSS is built on top of Netscape Portable Runtime (NSPR)

- -
-
Netscape Portable Runtime
-
NSPR project page.
-
NSPR Reference
-
NSPR API documentation.
-
- -

Additional Information

- - - -

Planning

- -

Information on NSS planning can be found at wiki.mozilla.org, including:

- - -
-

Community

- -
    -
  • View Mozilla Security forums...
  • -
- -

{{ DiscussionList("dev-security", "mozilla.dev.security") }}

- -
    -
  • View Mozilla Cryptography forums...
  • -
- -

{{ DiscussionList("dev-tech-crypto", "mozilla.dev.tech.crypto") }}

- - - - -
diff --git a/files/zh-tw/mozilla/projects/rhino/index.html b/files/zh-tw/mozilla/projects/rhino/index.html deleted file mode 100644 index 9167cbfaac..0000000000 --- a/files/zh-tw/mozilla/projects/rhino/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Rhino -slug: Mozilla/Projects/Rhino -tags: - - JavaScript - - Mozilla - - NeedsTranslation - - NeedsUpdate - - Rhino - - TopicStub -translation_of: Mozilla/Projects/Rhino ---- -

Image:rhino.jpg

- -

Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. It is embedded in J2SE 6 as the default Java scripting engine.

- -

Rhino downloads

- -

How to get source and binaries

- -

Rhino documentation

- -

Information on Rhino for script writers and embedders.

- -

Rhino help

- -

Some resources if you get stuck.

diff --git a/files/zh-tw/mozilla/projects/rhino/license/index.html b/files/zh-tw/mozilla/projects/rhino/license/index.html deleted file mode 100644 index 951430039e..0000000000 --- a/files/zh-tw/mozilla/projects/rhino/license/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Rhino license -slug: Mozilla/Projects/Rhino/License -translation_of: Mozilla/Projects/Rhino/License ---- -

Rhino可在開源許可下使用。

- -

MPL / GPL許可

- -

Rhino的大部分源代碼都是在MPL 1.1 / GPL 2.0許可下提供的。

- -

部分Rhino調試器的許可證

- -

此外,一些文件(目前是toolsrc / org / mozilla / javascript / tools / debugger / treetable /的內容)在以下許可下可用:

- -
 *版權所有1997,1998 Sun Microsystems,Inc。保留所有權利。
- *
- *重新分發和使用源和二進制形式,有或沒有
- *修改,如果滿足以下條件,則允許
- *符合:
- *
- *  - 源代碼的重新分發必須保留上述版權
- *通知,此條件清單和以下免責聲明。
- *
- *  - 二進制形式的再分發必須複製上述版權
- *通知,此條件清單和以下免責聲明
- *隨分發提供的文件和/或其他材料。
- *
- *  -  Sun Microsystems的名稱和名稱
- *貢獻者可用於支持或推廣衍生產品
- *未經事先書面許可,不得使用本軟件。
- *
- *本軟件由版權所有者和貢獻者“提供
- *“是”以及任何明示或暗示的擔保,包括但不限於,
- *對適銷性和特定適用性的暗示保證
- *目的不承擔任何責任。在任何情況下都不應該是版權所有者或
- *貢獻者對任何直接,間接,偶然,特殊的,
- *示範性或後續性損害(包括但不限於,
- *購買替代商品或服務; 丟失使用,數據或
- *利潤; 或商業中斷)然而,導致和任何理論
- *責任,無論是合同,嚴格責任還是侵權(包括
- *疏忽或以其他方式)以任何方式使用此產品
- *軟件,即使被告知此類損害的可能性。
-
- -
-

Norrisboyd 2008年4月14日06:16(PDT)

diff --git a/files/zh-tw/mozilla/qa/bug_writing_guidelines/index.html b/files/zh-tw/mozilla/qa/bug_writing_guidelines/index.html deleted file mode 100644 index 57d1cc41db..0000000000 --- a/files/zh-tw/mozilla/qa/bug_writing_guidelines/index.html +++ /dev/null @@ -1,246 +0,0 @@ ---- -title: Bug writing guidelines -slug: Mozilla/QA/Bug_writing_guidelines -tags: - - 錯誤回報 -translation_of: Mozilla/QA/Bug_writing_guidelines ---- -
-

If you need help with Mozilla software (for example with Firefox, Seamonkey or Thunderbird), use one of the available support options. Do not edit this page!

-
- -

This page assumes you'd like to contribute to the Mozilla project by collecting enough information to enter a useful bug report in Bugzilla, the Mozilla bug tracking system. Thank you!

- -

If you're new to reporting bugs, you may want to try getting help from the more experienced contributors. See the Community section on the QA page for pointers. If you're going to report a Firefox bug, you can also get assistance in the #firefox channel on irc.mozilla.org. For other projects (e.g., Thunderbird, SeaMonkey)  you can find the appropriate channel on IRC.

- -

如何回報錯誤

- -

每次回報一個錯誤

- -

如此一來能夠有效率地處理每個錯誤。

- -

其他需要您注意的事項

- -
    -
  1. 釐清如何 重現您遇到的錯誤: - -
      -
    • 如果能夠 完整描述重現錯誤過程 —太棒了! — 您將提供有收穫的錯誤回報。
    • -
    • 有時能夠重現問題,但不確定是用什麼特定的方法,則您需要提供有幫助的額外資訊。
    • -
    • 如果無法重現問題,回報該問題可能沒有太大的幫助,除非在發現錯誤時,您有獨特的發現。
    • -
    -
  2. -
  3. 檢查軟體是否已更新至最新版本。建議先測試開發中版本來確認錯誤是不是早就修正(例如:Firefox Beta, Aurora, 或是走在科技前端的 Nightly
  4. -
  5. When reporting a Firefox bug, first check if you can reproduce the bug in a new Firefox profile. If the bug only happens in your existing profile, try to figure out what settings, extensions, or files in your profile are needed to reproduce the bug. -
      -
    • If the bug seems egregious (i.e. obviously affecting a large portion of users), there's probably something unusual about your setup that's a necessary part of the steps to reproduce the bug. You have much better chances of figuring it out than a developer who does not have access to your system.
    • -
    • If the bug falls into one of specific types of bugs listed in a section below, it may still be useful even if you can't reproduce it in a new Firefox profile.
    • -
    -
  6. -
  7. Open the Enter a new bug form, which will guide you through most of the bug reporting process: -
      -
    • Create a Bugzilla account if you don't have one already, select the product having the bug.
    • -
    • Enter a clear unique summary as described below; check if the bug has already been reported (if you want to be more thorough, there's an advanced guide on screening duplicate bugs).
    • -
    • Provide precise steps to reproduce, expected results and actual results as described in the following section.
    • -
    • Provide additional information (also described below), especially if you can't reproduce the bug in a new profile; and/or by reporting a crash, memory usage, performance, regression bug; or if the problem is with a specific web site.
    • -
    -
  8. -
  9. 如果遇到多個錯誤時,請分開一個一個回報。
  10. -
- -

簡短明確描述問題

- -

您會怎麼用大概十幾個字描述問題? 開發者會先看到這一部分文字。

- -

好的錯誤回報會快速且清楚說明錯誤。這是用來解釋問題的來龍去脈,請不要給予針對問題的建議。

- - - - - -

描述可以重現問題的詳細的步驟

- -

How can a developer reproduce the bug on his or her own computer?

- -

Steps to reproduce are the most important part of any bug report. If a developer is able to reproduce the bug, the bug is very likely to be fixed. If the steps are unclear, it might not even be possible to know whether the bug has been fixed.

- - - - - - - - - - - - - - - - - - - - - - - - -
在問題回報裡應該寫些什麼 ?好的例子(描述細節) -

不好的例子(敘述籠統)

-
-

說說你能不能控制卡 bug 的時機。

- -

可以故意卡、偶爾遇到、不能控制。

-
照著下面的步驟做問題就出現了: 
-

描述如何命令 Firefox 做你想做的事。

-
-

1. 點桌面捷徑打開 Firefox
- 2. 按下 Cmd+N (Windows 系統按 Ctrl+N )來打開新的視窗。

- -

3. 把 https://mail.google.com/ 複製貼上到網址列然後按Enter。

-
在新視窗打開Gmail
-

照著步驟做後,清楚地描述你看到的 (實際) 結果預期結果。 請將這兩項分開來寫。

-
預期結果: 我的收件匣正常顯示。
- 實際結果: 我的收件匣顯示 '您的瀏覽器不支援 Cookies (錯誤 -91)'。
-

 

- -

"網頁跑不出來"

-
- -

提供額外的資訊

- -

The following information is requested for most bug reports. You can save time by providing this information below the Expected results. If you need to attach multiple files, you can do so after submitting the report.

- -

For specific types of bugs

- -

If you are reporting a crash bug, please include a Breakpad ID or attach stack trace, and include the crash signature in the bug summary as well as in the Crash Signature field.

- -

If you are reporting a memory use or leak bug, please attach the output of about:memory. Ideally, find steps to reproduce an increase in what is shown in about:memory (even after clicking the "Minimize memory usage" button at the bottom). If you have trouble finding steps to reproduce, try the Firefox Support page titled Firefox Uses Too Much Memory (Ram) - How to Fix. If you are a C++ developer, more precise tools are available.

- -

If you are reporting a bug about slowness or high CPU usage, please provide a link to the performance profile in the bug.

- -

If you are reporting a hang (beachball on OS X or "not responding" on Windows), please follow the instructions in How to Report a Hung Firefox.

- -

If you are reporting a bug involving a Flash hang, please visit https://wiki.mozilla.org/Flash/Hang_Debugging to learn how to provide useful information for developers.

- -

If you are reporting a bug involving a specific web page, please try to make a reduced testcase and attach it to the bug report. If you don't have time or expertise, please report the issue to webcompat.com instead, where our volunteers will do this for you.

- -

If the bug was recently introduced, finding a regression window can help identify the cause of the bug.

- -

What if my bug seems "random" or "intermittent"?

- -

For most Firefox bugs

- -

You should provide the following information for most Firefox bugs.

- - - - - - - - - - - - - - - - - - - - -
What should you include in a bug report?Example
Indicate if the problem can be reproduced using a new Firefox profile and any changes you need to make in order to reproduce.The problem can be reproduced in a new profile, but only if Preferences -> Privacy & Security -> Tracking Protection is selected.
If you can only reproduce with an existing profile try to figure out what settings, extensions, or files in your profile are needed to reproduce the bug. If you skip the step, save the troubleshooting information from about:support to a file and attach it to the bug report.I can't reproduce in a new profile, about:support information from the offending profile is attached.
-

Indicate if the problem can be reproduced using the latest Nightly build. Include the Build ID from about:support.

- -

If possible, test using the new Firefox profile you created. If you need to test the Nightly build with your regular profile, you might want to back up the profile first, since the pre-release build may corrupt your data.

-
The problem can be reproduced on the latest Nightly (Build ID 20170416100136).
- -

 

- -
-

Original document information

- - -
- -

 

- -
-

Advanced

- -

Finding the correct product and component

- -

You will be asked to categorize your bug into a "product" and a "component" within that product, in order to direct your report to the correct developers.

- -

If you're using Firefox, the bug is most likely in "Firefox", "Toolkit", or "Core".

- - - -

When in doubt, search for similar bugs and see which component they are in.

- -

If none of the components seem appropriate, look for a "General" component in the most appropriate product.

- -

General Outline of a Bug Report

- -
-

Most of the following article has been merged into this page from QMO: How to write a proper bug

-
- - - -

 

- -
-

Original document information

- - -
diff --git a/files/zh-tw/mozilla/qa/index.html b/files/zh-tw/mozilla/qa/index.html deleted file mode 100644 index 99a8a38dd2..0000000000 --- a/files/zh-tw/mozilla/qa/index.html +++ /dev/null @@ -1,251 +0,0 @@ ---- -title: 'QA: Quality assurance at Mozilla' -slug: Mozilla/QA -tags: - - Landing - - NeedsTranslation - - QA - - Testing - - TopicStub -translation_of: Mozilla/QA ---- -

The Mozilla Quality Assurance (QA) team drives software quality assurance activities across Mozilla and plays a key role in releasing a diverse range of software products on schedule. Within each project in Mozilla, we work to explore new features, write and execute tests, uncover and file bugs, build and maintain tools, collect and analyze metrics, and support the release world-class products that promote the open Web.

- -

Here you'll find articles and tools to help you gear up to join the QA team testing Firefox to ensure that each release is as good as it can be.

- -

Get started

- - - -

Bugs

- -
-
-

Reporting bugs

- -
-
Bugzilla
-
All Mozilla projects use Bugzilla to track bugs. You will need to create an account with Bugzilla in order to report bugs and triage them.
-
Bug writing guidelines
-
The more effectively a bug is reported, the more likely that an engineer will actually fix it. By following these guidelines, you can help ensure that your bugs stay at the top of the Mozilla engineers' heap, and get fixed.
-
A Bug's Life
-
This tutorial will give an overview of what happens in the states that a bug will go through as well as how it will go from one to the next within its total life. It also explains the meaning of flags/keywords used in QA.
-
Filing Crash Bugs
-
This document lists guidelines and tips on how to file bug reports for crashes in a way that helps in debugging and fixing the reported issue.
-
-
- -
-

Triaging bugs

- -
-
Confirming unconfirmed bugs
-
Identify useful bug reports and close the rest.
-
Triaging Bugs for Firefox
-
Information about the entire bug triaging process – from processing incoming bugs to narrowing down the steps to reproducing bugs.
-
Screening duplicate bugs
-
Help get bugs fixed faster by screening incoming reports for duplicates.
-
General Guidelines
-
What to do and what not to do in Bugzilla.
-
-
-
- -
-

Manual testing

- -
-
-
-
Manual Test Case Writing Primer
-
How to write proper manual test cases
-
-
- -
-
-
TestRail
-
Mozilla QA's manual test cases reside in TestRail. You will need an LDAP account in order to login and execute test cases. Learn more on the TestRail wiki page.
-
-
-
- -
-

Automated testing

- -
-
-
-
Automated testing at Mozilla
-
Documentation about creating and using automated tests for Mozilla code.
-
Running automated tests
-
-

This page lists the steps required to run Mozilla's automated test suites.

-
-
Developing tests
-
Ensure that future changes to Mozilla don't break things that currently work correctly.
-
Avoiding intermittent test failures
-
Suggestions for ways to make your tests more reliable, thereby helping to avoid random, intermittent test failures.
-
Test Verification
-
When a changeset adds a new test, or modifies an existing test, the test verification (TV) test suite performs additional testing to help find intermittent failures in the modified test as quickly as possible.
-
Mozharness FAQ
-
Answers to common questions about Mozharness.
-
-
- -
-
-
Robocop
-
Robocop is the automated testing system used for Firefox for Android. Learn its code style guidelines
-
Marionette
-
Get started with Marionette UI testing.
-
web-platform-tests
-
Learn how to use the industry standard, cross-browser, cross-platform Web runtime testing system from the W3C used by Mozilla and others to ensure browser interoperability.
-
External Media Tests
-
Get started testing HTML5-based video elements using VideoPuppeteer, a Marionette- -based test suite used to test sites like YouTube and Netflix.
-
Chrome tests
-
A chrome test is basically a Mochitest running with chrome privileges.
-
-
-
- -
-

Firefox QE

- -
-
-
-
Triaging Bugs for Firefox
-
Information about the entire bug triaging process – from processing incoming bugs to narrowing down the steps to reproduce a bug.
-
- -
-
Tips and Tricks
-
These tips and tricks will make your life easier when you are testing.
-
-Downloading Nightly or Trunk Builds - -
-
Every 24 hours, a "nightly" build is created that testers all over the world download and test, reporting as they go along on any bugs that hit them.
-
-
- -
-
-
Command Line Options
-
Command line options are used to specify various startup options for Firefox.
-
Reporting a Performance Problem
-
This article will guide you in reporting a performance problem using the Gecko Profiler extension.
-
Crash reporting
-
Firefox ships with an open-source crash reporting system.
-
-
-
- -
-

Firefox for Android

- -
-
-
-
Mobile Firefox
-
Firefox for Android is the mobile version of Firefox with a native Android look and feel.
-
Compatibility Testing
-
Help us identify websites that do not work well in Firefox by reporting the specific issues that you find in your investigation.
-
-
- -
-
-
Logging with the Android Debug Bridge and Logcat
-
This article will provide a walkthrough in downloading and setting up an environment to which one can gain access to and view Android system logs.
-
Enabling the Error Console
-
See the Mozilla Hacks article on Remote Debugging on Firefox for Android for web content. If you need to debug the Firefox browser itself use Android's adb logcat.
-
-
-
- -
-

Firefox OS

- -
-
-

Manual testing

- -
-
Simulator vs Emulator vs Device
-
These are three basic options when it comes to getting a Firefox OS environment in order to work on, or developing for, Firefox OS.
-
Debugging
-
Discover the different tools at your disposal to debug your Firefox OS code.
-
Reporting Bugs
-
This article provides a guide to filing bugs against the Firefox OS project, including Gaia and B2G.
-
-
- -
-

Platform (Gecko)

- -
-
Automated Testing
-
Learn various aspects of testing Firefox OS, including running different tests, automation, and result reporting and tracking.
-
Gaia Performance Tests
-
This article provides information about running performance tests on Gaia, as well as how to create new tests.
-
Feature Support Chart
-
There are several different builds of Firefox OS you can download or build for yourself, and there are some differences between the types of features available on each device.
-
-
-
- -
-

Web QA

- -
-
-
-
Reducing testcases
-
Improve bug reports by turning broken web pages into simple testcases, which can help developers understand the bug and can also be used for creating automated tests.
-
Managing XFails
-
One of the ongoing tasks of the Web QA department is managing xfails. This document will explain what xfails are, and describe the steps one can take to investigate and update them.
-
-
- -
-
-
Running Automated Tests
-
So you’re interested in contributing to Mozilla Web QA automation projects but don’t know where to start? This doc will help you get up and running a set of tests locally.
-
-
-
- -
-

Glossary

- -
-
-
Smoke Test
-
-
-
- -

See also

- - diff --git a/files/zh-tw/mozilla/rust/index.html b/files/zh-tw/mozilla/rust/index.html deleted file mode 100644 index 28f46deb33..0000000000 --- a/files/zh-tw/mozilla/rust/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Rust 程式語言 -slug: Mozilla/Rust -translation_of: Mozilla/Rust ---- -

Rust logoRust 是個由 Mozilla 及社區志願者所建立的開源系統程式語言,旨在幫助開發者建立快速安全,並充分使用當代多核心處理器強大功能的程式。它會阻止記憶體區段錯誤(segmentation fault)並確保執行緒(thread)安全、並使用簡單明瞭的語法。

- -

另外,Rust 提供了 zero-cost abstractions, move semantics, guaranteed memory safety, threads with no data races, trait-based generics, pattern matching, type inference, and efficient C bindings, with a minimum runtime size.

- -

要學習 Rust,可以透過:

- - - -

Rust and the future of systems programming

- -

{{EmbedYouTube("8EPsnf_ZYU0")}}

- -

Unlocking the power of parallelism with Rust

- -

{{EmbedYouTube("cNeIOt8ZdAY")}}

- -

Rust for web developers

- -

{{EmbedYouTube("FfoXFnzZbBM")}}

- -

Safe systems programming with Rust

- -

{{EmbedYouTube("P3sfNGtpuxc")}}

- -

Growing the Rust community

- -

{{EmbedYouTube("duv0tuPAnO0")}}

- -

Putting Rust into production at Mozilla

- -

{{EmbedYouTube("2RhbYpgVpg0")}}

diff --git a/files/zh-tw/mozilla/tech/index.html b/files/zh-tw/mozilla/tech/index.html deleted file mode 100644 index f9682e62e1..0000000000 --- a/files/zh-tw/mozilla/tech/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Mozilla technologies -slug: Mozilla/Tech -tags: - - Landing - - Mozilla - - NeedsTranslation - - Reference - - TopicStub - - XUL -translation_of: Mozilla/Tech ---- -

Mozilla has several technologies used as components of its projects. These are documented here. (flesh out this text).

-

{{LandingPageListSubpages}}

diff --git a/files/zh-tw/mozilla/tech/xpcom/reference/index.html b/files/zh-tw/mozilla/tech/xpcom/reference/index.html deleted file mode 100644 index 29d07953d6..0000000000 --- a/files/zh-tw/mozilla/tech/xpcom/reference/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: XPCOM reference -slug: Mozilla/Tech/XPCOM/Reference -tags: - - Add-ons - - Extensions - - Landing - - Mozilla - - NeedsTranslation - - Reference - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference ---- -

This reference describes the interfaces and functions provided by the XPCOM library. In addition, it details the various helper classes and functions, as well as the components, provided by the XPCOM glue library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.

- -
-

WebExtensions are becoming the new standard for creating add-ons. Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the WebExtensions API, and report any missing functionality so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see Comparison with XUL/XPCOM extensions. In addition, any binaries you use will then need to be converted for use with the WebExtensions native messaging API, or compiled using WebAssembly or Emscripten.

-
- -
-

If you're working on a module in the Mozilla codebase that's compiled with the MOZILLA_INTERNAL_API flag set, some of these APIs -- the string functions and classes in particular -- are not the ones you should be using. See the XPCOM internal string guide for documentation of the internal string API used within the Mozilla codebase.

-
- -

{{LandingPageListSubpages}}

- -

Many XPCOM pages return an nsresult. Prior to Gecko 19 {{geckoRelease(19)}}, this was an integer that simply returned an error code. It is now a strongly typed enum when XPCOM is built using a C++11 compiler. This causes compile-time errors to occur when improper values are returned as nsresult values, thereby making it easier to catch many bugs.

diff --git a/files/zh-tw/mozilla/tech/xpcom/reference/interface/index.html b/files/zh-tw/mozilla/tech/xpcom/reference/interface/index.html deleted file mode 100644 index d098cf8402..0000000000 --- a/files/zh-tw/mozilla/tech/xpcom/reference/interface/index.html +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: XPCOM Interface Reference -slug: Mozilla/Tech/XPCOM/Reference/Interface -tags: - - NeedsTranslation - - TopicStub - - XPCOM - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface ---- -

This is a reference to the XPCOM interfaces provided by the Mozilla platform.

- -
{{tree('','1')}}
- -

See also

- - diff --git a/files/zh-tw/mozilla/tech/xpcom/reference/interface/nsicontentpolicy/index.html b/files/zh-tw/mozilla/tech/xpcom/reference/interface/nsicontentpolicy/index.html deleted file mode 100644 index 6ed47b6c80..0000000000 --- a/files/zh-tw/mozilla/tech/xpcom/reference/interface/nsicontentpolicy/index.html +++ /dev/null @@ -1,491 +0,0 @@ ---- -title: nsIContentPolicy -slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPolicy -translation_of: Archive/Mozilla/nsIContentPolicy ---- -

{{IFSummaryStart(“DOM /鹼/ nsIContentPolicy.idl”,“編寫腳本”)}}接口用於實現內容策略的機制。這個接口的實現可以被用來控制各種類型的外的線的內容,或者某些類型的內聯內容的處理的負荷。{{IFSummaryEnd(“nsIContentPolicyBase”,42,“1.0”)}}

- -

可以觀察到,正在通過實施{{接口(“nsIContentPolicy”)}}加載到瀏覽器中的內容。如果你正在開發一個內容感知的插件(攔截廣告或改變內容的外觀,例如)該接口是非常有用的,或者如果你想停止或允許用戶瀏覽的網址。

- -

{{WarningStart()}}不要阻塞調用者在你的實施方式{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}(例如,通過啟動一個對話框,以提示用戶東西)。“){{WarningEnd()}}

- -
-

注:在現實中,很多這種接口在{{接口(“nsIContentPolicyBase”)}}接口定義,但現在,直到有人有時間來拆東西記錄在這裡。

-
- -

方法概述

- - - - - - - - - - -
short shouldLoad(in unsigned long aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeTypeGuess, in nsISupports aExtra, in nsIPrincipal aRequestPrincipal);
short shouldProcess(in unsigned long aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeType, in nsISupports aExtra, in nsIPrincipal aRequestPrincipal);
- -

常量

- -

內容類型

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
不變描述
TYPE_OTHER1指示內容,其類型是未知的,或者是不感興趣的一個有限的使用情況之外。在一般情況下,你應該盡量不要使用這種類型的,除非沒有其他人是合適的。{{gecko_minversion_inline(“1.8”)}}
TYPE_SCRIPT2表示的可執行script(例如JavaScript)。{{gecko_minversion_inline(“1.8”)}}
TYPE_IMAGE3指示image(例如,{{HTMLElement的(“IMG”)}}的元素)。{{gecko_minversion_inline(“1.8”)}}
TYPE_STYLESHEET4指示stylesheet(例如,{{HTMLElement的(“風格”)}}的元素)。{{gecko_minversion_inline(“1.8”)}}
TYPE_OBJECT5代表一個普通object(插件,處理內容通常這一類下降)。{{gecko_minversion_inline(“1.8”)}}
TYPE_DOCUMENT6表示DOM {{domxref(“文件”)}}在頂層(即,直接在瀏覽器標籤)。{{gecko_minversion_inline(“1.8”)}}
TYPE_SUBDOCUMENT7 -

表示包含在另一個一{{domxref(“文件”)}} document例如,{{HTMLElement的(“IFRAME”)}}和{{HTMLElement的(“幀”)}}的元素)。{{gecko_minversion_inline(“1.8”)}}

- -
-

注:壁虎使用TYPE_INTERNAL_FRAME,並TYPE_INTERNAL_IFRAME以內部辨別其差異。這些類型映射到TYPE_SUBDOCUMENT被傳遞到內容政策實施前,不應外壁虎代碼中使用。{{gecko_minversion_inline(41)}}

-
-
TYPE_REFRESH8 -

指示定時刷新。

- -

{{manch(“shouldLoad”)}}將永遠不會得到這個,因為它並不代表內容被加載(通過刷新觸發的實際負載將通過{{manch(“shouldLoad”)}}如預期)。

- {{manch(“為ShouldProcess”)}}將收到此為,例如{{HTMLElement的(“元”)}}刷新元件和HTTP刷新頭。{{gecko_minversion_inline(“1.8”)}}
TYPE_XBL9指示XBL綁定請求,觸發或者通過{{cssxref(“ - MOZ結合”)}} CSS屬性或{{domxref(“Document.addBinding()”)}}方法。{{gecko_minversion_inline(“1.8”)}}
TYPE_PING10表示通過在{{HTML元素(“A”)}}使用元素{{htmlattrxref(“平”,“一”)}}屬性的點擊觸發的平。{{gecko_minversion_inline(“1.9”)}}
TYPE_XMLHTTPREQUEST11表示{{domxref(“XMLHttpRequest的”)}}。也用於{{domxref(“Document.load()”)}} {{gecko_minversion_inline(“1.9”)}}
TYPE_OBJECT_SUBREQUEST12表示由一個插件的請求。{{gecko_minversion_inline(“1.9”)}}
TYPE_DTD13表示通過XML加載的DTD document{{gecko_minversion_inline(“1.9”)}}
TYPE_FONT14指示經由{{cssxref(“@字體面”)}}規則加載的字體。{{gecko_minversion_inline(“1.9.1”)}}
TYPE_MEDIA15表示視頻或音頻負載。{{gecko_minversion_inline(“1.9.1”)}}
TYPE_WEBSOCKET16表示的WebSocket的負荷。{{gecko_minversion_inline(“11”)}}
TYPE_CSP_REPORT17表示一個內容安全策略報告。{{gecko_minversion_inline(“20”)}}
TYPE_XSLT18表示一個樣式表轉換。{{gecko_minversion_inline(“27”)}}
TYPE_BEACON19表示信標後。{{gecko_minversion_inline(“30”)}}
TYPE_FETCH20指示通過發起的負載的{{domxref(“GlobalFetch.fetch()”)}}方法,其可作為在全球都{{domxref(“窗口”)}}和{{domxref(“工人”)} }上下文。{{gecko_minversion_inline(36)}}
TYPE_IMAGESET21指示要加載的{{HTML元素(“IMG”)}}(與該{{htmlattrxref(“srcset”,“IMG”)}}屬性或{{HTMLElement的(“圖片”)}}。{{gecko_minversion_inline(請求36)}}
TYPE_WEB_MANIFEST22指示要加載一個Web清單的請求。{{gecko_minversion_inline(41)}}
TYPE_INTERNAL_SCRIPT23 -

用於表示使用{{HTMLElement的(“腳本”)}}元素加載的腳本的內部常數。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SCRIPT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_WORKER24 -

用於表示通過專用工人加載的腳本的內部常數。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SCRIPT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_SHARED_WORKER25 -

用於表示通過共享工人加載的腳本的內部常數。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SCRIPT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_EMBED26 -

內部常量用於表示從{{HTML元素(“嵌入”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_OBJECT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_OBJECT27 -

內部常量用於表示從{{HTMLElement的(“對象”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_OBJECT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_FRAME28 -

內部常量用於表示從{{HTML元素(“幀”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SUBDOCUMENT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_IFRAME29 -

內部常量用於表示從{{HTML元素(“IFRAME”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SUBDOCUMENT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_AUDIO30 -

內部常量用於表示從{{HTML元素(“音頻”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_MEDIA傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_VIDEO31 -

內部常量用於表示從{{HTML元素(“視頻”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_MEDIA傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_TRACK32 -

內部常量用於表示從{{HTML元素(“軌道”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_MEDIA傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
REJECT_REQUEST-1從{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}返回如果負載或處理請求是基於所述請求的細節拒絕。{{gecko_minversion_inline(“1.8”)}}
REJECT_TYPE-2 -

從{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}返回如果負載/過程僅僅基於(上述標誌)它的類型拒絕。

- {{注(“這甩只適用於該服務器上的當前請求,而不是同一類型的未來需求。”)}} {{gecko_minversion_inline(“1.8”)}}
REJECT_SERVER-3 -

從{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}如果負載/過程是基於在服務器上拒絕它託管在或從請求(返回aContentLocationaRequestOrigin),例如,如果塊的IMAGE,因為它是從goatse.cx服務(即使你不一定阻止other從該服務器/域類型)。

- {{注(“這甩只適用於該服務器上的當前請求,而不是同一類型的未來需求。”)}} {{gecko_minversion_inline(“1.8”)}}
REJECT_OTHER-4 -

從{{manch(“shouldLoad”)}}或返回{{manch(“為ShouldProcess”)}}如果負載/過程是基於一些拒絕other標準。Mozilla的呼叫者會處理這個喜歡REJECT_REQUEST; 第三方實現者,例如,用這個來指導自己的來電諮詢額外參數的更多細節。{{gecko_minversion_inline(“1.8”)}}

- -

{{注(“這甩只適用於該服務器上的當前請求,而不是同一類型的未來需求。”)}}

-
ACCEPT1從{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}如果負載或處理請求不被拒絕返回。{{gecko_minversion_inline(“1.8”)}}
OTHER0{{obsolete_inline(“1.8”)}}
SCRIPT1{{obsolete_inline(“1.8”)}}
IMAGE2{{obsolete_inline(“1.8”)}}
STYLESHEET3{{obsolete_inline(“1.8”)}}
OBJECT4{{obsolete_inline(“1.8”)}}
SUBDOCUMENT5{{obsolete_inline(“1.8”)}}
CONTROL_TAG6{{obsolete_inline(“1.8”)}}
RAW_URL7{{obsolete_inline(“1.8”)}}
DOCUMENT8{{obsolete_inline(“1.8”)}}
- -

方法

- -

shouldLoad()

- -

打電話讓自己的內容政策的執行決定在給定位置的資源是否應該被加載。這種方法是通過加載指定aContentLocation的資源,以確定是否要開始加載所請求的資源之前調用。

- -

shouldLoad()可以稱為同時所涉及的文檔的DOM和佈局是不一致的狀態。這意味著,該方法的實施者不得做任何以下內容:

- -
    -
  1. 以任何方式修改DOM中(例如,設置屬性是一個沒有沒有)。
  2. -
  3. 查詢依賴於佈局(例如,任何DOM屬性offset*屬性)。
  4. -
  5. 查詢依賴於任何風格的DOM屬性(例如,計算方式)。
  6. -
  7. 查詢依賴於DOM的當前狀態的“上下文”節點(例如,節點列表的長度)之外的任何DOM屬性。
  8. -
  9. [JavaScript實現僅]不使用XPCNativeWrapper(顯式或隱式地)的任何對象上的任何類型的訪問屬性。由於各種DOM0的事情,這會導致項目4。
  10. -
- -

如果你在做這些事情shouldLoad()的實現,期望不可預知的行為,可能包括死機,沒有顯示出來的內容,內容顯示了一倍,等等。如果你不需要做任何的事情上面,做他們關閉超時或事件。

- -
:當多個內容策略用於(例如,通過幾個擴展),如果其中一人拒絕的請求,該政策的其餘部分不叫。參考:http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsContentPolicy.cpp#146
- -
:內容政策在上述情況下的順序取決於安裝的優先級。
- -
短shouldLoad(
-  在無符號長aContentType,
-  在nsIURI aContentLocation,
-  在nsIURI aRequestOrigin,
-  在nsISupports aContext,
-  在ACString aMimeTypeGuess,
-  在nsISupports aExtra,
-  在nsIPrincipal aRequestPrincipal
-);
-
- -
參數
- -
-
aContentType
-
的類型的內容進行測試。這將是一個一個{{ANCH(“內容類型”)}}在上面列出。
-
aContentLocation
-
的內容的URI被檢查; 一定不能null
-
aRequestOrigin {optional_inline}}
-
啟動此加載請求的資源的位置; null如果不適用。
-
aContext {optional_inline}}
-
的{{接口(“nsIDOMNode”)}}或{{接口(“nsIDOMWindow”)}}發起請求,或一些可以QueryInterface()向其中的一個; null如果不適用。
-
{{音符(“aContext是當用戶使用的上下文菜單中的新選項卡/窗口或CMD / CTRL +打開鏈接的新選項卡/窗口點擊鏈接(即,aContext不是該鏈路是在拉片在這些情況下)。“)}}
-
 
-
 
-
aMimeTypeGuess
-
可選的。用於所請求的內容的MIME類型猜測,基於可用於請求發起(例如,信息OBJECT的類型屬性); 不能可靠地反映實際的MIME類型所請求的內容。
-
aExtra
-
一個可選的參數,直通非壁虎呼叫者額外的數據傳遞給被調用者。
-
- -
-
aRequestPrincipal
-
可選的。定義了導致負載的主體。這僅適用於可選的非壁虎代碼:所有的壁虎代碼應該設置此參數。對於導航事件,這是導致該加載頁面的主體。
-
- -
返回值
- -

ACCEPT 要么 REJECT_*

- -

為ShouldProcess()

- -

如果資源被處理?{{manch(“為ShouldProcess”)}}將被調用一次傳遞給它的所有資料已被確定有關資源,資源的一部分已經被加載後一般。“處理”是指通過處理應用程序。例如,為ShouldProcess可以用來允許來自服務器的響應根據MIME類型的響應的處理或忽略。

- -

{{NoteStart()}} {{manch(“為ShouldProcess”)}}可以被稱為當DOM和佈局document涉及處於不一致的狀態。查看{{manch(“shouldLoad”)}}筆記,看看這是什麼意思了這種方法的實現者。{{NoteEnd()}}

- -
短為ShouldProcess(
-  在無符號長aContentType,
-  在nsIURI aContentLocation,
-  在nsIURI aRequestOrigin,
-  在nsISupports aContext,
-  在ACString aMimeType,
-  在nsISupports aExtra,
-  在nsIPrincipal aRequestPrincipal
-);
-
- -
參數
- -
-
aContentType
-
的類型的內容進行測試。這將是TYPE_ *常量之一。
-
aContentLocation
-
可選的。被請求的資源的位置:可能是,例如,一個重定向後的URI資源。
-
aRequestOrigin
-
可選的。啟動此加載請求的資源的位置; null如果不適用。
-
aContext
-
可選的。的{{接口(“nsIDOMNode”)}}或發起請求{{接口(“nsIDOMWindow”)}},或一些可以查詢接口的那些中的一個; null如果不適用。
-
aMimeType
-
MIME類型所請求的資源(例如,圖像/ PNG)的,所報告的網絡庫,如果可用的話(可以是空的,如果不適合的類型,例如,TYPE_REFRESH)。
-
aExtra
-
一個可選的參數,直通非壁虎呼叫者額外的數據傳遞給被調用者。
-
- -
-
aRequestPrincipal
-
可選的。提出請求的主體。
-
- -
返回值
- -

ACCEPT 要么 REJECT_*

- -

- -

您可以通過包括容易實現這個接口nsIContentPolicy.h的頭文件和實現public nsIContentPolicy到類,如下所示:

- -
//將這個變成你的頭文件
-
-#包括“_path_to_sdk /包括/內容/ nsIContentPolicy.h”
-
-MyClass類:公共nsISupports,公共nsIContentPolicy {
-  ...
-  NS_DECL_NSICONTENTPOLICY
-  ...
-}
-
-//這到您的實現文件 
-NS_IMPL_ISUPPORTSn(MyClass的,nsISupports,nsIContentPolicy,...)
-
- -

{{NoteStart()}}之前,你能接受的通知,你必須註冊你的插件{{接口(“nsICategoryManager”)}}。見下面的例子。{{NoteEnd()}}

- -
字符*以前= nsnull; 
-
-nsCOMPtr的的<nsICategoryManager> catman; 
-
-servman-> GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,
-NS_GET_IID(nsICategoryManager)
-getter_AddRefs(catman)); 
-
-RV = catman-> AddCategoryEntry(“內容的策略”,
-COMPONENT_CLASSNAME,
-COMPONENT_CONTRACTID,
-PR_TRUE,   
-PR_TRUE,
-以前);
- -

JavaScript開發人員也可以實現XPCOM組件擴展nsIContentPolicy

diff --git a/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/howto/index.html b/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/howto/index.html deleted file mode 100644 index fafd0dffa0..0000000000 --- a/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/howto/index.html +++ /dev/null @@ -1,199 +0,0 @@ ---- -title: 'Autoconfig: How to create a configuration file' -slug: Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo -translation_of: Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo ---- -

Definition

-

Authoritative definition

-

Example

-

Real-world example

-

 

-

<?xml version="1.0" encoding="UTF-8"?>

-

<clientConfig version="1.1">
-   <emailProvider id="freenet.de">
-     <domain>freenet.de</domain>
-     <displayName>Freenet Mail</displayName>
-     <displayShortName>Freenet</displayShortName>
-     <incomingServer type="imap">
-       <hostname>imap.freenet.de</hostname>
-       <port>993</port>
-       <socketType>SSL</socketType>
-       <authentication>password-encrypted</authentication>
-       <username>%EMAILADDRESS%</username>
-     </incomingServer>
-     <incomingServer type="imap">
-       <hostname>imap.freenet.de</hostname>
-       <port>143</port>
-       <socketType>STARTTLS</socketType>
-       <authentication>password-encrypted</authentication>
-       <username>%EMAILADDRESS%</username>
-     </incomingServer>
-     <incomingServer type="pop3">
-       <hostname>pop.freenet.de</hostname>
-       <port>995</port>
-       <socketType>SSL</socketType>
-       <authentication>password-cleartext</authentication>
-       <username>%EMAILADDRESS%</username>
-     </incomingServer>
-     <incomingServer type="pop3">
-       <hostname>pop.freenet.de</hostname>
-       <port>110</port>
-       <socketType>STARTTLS</socketType>
-       <authentication>password-cleartext</authentication>
-       <username>%EMAILADDRESS%</username>
-     </incomingServer>
-     <outgoingServer type="smtp">
-       <hostname>smtp.freenet.de</hostname>
-       <port>465</port>
-       <socketType>SSL</socketType>
-       <authentication>password-encrypted</authentication>
-       <username>%EMAILADDRESS%</username>
-     </outgoingServer>
-     <outgoingServer type="smtp">
-       <hostname>smtp.freenet.de</hostname>
-       <port>587</port>
-       <socketType>STARTTLS</socketType>
-       <authentication>password-encrypted</authentication>
-       <username>%EMAILADDRESS%</username>
-     </outgoingServer>
-     <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/index.html">
-       <descr lang="de">Allgemeine Beschreibung der Einstellungen</descr>
-       <descr lang="en">Generic settings page</descr>
-     </documentation>
-     <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/thunderbird/imap-thunderbird/imap/index.html">
-       <descr lang="de">TB 2.0 IMAP-Einstellungen</descr>
-       <descr lang="en">TB 2.0 IMAP settings</descr>
-     </documentation>
-   </emailProvider>
- </clientConfig>

-

How to probe mail servers

-

To determine a server's capabilities, you can contact the server directly and talk the POP/IMAP/SMTP protocol manually (assuming you already know the hostname).
- For non-SSL, use netcat -v hostname port (preferred) or telnet hostname port as "client".

- -

In all cases, the server should respond with a list of capabilities.

-

SSL / STARTTLS

-

There are 2 SSL variants: normal SSL and STARTTLS.

-

Normal SSL

-

The old-style SSL (including TLS, which is just the new name for SSL) has a special port:

- -

On Linux, you can contact the server via

-

-

openssl s_client -connect hostname:port

-

You should see output about the SSL handshake and the certificate. Important is what is listed as "CN=". This must be the same as the hostname that you contacted, otherwise the certificate is not valid (or you need to use another hostname).
- If you see nothing, then probably the server does not support SSL.
- After that, you can have the same protocol exchange as with netcat on standard ports, as listed above.

-

STARTTLS

-

STARTTLS is a special, new form of SSL, which works on the standard ports (e.g. port 143 for IMAP). You can contact the server via netcat as mentioned above. If you see "STARTTLS" (for IMAP, SMTP) or "STLS" (for POP) listed as one of the capabilities, the server should support STARTTLS.
- To try it out, on Linux, you can contact the server via

-

 

-

openssl s_client -connect hostname:port -starttls proto

-

...where "proto" is imap, pop3 or smtp. For example:

-

-

openssl s_client -connect imap.example.com:143 -starttls imap

-

You should get the same response as described above for openssl.

-

Configuration file format

-

Add the appropriate port and socket type for each server, depending on protocol and SSL support. For example,
- for IMAP with SSL:

-

 

-

<port>993<port>

-

<socketType>SSL</socketType>

-

for IMAP with STARTTLS:

-

 

-

<port>143<port>
- <socketType>STARTTLS</socketType>

-

for IMAP without any SSL (deprecated!):

-

 

-

<port>143<port>

-

<socketType>plain</socketType>

-

Use SSL

-

Please do not submit or serve any configurations without SSL! There's no reason in 2010 why users still need to read mail entirely unprotected.
- If you are an ISP and think the server load is too high, try adding an SSL accelerator. They are cheap and widely used. In fact, even most freemail (!) providers these days support SSL, so if users pay you money for ISP service, that's all the more reason to give them proper service. But first simply try to enable software SSL - small servers may be fine with SSL and without any additional installations.

-

Valid certificate

-

Either way, be sure to use a valid certificate:

- -

Authentication

-

Probe the mail server, as explained above for STARTTLS. If you see CRAM-MD5 or APOP in the response, the server should support encrypted passwords. If you only see AUTH LOGIN and/or PLAIN, or no AUTH at all, the server probably does not support secure authentication. In the former case, select "Encrypted passwords" as "Authentication method" (in Thunderbird Account Settings UI, incoming server and SMTP server), and test whether you can actually log in with a real account (because some servers are unfortunately broken with regards to authentication, often due to a wrong or misconfigured SASL installation).

-

Configuration file format

-

In the configuration file, for each IMAP, POP and SMTP server, you need to specify the authentication method.
-
- For plaintext passwords:

-

 

-

<authentication>password-cleartext</authentication>

-

For CRAM-MD5:

-

 

-

<authentication>password-encrypted</authentication>

-


- Discouraged settings (SMTP only):
- If the SMTP server can only be used after checking incoming mail, please use

-

 

-

<authentication>smtp-after-pop</authentication>

-

Note that RFC 4409 disallows that and requires the customer-facing SMTP server to support proper authentication via AUTH.
- If the SMTP server can only be used within the ISP's network, and requires no authentication, use:

-

 

-

<authentication>client-IP-address</authentication>

-

or, if it requires authentication in addition to the user being in the ISP network, use e.g.:

-

 

-

<authentication>password-cleartext</authentication>

-

<restriction>client-IP-address</restriction>

-

However, that means that users on the road or in the office are unable to send mail, which is a real problem for many of our users. This violates RFC 4409 as well and is an outdated configuration. Please try find a configuration that works in all cases, for the sake of the users.

-

Please support MD5 passwords

-

Please support authentication with CRAM-MD5. It is simple to implement, and to set up, and you can still use RADIUS or a database that stores passwords in plaintext, so you don't need to make changes to your mail server or authentication infrastructure apart from installing some software and configuring it correctly. CRAM-MD5 is particularly important when no SSL is used: Never make users send their passwords in plaintext over the network! (Not even in your ISP network.) We warn users in the Mail Account Creation dialog about such insecure configurations, and we reserve the right to block them in the future.
-
- As an ISP, you should ideally store passwords in encrypted format, which removes the risk of mass password theft (and possibly reuse on other sites) if somebody hacks your servers. You can still support plaintext passwords in this case, and encrypt passwords on the fly before comparing. (Users who use plaintext passwords would still be somewhat exposed, but at least you don't have the risk of the whole plaintext password database being stolen.) You can use both plaintext and encrypted authentication transmission with plaintext or encrypted password databases - the two issues are independent.

-

Username

-

If the user's IMAP login name is the same as his email address (for example, if "fred@example.com" is the login name), add:

-

 

-

<username>%EMAILADDRESS%</username>

-

Note: Use %EMAILADDRESS% as literal. Thunderbird will replace it with the email address that the user entered. Same for %EMAILLOCALPART% and other placeholders.

-

If the login name is the same as the first segment before the @ of the email address (for example, "fred" for "fred@example.com"), use:

-

 

-

<username>%EMAILLOCALPART%</username>

-

Aliases, or username not part of email address

-

Note that the above must be true for any email address that the user would set up - even for aliases.
-
- You can ignore aliases like info@, if that's an alias for fred@ (or both fred@ and wilma@) and Fred would set up fred@example.com in Thunderbird, not info@.
-
- If, however, Fred can set up hero@example.com as alias for fred@example.com, and neither "hero" nor "hero@example.com" would work as login name on your IMAP server, you need to set up a lookup of alias -> username on your autoconfig server. So, if you get a request for <http://autoconfig.example.com/mail/c...ro@example.com>, your autconfig server must have a script which responds to /mail/config-v1.1.xml and returns the concrete username, for example:

-

 

-

<username>fred</username>

-

... (or <username>fred@example.com</username>, as appropriate) for hero@example.com. This is the only way to enable automatic configuration without users having to remember what their primary login name was, which is a serious problem in practical experience. Even if you have told them all the necessary information in your welcome letter, they usually cannot find the letter. That's exactly where autoconfiguration tries to help.

-

Enable visiturl

-

Some providers do not provide IMAP or POP service by default, but require it to be enabled via a web UI. If that is the case, add the URL that a logged-in user would use into this field, and the application can prompt the user to visit it.

-

This is not yet supported by Thunderbird 3.1, but should be in the future, so please add this critical information where it applies.

-

If you are an ISP, please by all means avoid this. It's one of those "walls" against which users run the hard way.

-

Documentation URL

-

If the configuration is (partially) based on a help webpage of the ISP that describes the configuration that end users should use, you can record its URL here. You may add several of them, as several elements. It is for informational purposes only and mainly for the maintenance of the config file, the client currently does not use them at all.

-

If your URL contains ampersands (&), please remember to replace them with HTML entities (&amp;). For example:

-

 

-

<documentation url="http://example.com/help.php?client=thunderbird&amp;lang=en"/>

-

Otherwise your XML file will be incorrect and Thunderbird will neither be able to parse it, nor to return any error message.

diff --git a/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/index.html b/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/index.html deleted file mode 100644 index 76a90f2777..0000000000 --- a/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Autoconfig file format -slug: Mozilla/Thunderbird/Autoconfiguration/FileFormat -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Thunderbird/Autoconfiguration/FileFormat ---- - diff --git a/files/zh-tw/mozilla/thunderbird/autoconfiguration/index.html b/files/zh-tw/mozilla/thunderbird/autoconfiguration/index.html deleted file mode 100644 index 84cc17039c..0000000000 --- a/files/zh-tw/mozilla/thunderbird/autoconfiguration/index.html +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: Autoconfiguration in Thunderbird -slug: Mozilla/Thunderbird/Autoconfiguration -tags: - - Administration - - NeedsTranslation - - TopicStub - - enterprise -translation_of: Mozilla/Thunderbird/Autoconfiguration ---- -

Author: Ben Bucksch
- Please do not change this document without consulting the author

-

Thunderbird 3.1 and later (and 3.0 to some degree) includes mail account autoconfiguration functionality. The goal of autoconfiguration is to make it very easy for users to configure the connection of Thunderbird to their email servers. In many cases, people should be able to download and install Thunderbird, enter their real name, email address and password in the Account Setup Wizard and have a fully functioning mail client and get and send their mail as securely as possible.

-

See also:

- -

This document describes how Autoconfiguration in Thunderbird works, and what to do to allow mail servers to be autoconfigured.

-

Mechanisms

-

Thunderbird gets the server settings via different means, each of which is intended for different cases:

- -

All the lookup mechanisms use the email address domain as base for the lookup. For example, for the email address fred@example.com , the lookup is performed as (in this order):

-
    -
  1. tb-install-dir/isp/example.com.xml on the harddisk
  2. -
  3. check for autoconfig.example.com
  4. -
  5. look up of "example.com" in the ISPDB
  6. -
  7. look up "MX example.com" in DNS, and for mx1.mail.hoster.com, look up "hoster.com" in the ISPDB
  8. -
  9. try to guess (imap.example.com, smtp.example.com etc.)
  10. -
-

We may in the future add DNS SRV records as supported mechanism in the future, but we currently do not.

-

How to add support for your domain

-

Classification

-

If you are a big ISP (> 100,000 users) providing email addresses solely under a few domains like "example.com" and "example.de", you may either submit the configuration to the ISPDB or set up a configuration server.
-
- If you support email aliases and the user's login name is not part of the email address (for example, users may have "hero@example.com" as email address, but the IMAP/POP/SMTP login name is neither "hero" nor "hero@example.com", but "u67578"), you need to set up a configuration server, which does the email address -> login name lookup.
-
- If you host customer domains, i.e. you are "hoster.com", but your customers have "fred@flintstone.com" and "louis@kent.com" as domains, with only a few users per domain, you need to set up a configuration server (or rely on DNS MX).
-
- If you are a small company installing Thunderbird on your employees' desktops, you can place a configuration file in the Thunderbird installation folder.

-

ISPDB

-

Database URL is <https://live.mozillamessaging.com/autoconfig/v1.1/>, append domain name, e.g. <https://live.mozillamessaging.com/autoconfig/v1.1/freenet.de>.
-
- Current process: File a bug in Bugzilla, Product "Webtools", Component "ISPDB Database Entries", with a configuration file that matches the requirements described below. Request review from bwinton, gozer or ben.bucksch.
-
- Future: add the configuration to the ISPDB server app.

-

Configuration server at ISP

-

Given the email address "fred@example.com", Thunderbird first checks <http://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=fred@example.com> and then <http://example.com/.well-known/autoconfig/mail/config-v1.1.xml>.

-

Small company

-

If you are a small company, you can put the XML configuration file on your web server, at URL <http://example.com/.well-known/autoconfig/mail/config-v1.1.xml>. (This is not yet finalized and subject to change.)

-

Domain hoster

-

If you are an ISP that hosts domains for your customers - for example, you are hoster.com and your customer registers fancy.com or example.com, and your servers accept and serve the mail for example.com -, you should set up an autoconfig server.

-

DNS

-

For each customer domain, you add a DNS record (in addition to the existing MX, A www etc. DNS records):
- autoconfig IN A 10.2.3.4
- or
- autoconfig IN CNAME autoconfig.hoster.com.
- ... where 10.2.3.4 and autoconfig.hoster.com are IP addresses / hostnames you own.
- This allows Thunderbird to find you as hoster.

-

To make the Version without an autoconfig DNS Entry work you have to make sure that example.com points to the Webserver you will place the config-v1.1.xml on.

-

Example: example.com A 10.2.3.4

-

Web server

-

You set up a web server bound to a physical IP address. This may be on the same machine as other web servers, but the web server must be configured to the content to any requested domain.
-
- You must use an virtual host that match all autoconfig.* domains of your customers. In Apache terms, you can use a "ip-based virtual host". In the Apache configuration files, that means something like: Listen 10.2.3.4:80 (of course, you use a public IP address that you own)

-
<VirtualHost 10.2.3.4:80> #Must be the first and only virtual host with this ip!
-    DocumentRoot /var/www/autoconfig/
-    ServerName autoconfig.hoster.com
-    <Directory /var/www/autoconfig>
-	Order allow,deny
-	allow from all
-    </Directory>
-</VirtualHost>
-

Place the configuration file at the URL /mail/config-v1.1.xml on that host.

-

All config files must be served as Content-Type: text/xml (or application/xml), otherwise the file will be ignored. Also, they must use charset UTF-8 (esp. if there are any non-ASCII-characters).

-

If you like to use name-based virtual hosts. You probably don't want to setup the autoconfig subdomain for every domain of your customers.
- You can add a Rewriterule in the default virtual host (on debian /etc/apache2/sites-enabled/000-default)  to match all autoconfig.* subdomains:

-
<VirtualHost *:80> #Must be the first Virtual host
-	ServerAdmin webmaster@hoster.com
-	ServerName www
-	DocumentRoot /var/www
-	RewriteEngine On
-	RewriteCond %{HTTP_HOST} ^autoconfig\. [NC]
-	RewriteRule ^/(.*)	http://autoconfig.hoster.com/$1 [L,R=301,NE]
-        #...
-</VirtualHost>
-<VirtualHost *:80>
-    DocumentRoot /var/www/autoconfig/
-    ServerName autoconfig.hoster.com
-    <Directory /var/www/autoconfig>
- 	Order allow,deny
-	allow from all
-    </Directory>
-</VirtualHost>
-
-

 

-

 

-

Configuration file

-

This is described at How to create a configuration file and defined on the sub-pages.

-

{{ languages( { "ja": "ja/Thunderbird/Autoconfiguration" } ) }}

diff --git a/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/index.html b/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/index.html deleted file mode 100644 index 0873a7d1f2..0000000000 --- a/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: Deploying Thunderbird in the Enterprise -slug: Mozilla/Thunderbird/Deploying_Thunderbird_in_the_Enterprise -tags: - - Corporate - - Corporation - - NeedsTranslation - - Thunderbird 3 - - TopicStub - - enterprise - - thunderbird -translation_of: Mozilla/Thunderbird/Deploying_Thunderbird_in_the_Enterprise ---- -

These documents and references are provided to help those involved in deploying Thunderbird in large institutions. 

-

The documents are maintained primarily by volunteers and are a work in progress.  In other words, there are improvements and additions still be made, and you can help make those changes.  If you have skills, experience or information that will make these items better in small ways or large, please edit the documents directly, after creating an MDN account or registering with mozilla wiki if you don't already have an account.  You may also comment on the Talk page to note items that may be missing or inaccurate.

-

References

- -

Related information

- -

{{ languages( { "ja": "ja/Thunderbird/Deploying_Thunderbird_in_the_Enterprise" } ) }}

diff --git a/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/upgrading_thunderbird_in_the_enterprise/index.html b/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/upgrading_thunderbird_in_the_enterprise/index.html deleted file mode 100644 index b067ae50fd..0000000000 --- a/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/upgrading_thunderbird_in_the_enterprise/index.html +++ /dev/null @@ -1,260 +0,0 @@ ---- -title: 於企業內升級 Thunderbird -slug: >- - Mozilla/Thunderbird/Deploying_Thunderbird_in_the_Enterprise/Upgrading_Thunderbird_in_the_Enterprise -translation_of: >- - Mozilla/Thunderbird/Deploying_Thunderbird_in_the_Enterprise/Upgrading_Thunderbird_in_the_Enterprise ---- -
{{ draft }}
- -

這是一篇關於幫助大型組織使用 Thunderbird 升級到 3 版的升級手冊 (也可稱之為 "企業")。 這份初步草稿是從草稿作者知識庫摘要 auto-sync / offline settings (bug 562589) 與 Thunderbird 3 與管理者相關的搬遷問題 (bug 562589#c7) (如同 2010/05/06).

- -

背景

- -

此份搬遷手冊針對典型的企業環境做出一些假設:

- - - -

(The above requirements may not be compatible with the fact that the new global search (Gloda) is enabled by default on upgrade and IMAP folder automatic synchronization is enabled by default on upgrade. This is discussed further below.)

- -

企業環境通常需要執行大規模軟件升級,而不是為個人用戶升級軟件,此升級目標也許會是:

- - - -

相關資訊:

- - - -

遷移指南 (Thunderbird 2 升級到 Thunderbird 3.0)

- -

The major changes in Thunderbird 3.0 that are relevant to enterprise administrators include:

- - - -

For more detailed information about the changes between Thunderbird 2 and Thunderbird 3, see:

- - - -

As a general rule, administrators should deal with the process of upgrading Thunderbird and enabling new features separately. That is, they should try to keep the user setup as similar as possible between Thunderbird 2 and 3 and wait until the Thunderbird 3 upgrade is complete and stable before enabling Thunderbird 3 features.

- -

在遷移前,停用附加元件以進行安全升級

- -

Problems due to add-on are known. For example;

- - - -

To avoid such unwanted problems due to add-ons, next upgrade procedure is recommended for safe migration.

- -
    -
  1. Start Tb 2 with -safe-mode to make all add-ons disabled before upgrade.
  2. -
  3. Keep backup of profile directory before upgrade.
  4. -
  5. If possible, do uninstall of Thunderbird 2 and clean install of Thunderbird 3, instead of upgrade by software update by Thunderbird 2, for both safe migration and reducing of network traffic.
  6. -
- -

停用遷移幫手

- -

Enterprise sites that perform mass upgrades generally want to prevent users from performing Thunderbird upgrades on their own. An upgrade dialogue in the Thunderbird Migration Assistant should be disabled.

- -
lockPref("mail.ui.show.migration.on.upgrade",false);
- -

停用全域 (全域搜索與索引) 以避免遷移後的索引

- -

Initail purpose of Gloda was solution of of problem like Bug 383895 (slowness in body text search of local mail data). With enhancements and many improvements by Thuderbird 3 on auto-sync of IMAP folder, Gloda can be used also for IMAP folders very easily. So, gloda is very useful for everyday usage even for IMAP users: It can search messages very fast, much faster than an IMAP server can, and so notably increase productivity. Also, it will in the future have increased functionality in other areas.

- -

However, the new Thunderbird 3 search and index functionality initially impacts performance. (The indexer runs when Thunderbird 3 is first started and will continue to work until all the user's email is indexed. The more messages a user has, the longer the indexer will run.) Also, it uses diskspace on the client (about 1/2 (?) of mailbox size), which is a problem for roaming profiles.

- -

Gloda can be enabled by only single action after upgrade - check an option at Tools/Options/Advanced/General tab. So, to minimize user support workload after migration, we  recommend you to disable automatic enabling of Gloda durng migration by Thunderbird 3.

- -
怎麼會? 可能嗎? 需要加強?
- -

停用自動同步,保持每個資料夾 "離線使用" 設定,以避免遷移後每個巨大的 IMAP 資料夾下載所有郵件

- -

Auto-sync of IMAP folders is enabled by default for all IMAP accounts. The per folder "offline use" setting of all IMAP folders is changed to "offline use=On" when Thunderbird 3 is launched the first time. To keep same settings as Thunderbird 2, disable the auto-sync and offline-use settings upon upgrade.

- -

完全停用自動同步 (auto-sync):

- -
lockPref("mail.server.default.autosync_offline_stores", false);
-lockPref("mail.server." + serverFromAccount + ".autosync_offline_stores", false);
-
- -

停用每個資料夾 "離線使用 (offline use)" 設定在遷移時設定變更 (Tb 3.0.5 到 Tb 3.1rc1):

- -
lockPref("mail.server." + serverFromAccount + ".offline_download", false);
-
- -

To disable per folder "offline use" setting change upon migration (Tb 3.1rc2 or later):

- -
lockPref("mailnews.ui.show.migration.on.upgrade",false);
-
- -

注意:

- - - -

在遷移後,如何啟用自動同步

- -

Account Settings/Synchronization & Disk Space

- - - -

Current behavior of UI for auto-sync setting.

- - - -

Note: There is a request for a design change in bug 537943.

- -

Gloda and auto-sync/offline-use are possibly independent, although relevant.

- - - -

修改資料夾面板檢視從 "聰明資料夾 " 為 "所有資料夾"

- -

By default, Thunderbird 3 displays "Smart Folders" in the folder pane. (Smart Folders combine the messages in similarly named folders in multiple accounts, for example grouping Inbox messages from all accounts into a single Inbox on the Smart Folder pane.) If you want to preserve the default Thunderbird 2 behavior of showing "All Folders", advice users to select View | Folders | All from the menu.

- -

Can "forcing Smart Folders view" upon migration be stopped? How? Is it possible? Enhancement is needed?

- -

Note: "Smart Folders" is renamed to "Unified Folders" by Tb 3.1, and Tb 3.1 won't force it upon migration from Tb2 any more.

- -

注意事項

- -

由自動配置 (autoconfig) 帳戶定義

- -

When new accounts are created, the new "autoconfig" functionality is automatically invoked. Unless users have the correct account definition parameters, it may be confusing for them to configure their own accounts (if this is permitted).

- -

IMAP 資料夾檔案的位置

- -

By default, the IMAP folder file is located in each user's profile directory. If the user is storing a lot of messages for off-line access, this can result in too much data for a roaming profile. Regardless of whether or not there is a roaming profile, there may be if the profile is located on a network resource or if Microsoft Window's Offline File (CSC) is used for the offline storage file.

- -

If that is the case, you have two options:

- -

If the Gloda search and index is mandatory for IMAP mail data:

- -
    -
  1. Locate mail directory for IMAP account at location with which remote/network access won't happen(e.g. "Local Settings" of MS Win)
  2. -
  3. Enable auto-sync, and set offline use=on of IMAP folders.
  4. -
  5. Accept download of all mails to any PC which uses the IMAP account.
  6. -
  7. Accept per PC thread pane column setting of the IMAP accout. -
      -
    • -
      -
       
      -
      - -
      -
      As thread pane column setting is currently saved in .msf file, and as you selected folder location other than profile directory, data in .msf can not be shared among PCs, even when you use Roaming Profile.
      -
      -
    • -
    -
  8. -
- -

When Gloda is not needed for IMAP mail data:

- -
    -
  1. Locate IMAP folder file at any place you want.
  2. -
  3. Disable auto-sync, and/or set offline use=off of all IMAP folders. -
      -
    • -
      -
       
      -
      - -
      -
      As new feature of "Disk Cache for mail in IMAP folder of offline-use=off" is added to Tb 3, mail data of viewed mail is held in far larger Disk Cache than very small memory cache of Thunderbird 2. So, frequency of problem like "repeatedly downloaded big attachment data" is reduced very much compared to Thunderbird 2.
      -
      -
    • -
    -
  4. -
- -

As Gloda is first solution of problem of Bug 383895 (slowness in body text search of local mail data), and as many IMAP servers have excellent body text search functionality, consider utilizing of online search first for IMAP mail data. If online search is usable, enabling of auto-sync/offline-use merely for Gloda can be avoided.

- -

線上搜尋 IMAP 資料夾

- -

There is known with regards to online search (documented in Bug 546925 "Run search on server" of Edit/Find/Search Messages doesn't work). For now, users must use Quick Search or Virtual Folder (Saved Search folder) for online searches.

- -

搜尋、自動同步、離線使用與 "聰明資料夾"

- -

If IMAP folder of offline-use=off, full text search by Gloda won't work because of offline-use=off.

- -

And, if not all mails of IMAP folder of offline-use=on is downloaded into local offline-store file because of your setting for offline-store file size limitation, Gloda can't find not-downloaded mails of the IMAP folder.

- -

And, as "Smart Folder" is internally Virtual Folder(Saved Search Folder), a "Smart Folder" can be Virtual Folder with multiple search target folders in mixture of local mail folders, IMAP folders of offline-use=on(all mails are sync'ed), IMAP folders of offline-use=on(not all mails are sync'ed), and IMAP folders of offline-use=off.

- -

Never open bug at bugzilla.mozilla.org for "Search can't find my mail!" without sufficient checking of "what mail at what kind of folder is not hit by what kind of search at where", please.

- -

遷移手冊 (Thunderbird 2 到 Thunderbird 3.1)

- -

(content needed)

- -

遷移手冊 (Thunderbird 3.0 到 Thunderbird 3.1)

- -

(content needed)

diff --git a/files/zh-tw/mozilla/thunderbird/index.html b/files/zh-tw/mozilla/thunderbird/index.html deleted file mode 100644 index f0a48a2be0..0000000000 --- a/files/zh-tw/mozilla/thunderbird/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Thunderbird -slug: Mozilla/Thunderbird -tags: - - NeedsTranslation - - TopicStub - - thunderbird -translation_of: Mozilla/Thunderbird ---- -

Thunderbird is Mozilla's mail/messaging application. These pages document Thunderbird and also provide links to documentation about the MailNews backend which is also used in other projects such as Eudora/Penelope, Seamonkey, Correo, etc.

-

Thunderbird is Firefox's kid sibling, and is built on the same technical platform as the web browser. In development for many years, and currently one of the most popular open source email clients, it is used by millions of people around the world to bring together all their email accounts, newsgroup and feed reading in a familiar high-productivity environment.  (From early 2007 to early 2011 Thunderbird was developed by Mozilla Messaging, a subsidiary that was owned by Mozilla.)

- - - - - - - -
-

Documentation

-
-
- Building Thunderbird
-
- Information about building Thunderbird with the comm-central repository. There's also information about how comm-central works, how the review process works and how to use the Mozilla symbol server to help with debugging.
-
- MailNews Protocols
-
- Rough documentation about mail protocols..
-
- Database views
-
- Backend information about {{ Interface("nsIMsgDBView") }} and related interfaces..
-
- Thunderbird API documentation
-
- Thunderbird API documentation
-
- Extension documentation
-
- Tutorials and tips for building Thunderbird extensions
-
- Automated Testing
-
- Details of Thunderbird's automated testing facilities
-
- Thunderbird in the Enterprise
-
- Help with deploying Thunderbird in large organizations
-
-

View All...

-
-

Community

- -

Tools

- - - -
-

 

diff --git a/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/index.html b/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/index.html deleted file mode 100644 index 4ce42f41a7..0000000000 --- a/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: Thunderbird extensions -slug: Mozilla/Thunderbird/Thunderbird_extensions -tags: - - Add-ons - - Extensions - - NeedsTranslation - - TopicStub - - thunderbird -translation_of: Mozilla/Thunderbird/Thunderbird_extensions ---- -
Building a Thunderbird extension
-Step-by-step explanation on how to build an extension for Thunderbird.
- -
-

{{AddonSidebar}}

-The following documentation provides help for creating extensions for Mozilla's Thunderbird email client. Although there are many similarities with Firefox extensions there are also some differences that may confound the starting developer.
- -

-Please help! You can add a how-to (a question or an answer or a code snippet), summarize and link to a relevant newsgroup discussion, or create a tutorial. Need help? Contact jenzed.
- - - - - - - - -
-

Documentation

- -

Getting started with Thunderbird

- -

A brave, young developer wants to develop an add-on for Thunderbird. Here's a few links to help them through this journey.

- -
    -
  • Start by reading the tutorial and learn how to build a Thunderbird extension (Outdated, still talks about overlays and the add-on builder is no longer available but the tutorial has not been updated.)
  • -
  • Read about the main windows so that you know what one means when they say « thread pane », « preview pane », and « folder pane ».
  • - -
  • Want to do some real stuff? See how to inspect a message (demo add-on included!)
  • -
  • Play with our other demo add-on that exercises some more advanced Thunderbird-specific features
  • -
  • Want to do even more stuff? Don't reinvent the wheel: steal functions from the thunderbird-stdlib project (doc here). Functions for dealing with messages (delete them, archive them, change their tags, etc.) are included.
  • -
  • Haven't found what you're looking for? Read the Thunderbird how-tos; they contain a lot of recipes for things extensions want to do.
  • -
  • Still haven't managed to do what you wanted? See the list of all Thunderbird communication channels so that you know where to ask when you get stuck :-).
  • -
  • Feeling really brave? Read the source using a fancy interface; you can often find tests that demonstrate how to do what you're trying to achieve.
  • -
- -

The Gloda database

- -

Thunderbird has a subsystem called Gloda. Gloda stands for « Global Database », and creates Thunderbird-wide relations between objects. Gloda provides concepts such as Conversations, Messages, Identities, Contacts. All these concepts are related together: a Conversation contains Messages which are linked to Identities (from field, to field) which are themselves part of a Contact: indeed, a contact has multiple identities.

- -

Typical use cases for Gloda: find all messages whose subject matches [search term], find all messages from [person], find all messages in the same thread as [a given message], find all messages involving [person], etc. etc.

- -

Gloda is extremely powerful and is used heavily by add-ons such as Thunderbird Conversations. Learn more about Gloda:

- - - - - -

Some of these links may be wildly out of date, but they still provide valuable information on the codebase.

- - - - - - -
-

Community

- - - -

{{ DiscussionList("dev-extensions", "mozilla.dev.extensions") }}

- - - -

Tools

- - - -

... more tools ...

- -

View All...

- - - -
-
XUL, JavaScript, XPCOM, Themes, Developing Mozilla
-
-
- -

Categories

- -

{{ languages( { "ja": "ja/Extensions/Thunderbird" } ) }}

diff --git a/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/theme_packaging/index.html b/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/theme_packaging/index.html deleted file mode 100644 index 9aeb61d94f..0000000000 --- a/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/theme_packaging/index.html +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: 包裝佈景主題 -slug: Mozilla/Thunderbird/Thunderbird_extensions/Theme_Packaging -tags: - - Toolkit API - - 佈景主題 -translation_of: Mozilla/Thunderbird/Thunderbird_extensions/Theme_Packaging ---- -

本文描述包裝 Firefox 及 Thunderbird 之佈景主題的方法。

-

需求

-

製作 Firefox 或 Thunderbird 的佈景主題需要懂層疊樣式表(CSS)、會一點 XBL、還要有美術繪圖設計等能力(不過也不見得一定要)。本文只說明包裝佈景主題以便顯示於 Firefox 佈景主題視窗的方法。

-

佈景主題檔案架構

-

Firefox 及 Thunderbird 的佈景主題是一個將資料以下列結構包裝的 JAR 檔案:

-
theme.jar:
-  install.rdf
-  contents.rdf
-  preview.png
-  icon.png
-  browser/一堆檔案
-  global/一堆檔案
-  mozapps/一堆檔案
-  communicator/一堆檔案
-  ...
-
-
- -

install.rdf

-

install.rdf 清單長得像這樣:

-
<?xml version="1.0"?>
-
- <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-   <Description about="urn:mozilla:install-manifest">
-     <em:type>4</em:type>
-     ''其他特性''
-   </Description>
- </RDF>
-
-

必備特性

-

install.rdf 檔中必須含有下列特性:

- -

詳細資訊請見 install.rdf 參考

-

選用特性

- -

如果你想將佈景主題送上 addons.mozilla.org,則 updateURL 就是必備的特性。

-

範例

-
<?xml version="1.0"?>
-
- <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-   <Description about="urn:mozilla:install-manifest">
-     <em:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id>
-     <em:version>1.0</em:version>
-     <em:type>4</em:type>
-
-     <!-- 擴充套件的適用軟體,含最低需求及上限版本資訊。 -->
-     <em:targetApplication>
-       <Description>
-         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-         <em:minVersion>0.8</em:minVersion>
-         <em:maxVersion>0.9</em:maxVersion>
-       </Description>
-     </em:targetApplication>
-
-     <!-- 使用者會看到的資訊 -->
-     <em:name>New Theme 1</em:name>
-     <em:description>A test theme for Firefox</em:description>
-     <em:creator>Ben Goodger</em:creator>
-     <em:contributor>John Doe</em:contributor>
-     <em:homepageURL>http://www.bengoodger.com/</em:homepageURL>
-
-     <!-- 佈景主題管理員內部所用的識別名稱 -->
-     <em:internalName>newtheme1</em:internalName>
-   </Description>
- </RDF>
-
-

以下是幾個 targetApplication 特性常用的應用程式 GUID:

-
Firefox      {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-Thunderbird  {3550f703-e582-4d05-9a08-453d09bdfdc6}
-Sunbird      {718e30fb-e89b-41dd-9da7-e25a45638b28}
-
-

Toolkit API 官方參考文件

-
- {{page("/zh-TW/docs/Toolkit_API/Official_References")}}
-
-  
diff --git a/files/zh-tw/prism/index.html b/files/zh-tw/prism/index.html deleted file mode 100644 index 30d3f7d7db..0000000000 --- a/files/zh-tw/prism/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: Prism -slug: Prism -tags: - - prism -translation_of: Archive/Mozilla/Prism ---- -

Prism 是以 XULRunner 為基礎的極簡化瀏覽器,可以讓網際應用程式不必透過一般瀏覽器介面就能直接執行。Prism 的主要概念是「特定網站專用瀏覽器」,就好比為某個網際應用程式量身訂做的瀏覽器一樣,無需選單、工具列及其他傳統瀏覽器的元件。這類專屬瀏覽器能為其網際應用程式提供與作業系統更緊密的整合,所以能同時擁有一般單機程式與網際應用程式雙方面的好處。

-

好處

- -

架構概觀

-

Prism 是個 XULRunner 軟體,其中除了 XULRunner 內建的瀏覽器引擎外還包括:

- - - - - - - - -
-

文件

-
-
- 常見問題集
-
-  
-
- 軟體包
-
- 將網際應用程式的設定、圖示及其他專屬自訂檔「包」在 ZIP 壓縮檔內方便使用。
-
- 設定
-
- A webapp bundle should contain a webapp.ini configuration file. The configuration file is a simple, INI-style text file that specifies some parameters about a web application.
-
- 樣式
-
- One of Prism's goals is to make web applications feel more like desktop applications. One way to make the illusion seem more real is to use styling (or theming). Prism supports a simple styling system that allows the user to add CSS files to the webapp bundle.
-
- 主視窗
-
- Prism provides a simple, scaled down browser window for running web applications. Using configuration files and webapp scripting, the host window can be modified.
-
- 安裝程式
-
- 安裝 Prism。
-
-

全部列出…

-
-

社群

- -

其他東西

- -

一起搞吧!

- -

相關主題

-
-
- XULRunner
-
-
-

 

-

 

-
-  
-

{{ languages( { "en": "en/Prism", "fr": "fr/Prism" } ) }}

diff --git "a/files/zh-tw/prism/\344\270\273\350\246\226\347\252\227/index.html" "b/files/zh-tw/prism/\344\270\273\350\246\226\347\252\227/index.html" deleted file mode 100644 index d8e06c3a60..0000000000 --- "a/files/zh-tw/prism/\344\270\273\350\246\226\347\252\227/index.html" +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: 主視窗 -slug: Prism/主視窗 -tags: - - prism -translation_of: Archive/Mozilla/Prism/HostWindow ---- -

Prism 執行網際應用程式時,是以非常簡單的視窗呈現。視窗上仍有一些介面組件(如圖所示),而Prism 可以設定某些介面組件的顯示與否。

-

Image:webrunner-ui.gif

- -

註:

- -

{{ languages( { "en": "en/Prism/HostWindow" } ) }}

diff --git "a/files/zh-tw/prism/\345\256\211\350\243\235\347\250\213\345\274\217/index.html" "b/files/zh-tw/prism/\345\256\211\350\243\235\347\250\213\345\274\217/index.html" deleted file mode 100644 index d3ab5e831a..0000000000 --- "a/files/zh-tw/prism/\345\256\211\350\243\235\347\250\213\345\274\217/index.html" +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: 安裝程式 -slug: Prism/安裝程式 -tags: - - prism -translation_of: Archive/Mozilla/Prism/Installer ---- -

安裝程式需將 *.webapp 檔的關聯程式設定為 Prism,這麼一來雙點 *.webapp 檔時才會自動用 Prism 開啟網際應用程式。 -

目前 Windows 跟 Mac 的安裝程式都可以自動設定關聯。 -

這麼一來還有另一個好處:當點選網頁上的 .webapp 檔時也能自動以 Prism 開啟!不過在 Firefox 中這招只在伺服器將 .webapp 檔做為 application/x-webrunner 送出時才有用,而 IE 倒不會檢查這點。(參考這個例子) -

{{ languages( { "en": "en/Prism/Installer" } ) }} diff --git a/files/zh-tw/profile_manager/index.html b/files/zh-tw/profile_manager/index.html deleted file mode 100644 index a1f40c3a8d..0000000000 --- a/files/zh-tw/profile_manager/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: Profile Manager -slug: Profile_Manager -translation_of: Mozilla/Profile_Manager ---- -

Firefox and other XULRunner applications store user settings and data in special folders, called profiles.    Firefox provides a built-in applet to manage these profiles, but it will eventually be going away (see bug 214675), so a new standalone Profile Manager application has been created, which works with any XULRunner application, and has many features not found in Firefox's built-in version.

-

Downloading

-

Binaries

-

You can download Profile Manager builds from ftp://ftp.mozilla.org/pub/mozilla.org/utilities/profilemanager/1.0/.  There is no installer; just extract the files from the archive. 

-

System requirements:

- -

Source code

-

You can download the source as well:

-

hg clone http://hg.mozilla.org/automation/profilemanager/

-

Instructions for building can be found in BUILD.txt.

-

Reporting Bugs

-

Profile Manager bugs should be reported in Bugzilla, under Testing -> ProfileManager.

-

Starting Profile Manager

-

To start Profile Manager, just launch profilemanager.exe (on Windows) or profilemanager-bin (on Linux and Mac).  By default, Profile Manager will manage Firefox profiles, but you can also use it to work with profiles of other xulrunner apps, like Thunderbird or SeaMonkey.  To use Profile Manager with an application other than Firefox, you need to launch it using the application's name as an argument, for example:

-

-

profilemanager-bin seamonkey

-

Profiles and application versions

-

Profile Manager manages two different lists: one of user profiles, and the other of application versions that can be used with the profiles.  By default, this means it tracks a list of Firefox applications that are installed on your system, and a list of profiles for use by Firefox.

-

-

An individual profile can be linked to a specific installation of Firefox, so that version of Firefox will be launched when that profile is selected.  For example, ProfileA might be linked with a copy of Firefox 3.6.10, while ProfileB might be linked with a copy of Firefox 3.5.3.

-

When launched, Profile Manager will look in some default locations for installed versions of Firefox (or other application you're using Profile Manager with).  Additionally, you can manually add Firefox versions by clicking the "Manage Firefox versions..." button:

-

 

-

Each Firefox version in the list has the following properties:  path, version, and default.  The default property indicates that this version of Firefox will be used with profiles that don't have a specific application version associated with them.

-

 

-

Creating a profile

-

To create a new profile, just click the New button from Profile Manager's toolbar.  A dialog will appear that allows you to specify the profile's name, and optionally the profile's path, and the version of Firefox (or other application) that will be used with this profile:

-

-

-

 

-

Launching Firefox with a profile

-

To launch Firefox with a specific profile, select the profile in the main window, and hit the "Start Firefox" button:  Firefox will be launched with that profile, and Profile Manager will terminate.  The version of Firefox which will be launched is indicated in the "Firefox version" dropdown in the Launch Options box:

-

-

-

There are several additional launch options available for Firefox.  These cause Firefox to be launched with various command-line arguments.  See Command Line Options for a description of these.

- - - - - - - - - - - - - - - - - - - - - - - - - -
Launch OptionCommand Line Argument
Run Firefox in offline mode-offline
Run Firefox in safe mode-safe-mode
Start Firefox with a console-console
Start new instance-no-remote
-

Note: It isn't possible to start a second instance of Firefox without passing it the -no-remote command line argument.  For this reason, if you attempt to launch Firefox using Profile Manager, and it detects that another instance of Firefox is already running, it will automatically add the -no-remote argument for you, regardless of whether this launch option was checked.

-

 

-

Locked profiles

-

Some profiles may be shown as locked in the main window.   Such profiles are currently being used by an instance of Firefox.  If you attempt to perform any operation on a locked profile, you'll get a warning; if you choose to continue despite the warning, you may encounter errors or corrupt a profile.

-

-

It's strongly recommended to avoid operations on locked profiles.  If you need to do something with a locked profile, close the instance of Firefox which is using the profile first.

-

 

-

Backing up and restoring profiles

-

Profile Manager offers two different mechanisms for backing up and restoring profiles.

-

-

Backup folder

-

Profile Manager has a local backup folder where it can manage profile backups.  This is the easiest way to backup and restore profiles. 

-

To backup a profile:  select the profile you want to backup, and choose "backup to->backup folder" from the toolbar's Backup menu.  The profile will be backed up, and the backup will appear under the backups column in the main display:

-

-

To restore a profile:  select the backup in the main display, open the context menu, and choose "restore".  When you restore a profile, the backup is retained, so you can restore from the same backup at a later date.

-

To delete a backup:  select the backup in the main display, open the context menu, and choose "delete".

-

Profile archives

-

Profile Manager can also backup to and restore from .zip archives.  Profile Manager does not track these backups in the UI, but using profile archives is an easy way to move profiles between machines.

-

To backup a profile to an archive:  select the profile you want to backup, and choose "backup to->archive" from the toolbar's backup menu.  You'll be prompted for a name and location for the archive.

-

To create a profile from a profile archive:  Select "restore from->archive" from the toolbar's backup menu.  You'll be prompted for the location of the archive, and then for the name of the profile you'd like to create from the archive.

-

 

-

Other Operations

-

Context-clicking any profile in the profile list will cause a popup menu to appear with the following commands:

- -

 

-

Future Enhancements

- -

 

-

{{ languages( {"es" : "es/Administrador_de_perfiles" ,"zh-cn" : "zh-cn/Profile_Manager" } ) }}

diff --git a/files/zh-tw/sandbox/index.html b/files/zh-tw/sandbox/index.html deleted file mode 100644 index ce4d515992..0000000000 --- a/files/zh-tw/sandbox/index.html +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: Sandbox 沙盒 -slug: Sandbox -translation_of: Sandbox ---- -

This is a page 這是一張紙

- - - -

Test

- -

如何插入程式碼區塊,並即時預覽:Toolbar 第三行,點擊「插入程式碼範例模板」按鈕

- -

HTML

- -
<p>hello sandbox</p>
- -

CSS

- -
p {
-  color: blue;
-}
- -

JavaScript

- -
var p = document.querySelector('p');
-p.addEventListener('mouseover', function(e) {
-  p.style.color = 'green';
-})
-p.addEventListener('mouseout', function(e) {
-  p.style.color = 'blue';
-})
-
-
- -

結果

- -

{{EmbedLiveSample('Test')}}

- - - -

其他

- -

CSS Content

- -
@ Compteur de style fisheye {
-  système: cyclique;
-  symboles: ◉;
-
- -
<h1>CSS font-family</h1>
-<p class="serif">This is a paragraph, shown in the Times New Roman font.</p>
-<p class="sansserif">This is a paragraph, shown in the Arial font.</p>
- -

-}
-
-.liste {
-    list-style: fisheye, cercle;
-}
- -

Hello World

- -

HTML

- -
<p>Hello World</p>
- -

{{EmbedLiveSample ( 'Linux is life')}}

- -

Linux logo

- -

logo couleur MDN (bleu)

- -

Des trucs

- -
-

Une note 

- -
-

Un avertissement dans une note

- -
-

Une note dans un avertissement dans une note

- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-

une autre note

- -
-

Une note dans une note

-
- -

This is an example of how to use the MDN!

-
- -

π×1=1×π=2π÷π=π\ Pi \ times 1 = 1 \ times \ pi = 2 \ pi \ div \ pi = \ pi

- -

ππππππ\ Pi \ frac {\ pi} {\ pi} \ frac {\ frac {\ pi} {\ pi}} {\ pi}

- -

ππππππ\ Pi \ frac {\ pi} {\ pi} \ frac {\ frac {\ pi} {\ pi}} {\ pi}

- -

limjets13e3/XX2X\ Int \ limits_ {1} ^ {3} \ frac {e ^ 3 / x} {x ^ 2} \, dx

- -

ln(x) dx = x[ln(x) - 1]l\ Int \ limits_ {1} ^ {3} \ frac {e ^ 3 / x} {x ^ 2} \, d+x

- -

abcdefghijklmnopqrstuvwxyz\alphabet

- -

πest un nombre irrationnel, et cela est le rapport entre la circonférence d'un cercle à son diamètre. Il est communément approchée comme 3,14159.\ pifacts {3}

- -

contenu

- -

Test live sample

- -

HTML Content

- -
<p>Hello World</p>
- -

Result

- -

{{ EmbedLiveSample('Test live sample') }}

- -

- -

Focus on a text field

- -

HTML Content

- -
<input type="text" id="myTextField" value="Text field.">
-<p></p>
-<button type="button" onclick="focusMethod()">Click me to focus on the text field!</button> 
- -

CSS Content

- -
/* Sample CSS Content */
- -

JavaScript Content

- -
focusMethod = function getFocus() {
-  document.getElementById("myTextField").focus();
-} 
- -

Result

- -

{{ EmbedLiveSample('Focus_on_a_text_field') }}

- -

Focus on a button

- -

HTML Content

- -
<button type="button" id="myButton">Click Me!</button>
-<p></p>
-<button type="button" onclick="focusMethod()">Click me to focus on the button!</button> 
- -

CSS Content

- -
Sample CSS Content
- -

JavaScript Content

- -
focusMethod = function getFocus() {
-  document.getElementById("myButton").focus();
-} 
- -

Result

- -

{{ EmbedLiveSample('Focus_on_a_button') }}

diff --git a/files/zh-tw/tools/scratchpad/index.html b/files/zh-tw/tools/scratchpad/index.html deleted file mode 100644 index 880b0c13ee..0000000000 --- a/files/zh-tw/tools/scratchpad/index.html +++ /dev/null @@ -1,109 +0,0 @@ ---- -title: 程式碼速記本 -slug: Tools/Scratchpad -translation_of: Archive/Tools/Scratchpad ---- -

程式碼速記本(Scratchpad)提供使用 JavaScript 程式碼實驗的環境。您可以編寫,運行和檢查的程式碼與網頁互動的結果。

- -

不同於網頁主控台,這是專為在同一時間解釋的一行程式碼,便簽讓您編輯較大的 JavaScript 程式碼塊,然後根據您希望如何使用輸出以各種方式執行。

- -

{{EmbedYouTube("Pt7DZACyClM")}}

- -

用法

- -

打開程式碼速記本

- -

要打開「程式碼速記本」窗口的話有很多辦法:

- - - -

這將打開一個程式碼速記本窗口。

- -

在工具箱開啟程式碼速記本

- -
Firefox 47 引入。
- -

From Firefox 47, you can open Scratchpad inside the Toolbox. First you need to check "Scratchpad" in the "Default Firefox Developer Tools" section of the Settings page.

- -

Now Scratchpad will be available in the Toolbox, alongside other tools like the Page Inspector and the Web Console. This is especially useful in split Console mode: you can use Scratchpad for a persistent, multiline editor, and the Console to interact with the page.

- -

編輯

- -

程式碼速記本窗口看起來像這樣(在 macOS 選單列在螢幕的頂部):

- -

便簽本的屏幕截圖

- -

檔案選單提供選項來儲存和載入JavaScript程式碼片段,因此,如果你喜歡,你可以在以後重用程式碼。

- -

程式碼補全

- -

程式碼速記本整合了ternjs ( javascript程式碼分析引擎 ),並使用該提供自動補全提示與包含在當前的符號資訊的視窗。要列出自動補全提示,按 Ctrl+Space

- -

例如,嘗試輸入d,然後按 Ctrl+Space 。你會看到自動補全的視窗盒,如下圖:

- -

提示左邊的每個圖標為目前提示的類型,目前高亮的提示會自動彈出更多資訊。使用來循環高亮的提示,並使用EnterTab 來選擇目前高亮的提示。

- -

內嵌說明

- -

如果想看到內嵌說明視窗,可以在將滑鼠指標(cursor)0移到標識符的位置,並按下Ctrl + Shift + Space。例如:如果你先輸入document.addEventListener,然後再按下Ctrl + Shift + Space,你將會看到一個彈出視窗,顯示該函數的語法和使用說明。

- -

在彈出視窗中的「[文件]」連結,點擊後,可直接連結到MDN對應符號的說明文件網頁。

- -

執行

- -

一旦你寫完你的代碼,選擇要運行的程式碼。如果不選擇任何內容,視窗中的所有程式碼將被執行。然後透過「執行」選單或右鍵選單,來選擇你想要的執行方式。程式碼在當前的分頁中執行。任何宣告在函式(function)之外的變數將被加入到當前分頁的全域物件。

- -

選單中有四個執行選項可以選擇

- -

執行

- -

當你選取「執行」選項時, 被選取的程式碼將會被執行. 你會將此選項用於執行一個函式或一段操作頁面內容的程式碼,而不需要看到執行後的輸出。

- -

檢測

- -

「檢測」選項執行程式碼的方法就像執行選項; 然而,程式碼返回後,object inspector會打開讓你檢查返回值。

- -

例如,如果你輸入代碼:

- -
window
-
- -

然後選擇「檢測」,object Inspector 看起來是這樣的:

- -

在便簽中檢查對象

- -

顯示

- -

「顯示」選項執行所選取的程式碼,然後直接將結果插入到你的程式碼速記本編輯器視窗中,作為一個註解,所以你可以使用它作為一個REPL

- -

重新載入並執行

- -

重新載入和執行選項僅在執行選單中。它首先重新載入頁面,然後執行該程式碼時,頁面上的「load」事件觸發。這適用於在剛開始的環境來執行程式碼。

- -

在瀏覽器環境中執行程式碼速記本

- -

你可以在瀏覽器環境運行程式碼速記本,而不是在特定網頁的環境中。如果您正在使用火狐本身或開發附加元件,這非常有用。要做到這一點,要勾選「啟用瀏覽器chrome與附加元件除錯工具箱」設定在開發者工具設置中。完成勾選後,執行程式碼速記本中,「環境」選單會有「瀏覽器」選項; 選擇「瀏覽器」選項後,你的範圍會是整個瀏覽器,而不僅僅是網頁的內容,此時,你將可以檢測一些全域變數來看:

- -
window
-/*
-[ChromeWindow]
-*/
-
-gBrowser
-/*
-[object XULElement]
-*/
- -

當程式碼速記本含有下列程式碼在第一行時,程式碼速記本會將執行環境設為整個瀏覽器
- // -sp-context: browser

- -

鍵盤快捷鍵

- -

{{ Page ("zh-TW/docs/tools/Keyboard_shortcuts", "scratchpad") }}

- -

源始碼編輯器的快捷鍵

- -

{{ Page ("zh-TW/docs/tools/Keyboard_shortcuts", "source-editor") }}

diff --git a/files/zh-tw/tools/webide/index.html b/files/zh-tw/tools/webide/index.html deleted file mode 100644 index 7a2968a1ac..0000000000 --- a/files/zh-tw/tools/webide/index.html +++ /dev/null @@ -1,290 +0,0 @@ ---- -title: WebIDE -slug: Tools/WebIDE -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/WebIDE ---- -
-

從 Firefox 34 開始均可使用 WebIDE。

- -

亦可於 Firefox 33 中變更偏好設定,以啟動 WebIDE。鍵入 about:config 並找到「devtools.webide.enabled 」,將之設定為「true」即可。

-
- -
-

WebIDE 現已取代「應用程式管理員 (App Manager)」,且其功能一如應用程式管理員,並可透過 Firefox OS 模擬器 (Firefox OS Simulator) 或實體 Firefox OS 裝置,進而建構、編輯、執行、除錯 Web App。

- -

不僅如此,WebIDE 亦可連接 Firefox 開發者工具與他款瀏覽器,包含 Firefox 行動版 (Firefox for Android)、Android 上的 Chrome、iOS 上的 Safari。可參閱遠端除錯頁面,以了解應如何連上特定瀏覽器。

-
- -

{{EmbedYouTube("2xmj4W8O3E4")}}

- -

你必須先在 WebIDE 中設定一個或多個執行環境 (Runtime)。Runtime 即是 App 的執行與除錯環境。不論是 Firefox OS 裝置透過 USB 連上桌機 (從 Firefox 39 或更高版本起,可透過 WiFi 連上桌機),或是桌面版 Firefox 上安裝 Firefox OS 模擬器,都可當做執行環境。

- -

接著就可建立 App 或啟動現有的 App。如果你要建立全新的 App,內建範本將提供你所需的資料目錄架構與最簡單的樣板;或有更完整的範本提供 Privileged App 所需要的 API。WebIDE 將以樹狀圖顯示 App 的檔案,讓你只要透過內建的編輯器即可修改並儲存檔案。當然,你也能選用自己習慣的編輯器開發 App,只用 WebIDE 除錯亦可。

- -

最後,你可將 App 安裝於執行環境之中並執行。也能透過常見的開發者工具,如檢測器 (Inspector)主控台 (Console)JavaScript 除錯器 (JavaScript Debigger) 等,檢查並修改 App。

- -

系統需求

- -

若要以 WebIDE 開發 App 並除錯,必須使用 Firefox 33 或更高版本。如果要在實際 Freifox OS 裝置上測試 App,則該款裝置需搭載 Firefox OS 1.2 或更高版本,並搭配 1 組 USB 連接線。

- -

如果要針對 Firefox OS 1.2 或更高版本開發 App,則限用 WebIDE 進行開發。

- -

啟動 WebIDE

- -

進入「網頁開發者」選單,點擊「WebIDE」即可將之啟動。亦可按下鍵盤的「Shift + F8」快捷鍵:左邊的「開啟應用程式 (Open App)」下拉式選單中,你可啟動現有的 App 或建立新的 App。右邊的「選擇 Runtime (Select Runtime)」下拉式選單中,你可選擇執行環境或設立新的執行環境。

- -

在選擇了執行環境並開啟 App 之後,才可以按中間的「Run」、「Stop」、「Debug」按鈕。

- -

設定執行環境

- -

「選擇 Runtime」選單內,共分為 3 種執行環境:

- - - -

第一次點開下拉式選單,你不會看見任何的執行環境:

- -

接下來會帶你新增執行環境。

- -

連結 Firefox OS 裝置

- -

在開始連結 Firefox OS 裝置之前,必須先完成下列設定:

- - - -
-

Linux 版本:

- - -
- -
-

Windows 版本:

- - -
- -

如果有其他 Android 裝置已連上你的電腦,請先中斷連線。再透過 USB 銜接裝置與電腦。則你的裝置應該會出現在「USB 裝置」之下:

- -

- -

如果還是沒看到你的裝置,請詳見〈疑難雜症〉頁面。

- -

新增模擬器

- -

Firefox OS 模擬器架構在 Firefox OS 之上,可在桌機上模擬 Firefox OS 裝置。且其執行的視窗尺寸、使用者介面、內建的 App 也都和 Firefox OS 裝置相同,更能模擬 Firefox OS 裝置的 API。

- -

如此在許多情況下,就算你沒有實際裝置,也能測試或除錯自己的 App。

- -

整個模擬器大到不能內建在 Firefox 之中,所以包裝成 Firefox 的附加元件。當你在 Runtimes 下拉式選單中點選「Install Simulator」,將會帶領你到安裝不同版本 Firefox OS 模擬器的頁面。

- -

你可以安裝所有需要的模擬器。因為模擬器容量頗大,所以請耐心下載。當你安裝模擬器完畢,就能關閉「Extra Components」視窗。已安裝的模擬器就會出現在「Runtimes」的下拉式選單裡面:

- -

若要進一步了解模擬器,詳見該頁

- -

自訂執行環境

- -

透過可自訂的執行環境,你可用任意的 hostname 和埠 (port) 去連結遠端裝置。

- -

Firefox OS 裝置與 Android 裝置,均是透過「Android Debug Bridge」這個程式 (也稱為 ADB) 連上桌機。WebIDE 已預設使用名為「ADB Helper」的附加元件。此簡單的附加元件可幫你安裝 ADB 並設定好「埠」的轉址,進而簡化相關程序。接著 Firefox 桌面版的工具就能和裝置交換訊息了。

- -

上述功能在大部分情況下都很方便。但有時候你可能不想透過 WebIDE 使用 ADB (例如你想要直接用命令列來跑 ADB)。這時你可使用 adb forward 指令來使用特定的「主機 (Host)」與「埠」
-
- 如果你也想用 WebIDE 及命令列使用 ADB,就要停用 ADB Helper 附加元件,並透過「自訂 (Custom)」選項、輸入你傳送給 adb forward 的「主機」與「埠」,即可連接 WebIDE。

- -

ADB Helper 目前還不支援連結 Firefox for Android。如果你想透過 WebIDE 連上 Firefox for Android,就必須設定自己的埠轉址 (Port forwarding) 與自訂的執行環境。可進一步參閱 connecting to Firefox for Android using ADB

- -

選擇執行環境

- -

當你設定好執行環境之後,就能在「選擇 Runtime (Select Runtime)」中點選。

- - - -

WebIDE 工具列中間的「play」按鈕這時已經可按。點下後就會執行所選的執行環境。 

- -

執行環境的動作

- -

選取執行環境之後,「Runtimes」下拉式選單會多出 3 個選項:

- - - -

- -

- -

建立並開啟 App

- -

在「開啟應用程式 (Open App)」選單之下共有 3 個選項:
- 1). 新增應用程式... (New App...)
- 2). 開啟封裝的應用程式... (Open Packaged App...)
- 3). 開啟架設的應用程式... (Open Hosted App...)

- -

- -

建立新的 App

- -

點選「新增應用程式」即可建立新 App。你會看到對話視窗內提供「Privileged Empty App」與「Privileged App」共  2 個範本。

- -

- -

此 2 個範本均來自於 Mozilla 的「app template collection」,以最基本的架構讓你輕鬆上手。「Privileged App」則會教你如何使用權限去取得跨領域 (cross-origin) 的內容。

- -

在選擇範本之後,必須設定該 App 的名稱及其檔案儲存目錄,接著會在專案編輯器中開啟新 App。

- -

開啟封裝式 App

- -

點選「開啟封裝的應用程式...」即可開啟封裝式 (Packaged) App。你所選取的資料夾中必須具備 App 的 manifest 檔案,然後就會在專案編輯器中開啟 App。

- -
-

注意:你會在「應用程式管理員 (App Manager)」中看到「manifest」中文翻譯為「安裝資訊檔」。

-
- -

開啟托管/架設式 App

- -

點選「開啟架設的應用程式...」開啟托管/架設式 (Hosted) App。你必須輸入 1 組網址指向該 App 的 manifest 檔案,然後就會在專案編輯器中開啟該 App。

- -

編輯 App

- -

專案編輯器可供編輯 App。左側邊欄是 App 所有檔案的樹狀結構,可透過右鍵選單來新增、刪除檔案。右邊一大塊就是檔案編輯面板。

- -

App 總覽頁面

- -

如果是第一次打開或新建 App 時,編輯面板會出現 App 總覽頁面:

- -

- -

你可隨時透過左側的檔案樹狀圖,回到 App 總覽頁面。

- -

Manifest 檔案檢查

- -

WebIDE 會自動檢查 manifest 檔案的常見問題。只要發現問題,就會在 App 總覽頁面中顯示並說明錯誤原因:

- -

- -

當然也可以在專案編輯器中,直接編輯 App 的 manifest.webapp 檔案。

- -

原始碼編輯器

- -

WebIDE 是使用 CodeMirror 原始碼編輯器。

- -

原始碼編輯器快捷鍵

- -

{{ Page ("en-US/docs/tools/Keyboard_shortcuts", "source-editor") }}

- -

程式碼補齊

- -

當編輯 CSS 和 JavaScript 時,編輯器會自動補齊建議字串。 CSS 自動補齊功能預設為開啟:

- -

按「Control + Space」就可顯示 JavaScript 的自動補齊建議:

- -

- -

行內說明文件

- -

編輯器也可顯示 JavaScript 的行內說明文件。只要按下「Shift + Space」,就會跳出目前滑鼠游標放置的條目之說明:

- -

- -

在提示視窗中點選 [docs] 連結,就會帶你到該條目所對應的 MDN 頁面。

- -

儲存檔案

- -

你必須儲存檔案之後,才能觀看檔案修改成果。如果是修改過但尚未儲存的檔案,則樹狀圖的檔名旁邊將顯示星號。你可透過選單或按下「Control+S」,即可儲存檔案 (Mac OS X 則為「Command+S」)。

- -

移除專案

- -

要從 WebIDE 移除 App,可在 App 總覽頁面點選「移除專案 (Remove Project)」。

- -

執行並除錯 App

- -

當準備好要執行 App 時,必須從「選擇 Runtime」下拉式選單中選取任一執行環境。如果沒有適合的執行環境,請參考設定執行環境

- -

WebIDE 工具列中間的「Play」按鈕現已可點擊。點下之後就會在你所選的執行環境中安裝並執行 App:

- -

這時按下「Pause」就會出現開發者工具的工具箱,以利你對已連結的 App 進行除錯:

- -

這裡會根據所選的執行環境而提供除錯工具,且必定會提供如檢測器 (Inspector)主控台 (Console)JavaScript 除錯器樣式編輯器 (Style Editor)效能分析器 (Profiler)程式碼速記本 (Scratchpad) 等基本工具。就如同一般網頁,透過這些工具做出的修改,都可以即時在 App 中看到結果,但僅暫存。相反的,透過編輯面板修改的檔案,都會直接儲存到硬碟之中,但必須重新啟動 App 才能看到結果。

- -

Certified App 的除錯

- -

若是搭配模擬器,則只要已選擇了執行環境,再點擊 App 的下拉選單,則不僅僅是你的 App,只要是該執行環境正執行中的所有 App 都會列在上面,包含Certified App。這時即可除錯所你選擇的 App:

- -

- -


- 不過,如果要在實際裝置除錯 Certified App 還需要:

- - - -

如果要啟動 Certified App 除錯功能,就要先連接執行環境,然後在選單中找到 Runtime > Runtime Info。如果你在這裡看到「開發工具受限權限 (DevTools restricted privileges)」為「Yes」,就表示無法進行 Certified App 的除錯。根據你除錯對象的不同,後續步驟也有所差異:

- - - -

現在 (或在重新啟動 B2G 桌機用戶端之後) 你應該可以到 WebIDE 看到裝置中的所有 Certified App 了。

- -

監控效能

- -

如果你想知道自己 App 的效能,也有幾種方法可於 WebIDE 的執行環境中測得:

- - - -

疑難雜症 (Troubleshooting)

- -

WebIDE 的其他使用問題,請參閱疑難雜症頁。

- -

 

- -

 

diff --git a/files/zh-tw/tools/webide/troubleshooting/index.html b/files/zh-tw/tools/webide/troubleshooting/index.html deleted file mode 100644 index cfdadf7a1b..0000000000 --- a/files/zh-tw/tools/webide/troubleshooting/index.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: WebIDE 錯誤排除 -slug: Tools/WebIDE/Troubleshooting -translation_of: Archive/WebIDE/Troubleshooting ---- -

連接 Firefox OS 裝置

- -

如果您連接了 Firefox OS 裝置,但該裝置沒有出現在 WebIDE 裡,有些事情您可以先試試:

- - - -

為認證過的應用程式除錯

- -

如果您想為認證過的應用程式(包括內建的應用程式)除錯,請參考 debugging certified apps 中的說明。

- -

Enable logging

- -

You can also enable verbose logging to gather diagnostics:

- -
    -
  1. visit about:config, and add a new preference called .console.logLevel, with the string value all, and set extensions.adbhelper@mozilla.org.debug to true
  2. -
  3. In the Add-ons Manager, disable and then re-enable the ADB Helper add-on.
  4. -
  5. Open the Browser Console and you'll now see console messages prefixed with adb. If the messages don't mean anything to you, ask for help.
  6. -
- -

尋求協助

- -

請上 IRC 的 #devtools 頻道尋求協助。

diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.1/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.1/index.html deleted file mode 100644 index 1095a343b3..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.1/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: New in JavaScript 1.1 -slug: Web/JavaScript/New_in_JavaScript/1.1 -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.1 ---- -
{{jsSidebar("New_in_JS")}}
- -

The following is a changelog for JavaScript from Netscape Navigator 2.0 to 3.0. The old Netscape documentation references this as "Features added after version 1". Netscape Navigator 3.0 was released on August 19, 1996. Netscape Navigator 3.0 was the second major version of the browser with JavaScript support.

- -

JavaScript versions

- -

Netscape Navigator 3.0 also introduced JavaScript language versions.

- -
<SCRIPT LANGUAGE="JavaScript">    <!-- JavaScript for Navigator 2.0. -->
-<SCRIPT LANGUAGE="JavaScript1.1"> <!-- JavaScript for Navigator 3.0. -->
- -

New features in JavaScript 1.1

- -

New objects

- - - -

New properties

- - - -

New methods

- - - -

New operators

- - - -

Other new features

- - - -

Changed functionality in JavaScript 1.1

- - diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.2/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.2/index.html deleted file mode 100644 index 3c5db395fc..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.2/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: New in JavaScript 1.2 -slug: Web/JavaScript/New_in_JavaScript/1.2 -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.2 ---- -
{{jsSidebar("New_in_JS")}}
- -

The following is a changelog for JavaScript from Netscape Navigator 3.0 to 4.0. The old Netscape documentation can be found on archive.org. Netscape Navigator 4.0 was released on June 11, 1997. Netscape Navigator 4.0 was the third major version of the browser with JavaScript support.

- -

JavaScript versions

- -

Netscape Navigator 4.0 executes JavaScript language versions up to 1.2. Note that Netscape Navigator 3.0 and earlier ignored scripts with the language attribute set to "JavaScript1.2" and higher.

- -
<SCRIPT LANGUAGE="JavaScript1.1"> <!-- JavaScript for Navigator 3.0. -->
-<SCRIPT LANGUAGE="JavaScript1.2"> <!-- JavaScript for Navigator 4.0. -->
- -

New features in JavaScript 1.2

- -

New objects

- - - -

New properties

- - - -

New methods

- - - -

New operators

- - - -

New statements

- - - -

Other new features

- - - -

Changed functionality in JavaScript 1.2

- - diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.3/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.3/index.html deleted file mode 100644 index 635126dc4f..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.3/index.html +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: New in JavaScript 1.3 -slug: Web/JavaScript/New_in_JavaScript/1.3 -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.3 ---- -
{{jsSidebar("New_in_JS")}}
- -

The following is a changelog for JavaScript from Netscape Navigator 4.0 to 4.5. The old Netscape documentation can be found on archive.org. Netscape Navigator 4.5 was released on October 19, 1998.

- -

The most significant change in JavaScript 1.3 was compliance with ECMA-262 and Unicode by removing inconsistencies between JavaScript 1.2 and the new ECMA standard (which was published in June 1997). Additional features of version 1.2, at the time not specified by ECMA-262 were kept in the JavaScript language (see below for a list of differences).

- -

JavaScript versions

- -

Netscape Communicator and Navigator 4.06 and 4.5 executes JavaScript language versions up to 1.3. Note that Communicator and Navigator 4.0-4.05 and earlier ignored scripts with the language attribute set to "JavaScript1.3" and higher.

- -
<SCRIPT LANGUAGE="JavaScript1.2"> <!-- JavaScript for Navigator 4.0. -->
-<SCRIPT LANGUAGE="JavaScript1.3"> <!-- JavaScript for Navigator 4.5. -->
- -

New features in JavaScript 1.3

- -

New globals

- - - -

New methods

- - - -

Other new features

- - - -

Changed functionality in JavaScript 1.3

- - - -

Non-ECMA-262 features of JavaScript 1.3

- -

The following is a comparison between the June 1998 version of ECMA-262 and JavaScript 1.3. The following features were not part of the standard at that time, but implemented in JavaScript 1.3.

- -

Keywords and operators

- - - -

Statements

- - - -

Built-in objects

- - - -

Methods of built-in objects

- - diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.4/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.4/index.html deleted file mode 100644 index d44fe1eb71..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.4/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: New in JavaScript 1.4 -slug: Web/JavaScript/New_in_JavaScript/1.4 -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.4 ---- -
{{jsSidebar("New_in_JS")}}
- -

The following is a changelog for JavaScript 1.4, which was only used for Netscape's server side JavaScript released in 1999. The old Netscape documentation can be found on archive.org.

- -

New features in JavaScript 1.4

- - - -

Changed functionality in JavaScript 1.4

- - diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.5/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.5/index.html deleted file mode 100644 index b516506dcd..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.5/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: New in JavaScript 1.5 -slug: Web/JavaScript/New_in_JavaScript/1.5 -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.5 ---- -
{{jsSidebar("New_in_JS")}}
- -

The following is a changelog for JavaScript 1.5. This version was included in Netscape Navigator 6.0 was released on November 14, 2000 and was also used in later versions of Netscape Navigator and Firefox 1.0. You can compare JavaScript 1.5 to JScript version 5.5 and Internet Explorer 5.5, which was released in July 2000. The corresponding ECMA standard is ECMA-262 Edition 3 (from December 1999).

- -

New features in JavaScript 1.5

- - - -

Changed functionality in JavaScript 1.5

- - diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.6/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.6/index.html deleted file mode 100644 index 0c3ffa0f25..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.6/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: JavaScript 1.6 新鮮事 -slug: Web/JavaScript/New_in_JavaScript/1.6 -tags: - - E4X - - JavaScript - - JavaScript_version_overviews - - 所有類別 -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.6 ---- -
{{jsSidebar("New_in_JS")}}
- -

JavaScript 1.6 推出了幾項新機能:E4X、幾個新的 Array 方法、以及 Array 與 String 的通用化。

- -

Firefox 1.5 或更新版的瀏覽器支援 JavaScript 1.6。

- -

E4X

- -

ECMAScript for XML(E4X)是個在 JavaScript 內建立並處理 XML 內容的強力技術。我們將持續改進我們對 E4X 的支援,包括新增與既有的 DOM 進行透明化的整合,不過建立以 XML 為基礎的 Web 應用程式的開發者已可受益於 Firefox 1.5 對 E4X 的支援。

- -

使用 E4X 時還是可以使用標準的 MIME 類型:

- -
<script type="text/javascript">
-
- -

不過,E4X 語法可能會和把 Script 放進 HTML 註解以避免舊瀏覽器讀取的現行方式(<!--...-->)發生衝突。E4X 也有可能與把 Script 放進 XML CDATA 區段(<![CDATA{{ mediawiki.external('...') }}]>)讓 Script 可以直接使用 "<" 和 ">" 符號(這並不適用於 HTML)的現行方式發生衝突。如果你不斷的見到莫名其妙的語法錯誤,那就把 "; e4x=1" 加到 MIME 類型裡:

- -
<script type="text/javascript; e4x=1">
-
- -

注意,擴充套件中的 Script 一定會把 HTML 註解當作 E4X 的語法來處理。也就是說,"e4x=1" 是預設的。

- -

E4X 已在 使用 E4X 處理 XML 一文中說明。

- -

Array 的擴充

- -

在此有七個新的 Array 方法,並且可以分成兩大類,項目定位方法以及迭代方法。項目定位方法有:

- - - -

迭代方法有:

- - - -

閱讀 陣列的運用 以取得更多資訊,或見 Nicholas C. Zakas 的文章,Mozilla's New Array Methods

- -

Array 與 String 的通用化

- -

有時候你會想要把陣列的方法套用在字串上。這樣做的話,便是把字串視為字元的陣列。比如說,如果要檢查變數 str 裡面的每個字元都是字母,你就會這樣寫:

- -
function isLetter(character) {
-  return (character >= "a" && character <= "z");
-}
-
-if (Array.prototype.every.call(str, isLetter))
-  alert("字串 '" + str + "' 只有包含字母!");
-
- -

這樣的寫法相當耗事,所以 JavaScript 1.6 有比較簡短的寫法:

- -
if (Array.every(str, isLetter))
-  alert("字串 '" + str + "' 只有包含字母!");
-
- -

同理,你可以把 String 方法用在任何物件上:

- -
var num = 15;
-alert(String.replace(num, /5/, '2'));
-
- -

參閱

- - - -

{{ languages( { "en": "en/New_in_JavaScript_1.6", "es": "es/Novedades_en_JavaScript_1.6", "fr": "fr/Nouveaut\u00e9s_dans_JavaScript_1.6", "ja": "ja/New_in_JavaScript_1.6", "pl": "pl/Nowo\u015bci_w_JavaScript_1.6", "ru": "ru/\u041d\u043e\u0432\u043e\u0435_\u0432_JavaScript_1.6", "zh-cn": "cn/New_in_JavaScript_1.6" } ) }}

diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.7/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.7/index.html deleted file mode 100644 index 9f94bb6e88..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.7/index.html +++ /dev/null @@ -1,600 +0,0 @@ ---- -title: JavaScript 1.7 新鮮事 -slug: Web/JavaScript/New_in_JavaScript/1.7 -tags: - - JavaScript - - JavaScript_version_overviews - - 待翻譯 - - 所有類別 -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.7 ---- -
{{jsSidebar("New_in_JS")}}
- -

{{ Fx_minversion_header(2) }}

- -

JavaScript 1.7 是個程式語言上的更新,新推出了幾項新功能,諸如特別的產生器(generator)、迭代器(iterator)、陣列簡約式(array comprehension)、let 表達式、以及分割代入(destructuring assignment)。它也包含了所有 JavaScript 1.6 的功能。

- -

Firefox 2 起,開始支援 JavaScript 1.7。

- -

本文章使用的程式碼範例可以用 JavaScript shell 實驗。請參見 JavaScript shell 入門 以得知如何建造及使用 shell。

- -

使用 JavaScript 1.7

- -

為了使用 JavaScript 1.7 的一些新機能,你必須在 HTML 或 XUL 的原始碼中指明你希望使用 JavaScript 1.7:

- -
 <script type="application/javascript;version=1.7"/>
-
- -

當使用 JavaScript shell 的時候,你需要設定想要使用的版本,可以在命令列加上 -version 170 或使用 version() 函式:

- -
 version(170);
-
- -

當碰到必須使用新關鍵字「yield」和「let」的機能時,你必須指定版本 1.7,因為既有的程式可能會將那些關鍵字判讀為變數或函數的名字。當某項機能並未引入新關鍵字時(分割代入和陣列簡約式),可不必指定 JavaScript 的版本。

- -

產生器與迭代器

- -

當開發中的代碼涉及到迭代演算法時(例如迭代整個列表或在同一組資料上反覆進行計算),在計算處理期間還需要維護狀態變數的值。傳統上,你必須使用 Callback 函數以取得迭代演算法的立即值。

- -

產生器

- -

思考下面的迭代演算法,他會計算費伯納契數︰

- -
function do_callback(num) {
-  document.write(num + "<BR>\n");
-}
-
-function fib() {
-  var i = 0, j = 1, n = 0;
-  while (n < 10) {
-    do_callback(i);
-    var t = i;
-    i = j;
-    j += t;
-    n++;
-  }
-}
-
-fib();
-
- -

代碼中使用的 Callback 常式會在演算法每一次的迭代步驟中進行運算。在本例中,每一個費伯納契數只是簡單的輸出到控制台上。

- -

產生器和迭代器的結合運用可提供較佳的新方式來完成這一動作。讓我們來看看使用產生器所寫成的費伯納契數常式的樣子︰

- -
function fib() {
-  var i = 0, j = 1;
-  while (true) {
-    yield i;
-    var t = i;
-    i = j;
-    j += t;
-  }
-}
-
-var g = fib();
-for (var i = 0; i < 10; i++) {
-  document.write(g.next() + "<BR>\n");
-}
-
- -

內含 yield 關鍵字的函數便是產生器。當你呼叫函數的時候,函數的形式參數受限於實際的參數,但函數本身並不會被實際進行求值。取而代之的是產生器迭代器(generator-iterator)的返回。每當呼叫產生器迭代器的 next() 方法就進行迭代演算法的下一步驟。每一步驟的值都是由 yield 關鍵字的值所指定。可以把 yield 想成是產生器迭代器版本的 return,並指明演算法每一回迭代之間的分界線。每當你呼叫 next() 的時候,產生器的代碼會從 yield 之後的語句開始恢復執行。

- -

你可以反覆呼叫產生器迭代器的 next() 方法,直到達到你所想要的結果為止。在本例中,我們可以取得任意多的費伯納契數,只要我們持續呼叫 g.next() 直到拿到所需數目的結果為止。

- -
在指定點上恢復產生器的執行
- -

產生器的 next() 方法一經呼叫以後產生器就會被啟動,你可以使用 send() 傳入指定的值,傳入的值會被視為最後一個 yield 的結果。產生器將會返回隨後的 yield 的運算元。

- -

你不能在任意點上啟動產生器;在你可以使用 send() 傳入指定值以前,你必須先以 next() 啟動。

- -
附註: 有趣的一點是,呼叫 send(undefined) 和呼叫 next() 是等價的。然而,使用除了 undefined 以外的任意值來呼叫 send() 並啟動新生的產生器,將會導致 TypeError 的例外。
- -
產生器裡的例外
- -

你可以呼叫產生器的 throw() 方法並傳入要拋出的例外值,強制使產生器拋出例外。例外將會從產生器當下被暫停的內容中拋出,彷彿 throw value 被代換成目前被暫停的 yield 語句。

- -

如果在拋出例外的過程中沒有遇到 yield,例外將會不斷擴散直到呼叫 next(),而隨後呼叫的 next() 將會導致 StopIteration 被拋出。

- -
關閉產生器
- -

產生器有一個 close() 方法可強制產生器關閉他自己。關閉產生器的作用有︰

- -
    -
  1. 執行產生器函數裡面所有活動中的 finally 子句。
  2. -
  3. 如果 finally 子句拋出除了 StopIteration 以外的任何例外,例外會被擴散到 close() 方法的呼叫端。
  4. -
  5. 結束產生器。
  6. -
- -
產生器的範例
- -

下面的代碼驅動的產生器將會產生 100 個迴圈。

- -
var gen = generator();
-
-function driveGenerator() {
-  if (gen.next()) {
-    window.setTimeout(driveGenerator, 0);
-  } else {
-    gen.close();
-  }
-}
-
-function generator() {
-  while (i < something) {
-    /** stuff **/
-
-    ++i;
-    /** 100 loops per yield **/
-    if ((i % 100) == 0) {
-      yield true;
-    }
-  }
-  yield false;
-}
-
- -

迭代器

- -

迭代器是一種特殊的物件,可讓你在資料上進行迭代。

- -

在正常使用下,迭代器物件是「看不見的」;你並不需要直接在裡面做操作,但會使用到 JavaScript 的 for...infor each...in 語法 在物件的鍵值上自然的循環。

- -
var objectWithIterator = getObjectSomehow();
-
-for (var i in objectWithIterator)
-{
-  document.write(objectWithIterator[i] + "<BR>\n");
-}
-
- -

如果你正在實裝你自己的迭代器物件,或者有另一個需要直接操作的迭代器,你將需要知道 next 方法、StopIteration 例外、還有 __iterator__ 方法。

- -

你可以藉著呼叫 Iterator(objectname) 來為物件建立迭代器;物件的迭代器會透過物件的 __iterator__ 方法找出來,如果沒有提供 __iterator__ 方法,就會建立預設的迭代器。預設的迭代器會提供物件的屬性,通常是對應於 for...infor each...in 的模式。如果你想要提供自訂的迭代器,你就要覆蓋 __iterator__ 方法並返回你自訂的迭代器的實體。要從 Script 取得物件的迭代器,你就要使用 Iterator(obj) 而非直接存取 __iterator__ 屬性。前者可用於陣列;而後者不行。

- -

一旦你有了迭代器以後,你就可以藉由呼叫迭代器的 next() 方法輕鬆的取得物件中的下一項。如果已無下一項資料,就會拋出 StopIteration 例外。

- -

下面是直接操作迭代器的簡單範例︰

- -
var obj = {name:"Jack Bauer", username:"JackB", id:12345, agency:"CTU", region:"Los Angeles"};
-
-var it = Iterator(obj);
-
-try {
-  while (true) {
-    document.write(it.next() + "<BR>\n");
-  }
-} catch (err if err instanceof StopIteration) {
-  document.write("記錄結束。<BR>\n");
-} catch (err) {
-  document.write("未知的錯誤︰" + err.description + "<BR>\n");
-}
-
- -

這個程式的輸出就像下面這樣︰

- -
name,Jack Bauer
-username,JackB
-id,12345
-agency,CTU
-region,Los Angeles
-記錄結束。
-
- -

當你正在建立你的迭代器的時候,也可以選擇性的指定第二個參數,這個參數是真假值,可表明每當你呼叫 next() 方法時是否只想要返回鍵的部分。把前面例子的 var it = Iterator(obj); 改成 var it = Iterator(obj, true); 會變成以下的輸出內容︰

- -
name
-username
-id
-agency
-region
-記錄結束。
-
- -

在這兩種情況下,返回的資料的實際順序主要是由實裝方式所決定。在此並沒有統一的資料順序。

- -

迭代器是用來掃描物件裡的資料的簡便方式,包括那些你沒注意到的內容。如果你需要維護應用程式無法預期的資料的話,這一點將會特別實用。

- -

陣列簡約式

- -

陣列簡約式的用法和產生器一樣,可提供簡便的方式進行陣列的初始化。例如︰

- -
function range(begin, end) {
-  for (let i = begin; i < end; ++i) {
-    yield i;
-  }
-}
-
- -

range() 是可返回介於 beginend 之間所有的值的產生器。有了上面的定義,我們可以如下使用︰

- -
var ten_squares = [i * i for (i in range(0, 10))];
-
- -

這個預先初始化內容的新陣列 ten_squares,內含 0..9 範圍內所有數值的平方。

- -

在初始化陣列的時候,你可以採用任意的條件。如果你想要初始化內含 0 到 20 之間的偶數的陣列,你可以使用下面的代碼︰

- -
var evens = [i for (i in range(0, 21)) if (i % 2 == 0)];
-
- -

在 JavaScript 1.7 以前,就必須編寫成像下面這個樣子︰

- -
var evens = [];
-for (var i=0; i <= 20; i++) {
-  if (i % 2 == 0)
-    evens.push(i);
-}
-
- -

陣列簡約式不只是更加的緊密,一旦熟悉了這個概念,就會發現陣列簡約式也真的更加易讀。

- -

作用域規則

- -

陣列簡約式中包含在方括號內部的所有東西具有內含的區塊,就像隱含了 let 宣告一樣。

- -

使用 let 的區塊作用域

- -

let 可用來管理資料和函數的區塊作用域,在此有許多種方式︰

- - - -

let 語法

- -
-

The let block and let expression syntax is non-standard and will be removed in the future. Do not use them! See {{bug(1023609)}} for more details.

-
- -

let 語法可提供給變數一個局域作用域。他會作用於被約束在單一區塊範圍內零個以上的變數;否則,他就和 區塊語法 完全一樣。須特別注意的是,在 let 語法內部使用以 var 宣告過的變數,如果變數已在 let 語法外部宣告過,其作用域仍和外部的一樣;這樣的變數仍具有函數作用域。

- -

例如︰

- -
var x = 5;
-var y = 0;
-
-let (x = x+10, y = 12) {
-  print(x+y + "\n");
-}
-
-print((x + y) + "\n");
-
- -

程式的輸出結果會是︰

- -
27
-5
-
- -

代碼區塊的規則和 JavaScript 中的任何代碼區塊完全一樣。他會有自己的使用 let 宣告所確立的局域變數。

- -
附註: 當使用 let 語法的時候,let 後面的圓括弧是必要的。漏掉圓括弧將導致語法錯誤。
- -

作用域規則

- -

let 所定義的變數其作用域即為 let 區塊本身,也包括其內部的區塊,除非內部區塊定義了相同名稱的變數。

- -

let 表達式

- -
-

The let block and let expression syntax is non-standard and will be removed in the future. Do not use them! See {{bug(1023609)}} for more details.

-
- -

你可以使用 let 來確立只對單一表達式有效的變數:

- -
var x = 5;
-var y = 0;
-document.write( let(x = x + 10, y = 12) x+y  + "<BR>\n");
-document.write(x+y + "<BR>\n");
-
- -

結果為:

- -
27
-5
-
- -

在這個例子中,將 x 和 y 指定為 x+1012 只對 x+y 這個表達式有效。

- -

作用域規則

- -

假設有一個 let 表示式:

- -
let (decls) expr
-
- -

這裡的 expr 也會被隱含的區塊所包圍。

- -

let 定義

- -

let 關鍵字也可以用來定義在區塊中的變數。

- -
附註: 如果你有更多有趣的例子是有關於 let 定義的使用方式,可以考慮加到此處。
- -
if (x > y) {
-  let gamma = 12.7 + y;
-  i = gamma * x;
-}
- -

你可以在擴充套件的代碼中使用 let 定義假命名空間的別名。(詳見 擴充套件中安全性的最佳實踐。)

- -
let Cc = Components.classes, Ci = Components.interfaces;
-
- -

當使用到內部函數的時候,有時 let 語法、表達式和定義可使代碼更為簡潔。

- -
var list = document.getElementById("list");
-
-for (var i = 1; i <= 5; i++) {
-  var item = document.createElement("LI");
-  item.appendChild(document.createTextNode("Item " + i));
-
-  let j = i;
-  item.onclick = function (ev) {
-    alert("Item " + j + " is clicked.");
-  };
-  list.appendChild(item);
-}
-
- -

上面的例子有意如此運作,五個(匿名)內部函數的實體分別參考到五個不同變數 j 的實體。注意,如果你改用 var 取代 let,或是移除變數 j 並簡單的在內部函數中使用變數 i,他就不再如此運作。

- -

作用域規則

- -

使用 let 宣告的變數其作用域不僅是限於所在的區塊,也可用於所在區塊的任意子區塊之中,只要這些子區塊未再次定義同樣的變數。在這個方式下,let 的運作就非常類似 var。主要的不同點在於 var 變數的作用域的範圍是整塊函數︰

- -
  function varTest() {
-    var x = 31;
-    if (true) {
-      var x = 71;  // 相同的變數!
-      alert(x);  // 71
-    }
-    alert(x);  // 71
-  }
-
-  function letTest() {
-    let x = 31;
-    if (true) {
-      let x = 71;  // 不同的變數
-      alert(x);  // 71
-    }
-    alert(x);  // 31
-  }
-
- -

= 右邊的表達式受限於區塊的內部。和 let 表達式 以及 let 語法 的作用範圍不同︰

- -
  function letTests() {
-    let x = 10;
-
-    // let 語法
-    let (x = x + 20) {
-      alert(x);  // 30
-    }
-
-    // let 表達式
-    alert(let (x = x + 20) x);  // 30
-
-    // let 定義
-    {
-      let x = x + 20;  // 此處的 x 會被求值成 undefined
-      alert(x);  // undefined + 20 ==> NaN
-    }
-  }
-
- -

在程式或類別中,let 並不會像 var 那樣在全域物件上建立屬性;取而代之的是,在對某個內容的語句求值之際,隱含的區塊會被建立,let 便會在隱含的區塊中建立屬性。其本質上的意義是 let 並不會覆蓋先前使用 var 定義的變數。例如︰

- -
var x = 'global';
-let x = 42;
-document.write(this.x + "<br>\n");
-
- -

代碼所顯示的輸出將會是 "global" 而非 "42"。

- -

隱含的區塊並不使用圓括弧來界定,他是由 JavaScript 引擎暗中建立的。

- -

在函數中,以 eval() 執行的 let 並不像 var 那樣在變數物件上(活動中的物件或最內部的區塊)建立屬性;取而代之的是,在對程式中的語句求值之際,隱含的區塊會被建立,let 便會在隱含的區塊中建立屬性。這是 eval() 在程式上以前述規則作用的結果。

- -

換句話說,當你使用 eval() 來執行代碼的時候,這些代碼會被視為獨立的程式,這些程式的代碼會被隱含的區塊所包圍。

- -

for 迴圈裡加上 let 的變數

- -

你可以使用 let 關鍵字把局域變數限制在 for 迴圈的作用域裡,就像使用 var 一般。

- -
** 加入 obj **
-   var i=0;
-   for ( let i=i ; i < 10 ; i++ )
-     document.write(i + "<BR>\n");
-
-   for ( let [name,value] in obj )
-     document.write("名稱: " + name + ", 值: " + value + "<BR>\n");
-
- -

作用域規則

- -
for (let expr1; expr2; expr3) statement
-
- -

在本例中,expr2expr3statement 都會被含括在隱含的區塊裡,而這個區塊裡內含以 let expr1 宣告的區塊局域變數。這是前述的第一個迴圈的示例。

- -
for (let expr1 in expr2) statement
-for each(let expr1 in expr2) statement
-
- -

這兩種情況都會有一個內含每一個 statement 的隱含區塊。其中第一個是前述的第二個迴圈。

- -

分割代入

- -

分割代入是利用反映出陣列或物件結構的字面表達的語法,從陣列或物件抽取資料。

- -

陣列或物件的字面表達式可提供簡易的方式來建立特用的資料封包。這些資料封包一經建立之後,就能以任意方式來做想做的事。你甚至可以從函數裡返回這些資料封包。

- -

分割代入其中一件特別實用的用法是以單一的語句讀取整個結構,不過還有很多有趣的使用方式,並會在隨後小節中顯示完整的範例。

- -

這種能力很類似 Perl 或 Python 等語言所具有的機能。

- -

範例

- -

分割代入最好的解釋方式就是使用範例,所以這裡有一些可供你閱讀並從中學習。

- -

避免臨時變數

- -

你可以使用分割代入交換變數值,例如︰

- -
var a = 1;
-var b = 3;
-
-[a, b] = [b, a];
-
- -

執行代碼之後,b 變成 1 且 a 變成 3。如果沒有分割代入,就需要臨時變數交換兩個變數值(在某些低階語言中,可以使用 XOR-交換技巧)。

- -

同樣的,也可以用來交換三個以上的變數︰

- -
var a = 'o';
-var b = "<font color = 'green'>o</font>";
-var c = 'o';
-var d = 'o';
-var e = 'o';
-var f = "<font color = 'blue'>o</font>";
-var g = 'o';
-var h = 'o';
-
-for (lp=0;lp<40;lp++)
-	{[a, b, c, d, e, f, g, h] = [b, c, d, e, f, g, h, a];
-	 document.write(a+''+b+''+c+''+d+''+e+''+f+''+g+''+h+''+"<br />");}
-
- -

執行代碼時,就會顯示變動的色彩循環效果。

- -

回到我們先前費伯納契數產生器的範例,我們可以去掉臨時變數 "t",改在單一的群組代入語法中計算 "i" 和 "j" 的新值︰

- -
function fib() {
-  var i = 0, j = 1;
-  while (true) {
-    yield i;
-    [i, j] = [j, i + j];
-  }
-}
-
-var g = fib();
-for (let i = 0; i < 10; i++)
-  print(g.next());
-
- -

返回多重值

- -

感謝有了分割代入,函數因此能夠返回多重值。儘管一直都可以從函數返回陣列,不過分割代入可提供更進一步的靈活性。

- -
function f() {
-  return [1, 2];
-}
-
- -

如你所見,返回值是以類似陣列的記法把所有要返回的值含括在方括號內來完成的。你可以使用這個方式來返回任意數目的結果。在本例中,f() 返回變數 {{ mediawiki.external('1, 2') }} 作為他的輸出。

- -
var a, b;
-[a, b] = f();
-document.write ("A is " + a + " B is " + b + "<BR>\n");
-
- -

指令 {{ mediawiki.external('a, b') }} = f() 會把函數返回的結果依序代入到方括號裡的變數︰a 會被設成 1 而 b 會被設成 2。

- -

你也可以如同陣列一般取回返回值︰

- -
var a = f();
-document.write ("A is " + a);
-
- -

在本例中,a 是內含有值 1 和值 2 的陣列。

- -

在物件上循環

- -

你也可以使用分割代入從物件取出資料︰

- -
var obj = { width: 3, length: 1.5, color: "orange" };
-
-for (let[name, value] in obj) {
-  document.write ("Name: " + name + ", Value: " + value + "<BR>\n");
-}
-
- -

這個循環會遍歷 obj 物件所有的鍵值對,並顯示這些鍵值對的名稱和值。在本例中,其輸出如下︰

- -
Name: width, Value: 3
-Name: length, Value: 1.5
-Name: color, Value: orange
-
- -

在 JavaScript 1.7 中,圍繞著 objIterator() 並不是必要的;不過在 JavaScript 1.8 則是必要的。這是為了使分割代入可用於陣列(詳見 {{ Bug(366941) }})。

- -

在物件的陣列中的值上循環

- -

你可以遍歷物件上的陣列,在每一個物件上取出感興趣的資料欄位︰

- -
var people = [
-  {
-    name: "Mike Smith",
-    family: {
-      mother: "Jane Smith",
-      father: "Harry Smith",
-      sister: "Samantha Smith"
-    },
-    age: 35
-  },
-  {
-    name: "Tom Jones",
-    family: {
-      mother: "Norah Jones",
-      father: "Richard Jones",
-      brother: "Howard Jones"
-    },
-    age: 25
-  }
-];
-
-for each (let {name: n, family: { father: f } } in people) {
-  document.write ("Name: " + n + ", Father: " + f + "<BR>\n");
-}
-
- -

本例會取出 namefamily.father 欄位,存在 nf 裡,並輸出其內容。這會對 people 陣列裡的每一個物件進行處理。其輸出如下︰

- -
Name: Mike Smith, Father: Harry Smith
-Name: Tom Jones, Father: Richard Jones
-
- -

忽略部分返回值

- -

你也可以忽略不想要的返回值︰

- -
function f() {
-  return [1, 2, 3];
-}
-
-var [a, , b] = f();
-document.write ("A is " + a + " B is " + b + "<BR>\n");
-
- -

執行這個代碼之後,a 變成 1 而 b 變成 3。值 2 會被忽略。你可以按這個方式忽略任意(或全部)的返回值。例如︰

- -
[,,,] = f();
-
- -

從正規表達式的比對結果取值

- -

當正規表達式的 exec() 方法找到符合結果時,就會返回比對結果的陣列。其中第一項是要比對的完整字串,之後是符合正規表達式中的每一個圓括弧的子字串。分割代入可讓你更簡單的從陣列中取出一部分資料,忽略不需要的比對結果。

- -
// 使用簡單的正規表達式比對 http / https / ftp 形式的 URL。
-var parsedURL = /^(\w+)\:\/\/([^\/]+)\/(.*)$/.exec(url);
-if (!parsedURL)
-  return null;
-var [, protocol, fullhost, fullpath] = parsedURL;
-
- -

{{ languages( { "en": "en/New_in_JavaScript_1.7", "es": "es/Novedades_en_JavaScript_1.7", "fr": "fr/Nouveaut\u00e9s_dans_JavaScript_1.7", "it": "it/Novit\u00e0_in_JavaScript_1.7", "ja": "ja/New_in_JavaScript_1.7", "pl": "pl/Nowo\u015bci_w_JavaScript_1.7" } ) }}

diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.8.1/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.8.1/index.html deleted file mode 100644 index 699ff53f02..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.8.1/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: JavaScript 1.8.1 新鮮事 -slug: Web/JavaScript/New_in_JavaScript/1.8.1 -tags: - - ECMAScript5 - - Firefox 3.5 - - Gecko 1.9.1 - - JavaScript - - JavaScript 1.8.1 - - JavaScript_version_overviews -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.8.1 ---- -
{{jsSidebar("New_in_JS")}}
-
-

{{ gecko_minversion_header("1.9.1") }}

- -

  JavaScript 1.8.1 僅只修改了一小部份語法。主要的改變可以看 Tracemonkey just-in-time compiler,大多是關於效能增進的部份。

- -

  以下列舉一些值得注意的 API 變動 (細節詳見 detailed in this newsgroup posting):

- -

語言新增

- -
-
Object.getPrototypeOf()
-
這個新函式可以回傳物件的 prototype。
-
Using native JSON
-
Firefox 3.5 可以原生支援 JSON 的操作了。
-
增加了新的 trim 函式到 String 物件
-
現在 String 物件擁有 trim()trimLeft() 和 trimRight() 函式。
-
- -

其他改良

- - - -

{{ languages( { "ja": "ja/New_in_JavaScript_1.8.1"} ) }}

-
- -

 

diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.8.5/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.8.5/index.html deleted file mode 100644 index 3515191b8b..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.8.5/index.html +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: New in JavaScript 1.8.5 -slug: Web/JavaScript/New_in_JavaScript/1.8.5 -tags: - - ECMAScript5 - - JavaScript - - JavaScript 1.8.5 -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.8.5 ---- -
{{jsSidebar("New_in_JS")}}
- -

以下為 JavaScript 1.8.5 的更新日誌,此版本被涵蓋於 Firefox 4 之中。

- -

JavaScript 1.8.5 新功能

- -

新函數

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
函數敘述
{{jsxref("Object.create()")}} -

基於一個特定的原型物件和屬性,建立一個新物件。{{bug("492840")}}

-
{{jsxref("Object.defineProperty()")}}Adds the named property described by a given descriptor to an object.
{{jsxref("Object.defineProperties()")}}Adds the named properties described by the given descriptors to an object.
{{jsxref("Object.getOwnPropertyDescriptor()")}}Returns a property descriptor for a named property on an object. {{bug("505587")}}
{{jsxref("Object.keys()")}}Returns an array of all enumerable properties on an object. {{bug("307791")}}
{{jsxref("Object.getOwnPropertyNames()")}}Returns an array of all enumerable and non-enumerable properties on an object. {{bug("518663")}}
{{jsxref("Object.preventExtensions()")}}Prevents any extensions of an object. {{bug("492849")}}
{{jsxref("Object.isExtensible()")}}Determine if extending of an object is allowed. {{bug("492849")}}
{{jsxref("Object.seal()")}} -

避免其他程式碼刪除一個物件的屬性。 {{bug("492845")}}

-
{{jsxref("Object.isSealed()")}}Determine if an object is sealed. {{bug("492845")}}
{{jsxref("Object.freeze()")}}凍結一個物件:其他程式碼無法刪除或更便任何屬性。{{bug("492844")}}
{{jsxref("Object.isFrozen()")}}辨識一個物件是否遭凍結。{{bug("492844")}}
{{jsxref("Array.isArray()")}}檢查一個變數是否為陣列。{{bug("510537")}}
{{jsxref("Date.prototype.toJSON()")}}回傳一個 JSON 格式的字串 給Date 物件。
{{jsxref("Function.prototype.bind()")}} -

Creates a new function that, when called, itself calls this function in the context provided (with a given sequence of arguments) {{bug("429507")}}

-
- -

New ECMAScript5 features

- - - -

Other standardization work

- -

Various non-standard syntaxes for defining getters and setters have been removed; ECMAScript 5 defined syntax has not been changed. These were all pretty esoteric and rarely used; if this affects you, see this blog post for details.

- -

新物件

- - - - - - - - - - - - - - -
ObjectDescription
{{jsxref("Proxy")}}Offers support for creating Object and Function proxies that enable meta-programming in JavaScript.
- -

Changed functionality in JavaScript 1.8.5

- - diff --git a/files/zh-tw/web/javascript/new_in_javascript/1.8/index.html b/files/zh-tw/web/javascript/new_in_javascript/1.8/index.html deleted file mode 100644 index 63ab0e81b0..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/1.8/index.html +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: JavaScript 1.8 新鮮事 -slug: Web/JavaScript/New_in_JavaScript/1.8 -tags: - - JavaScript - - JavaScript_version_overviews -translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.8 ---- -
{{jsSidebar("New_in_JS")}}
-

{{ Fx_minversion_header(3) }} JavaScript 1.8 是 Gecko 1.9(包含於 Firefox 3)的一部分。相較於 JavaScript 1.7 此版只是個小更新,不過部分更新是為了跟進 ECMAScript 4/JavaScript 2。此次的釋出版本包含所有在 JavaScript 1.6JavaScript 1.7 出現的新機能。

- -

詳見 {{ Bug(380236) }} 以追蹤 JavaScript 1.8 的開發狀態。本文件的狀態可見 {{ Bug(421027) }}。

- -

使用 JavaScript 1.8

- -

為了在 HTML 中使用 JavaScript 1.8 的新機能,需要像下面那樣來使用︰

- -
 <script type="application/javascript;version=1.8"> ... 你的代碼 ... </script>
-
- -

另一個方式(不推薦)是使用已廢棄的 <script> 語言屬性並把他定義為 "JavaScript1.8"。

- -

如果是使用 JavaScript shell,JavaScript XPCOM 元件,或 XUL <script> 元件,會自動({{ Bug(381031) }}, {{ Bug(385159) }})使用最新的 JS 版本(在 Mozilla 1.9 中是 JS1.8)。

- -

如果某一機能需要使用到新關鍵字 "yield" 和 "let",你就要指定 1.7 以上的版本,因為現存的代碼可能會使用這些關鍵字作為變數或函數名。至於未使用到新關鍵字的機能(例如產生器表達式)可以直接使用,不需指定 JavaScript 版本。

- -

表達式化簡

- -

表達式化簡(Expression closures)提供類似 典型 Lambda 記法 的語法,除了用於簡單函數的簡寫以外,並未帶來其他新機能。

- -

JavaScript 1.7 及早期版本︰

- -
 function(x) { return x * x; }
-
- -

JavaScript 1.8︰

- -
 function(x) x * x
-
- -

這個語法可讓你省略花括弧和 'return' 語法 - 使這些隱含化。以這種風格編寫的代碼除了簡短以外,並沒有其他額外的優點。

- -

範例:

- -

連結事件接收器的簡寫︰

- -
 document.addEventListener("click", function() false, true);
-
- -

在來自 JavaScript 1.6 的 some 中使用這個記法︰

- -
 elems.some(function(elem) elem.type == "text");
-
- -

產生器表達式

- -

This addition allows you to simply create generators (which were introduced in JavaScript 1.7). Typically you would have to create a custom function which would have a yield in it, but this addition allows you to use array comprehension-like syntax to create an identical generator statement.

- -

In JavaScript 1.7, you might write something like the following in order to create a custom generator for an object:

- -
 function add3(obj) {
-   for ( let i in obj )
-     yield i + 3;
- }
-
- let it = add3(someObj);
- try {
-   while (true) {
-     document.write(it.next() + "<br>\n");
-   }
- } catch (err if err instanceof StopIteration) {
-   document.write("End of record.<br>\n");
- }
-
- -

In JavaScript 1.8, you can circumvent having to create a custom generator function by using a generator expression instead:

- -
 let it = (i + 3 for (i in someObj));
- try {
-   while (true) {
-     document.write(it.next() + "<br>\n");
-   }
- } catch (err if err instanceof StopIteration) {
-   document.write("End of record.<br>\n");
- }
-
- -

Generator expressions can also be passed in, as values, to a function. This is particularly noteworthy since generators aren't run until they are absolutely needed (unlike for typical array comprehension situations, where the arrays are constructed ahead of time). An example of the difference can be seen here:

- -

Using JavaScript 1.7 Array Comprehension

- -
 handleResults([ i for ( i in obj ) if ( i > 3 ) ]);
-
- function handleResults( results ) {
-   for ( let i in results )
-     // ...
- }
-
- -

Using JavaScript 1.8 Generator Expressions

- -
 handleResults( i for ( i in obj ) if ( i > 3 ) );
-
- function handleResults( results ) {
-   for ( let i in results )
-     // ...
- }
-
- -

The significant difference between the two examples being that by using the generator expressions, you would only have to loop over the 'obj' structure once, total, as opposed to once when comprehending the array, and again when iterating through it.

- -

陣列更進一步的擴充

- -

There are two new iterative Array methods included in JavaScript 1.8, specifically:

- - - -

for..in 分割代入的變更

- -

One change that occurred in the release of JavaScript 1.8 was a bug fix related to the key/value destructuring of arrays introduced in JavaScript 1.7. Previously it was possible to destructure the keys/values of an array by using for ( var [key, value] in array ). However that made it impossible to destructure the values of an array - that were arrays. This has been resolved now. ({{ Bug(366941) }}).

- -

{{ languages( { "en": "en/New_in_JavaScript_1.8", "es": "es/Novedades_en_JavaScript_1.8", "fr": "fr/Nouveaut\u00e9s_dans_JavaScript_1.8", "ja": "ja/New_in_JavaScript_1.8", "pl": "pl/Nowo\u015bci_w_JavaScript_1.8", "pt": "pt/Novidades_no_Javascript_1.8", "ko": "ko/New_in_JavaScript_1.8" } ) }}

diff --git a/files/zh-tw/web/javascript/new_in_javascript/index.html b/files/zh-tw/web/javascript/new_in_javascript/index.html deleted file mode 100644 index 0dd24e1d1d..0000000000 --- a/files/zh-tw/web/javascript/new_in_javascript/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: JavaScript 新鮮事 -slug: Web/JavaScript/New_in_JavaScript -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Web/JavaScript/New_in_JavaScript ---- -
{{jsSidebar("New_in_JS")}}
- -

This chapter contains information about JavaScript's version history and implementation status for Mozilla/SpiderMonkey-based JavaScript applications, such as Firefox.

- -

ECMAScript versions

- -
-
Language resources
-
Learn more about the ECMAScript standards on which the JavaScript language is based on.
-
ECMAScript 5 support
-
Implementation status for the current standard ECMA-262 Edition 5.1 in Mozilla-based engines and products.
-
ECMAScript 2015 support
-
Implementation status for the draft ECMA-262 Edition 6 (ES2015 or ES6) in Mozilla-based engines and products.
-
ECMAScript Next support
-
Implementation status for upcoming ECMA-262 features as per the yearly (ES2016/ES2017/ES2018/...) release schedule in Mozilla-based engines and products.
-
- -

JavaScript release notes

- -
-
Firefox JavaScript changelog
-
See this changelog for JavaScript features implemented in Firefox 5 and later.
-
- -

JavaScript versions

- -

Deprecated ({{deprecated_inline}}). The explicit versioning and opt-in of language features was Mozilla-specific and is in process of being removed. Firefox 4 was the last version which referred to an JavaScript version (1.8.5). With new ECMA standards, JavaScript language features are now often mentioned with their initial definition in ECMA-262 Editions such as Edition 6 (ES2015/ES6).

- -

JavaScript was released as version 1.0 in March 1996 in Netscape Navigator 2.0 and Internet Explorer 2.0.

- -
-
JavaScript 1.1
-
Version shipped in Netscape Navigator 3.0. Released on August 19, 1996.
-
JavaScript 1.2
-
Version shipped in Netscape Navigator 4.0-4.05. Released on June 11, 1997.
-
JavaScript 1.3
-
Version shipped in Netscape Navigator 4.06-4.7x. Released on October 19, 1998.
- Standardization work to be compliant with ECMA-262 1st and 2nd Edition.
-
JavaScript 1.4
-
Version shipped in Netscape's server side JavaScript. Released in 1999.
-
JavaScript 1.5
-
Version shipped in Netscape Navigator 6.0 and Firefox 1.0. Release on November 14, 2000.
- Standardization work to be compliant with ECMA-262 3rd Edition.
-
JavaScript 1.6
-
Version shipped in Firefox 1.5. Released in November 2005.
- Includes ECMAScript for XML (E4X), new Array methods plus String and Array generics.
-
JavaScript 1.7
-
Version shipped in Firefox 2. Released in October 2006.
- Includes generators, iterators, array comprehensions, let expressions, and destructuring assignment.
-
JavaScript 1.8
-
Version shipped in Firefox 3. Released in June 2008.
- Includes expression closures, generator expressions and Array.reduce()
-
JavaScript 1.8.1
-
Version shipped in Firefox 3.5. Released on June 30, 2009.
- Includes the TraceMonkey JIT and supports native JSON.
-
JavaScript 1.8.2
-
Version shipped in Firefox 3.6. Released June 22, 2009.
- Includes only minor changes.
-
JavaScript 1.8.5
-
Version shipped in Firefox 4. Released July 27, 2010.
- Includes many new features for ECMA-262 Edition 5 compliance.
- This is the last JavaScript version.
-
diff --git "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/java_\345\220\221_javascript_\347\232\204\351\200\232\350\250\212/index.html" "b/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/java_\345\220\221_javascript_\347\232\204\351\200\232\350\250\212/index.html" deleted file mode 100644 index aaf64ed784..0000000000 --- "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/java_\345\220\221_javascript_\347\232\204\351\200\232\350\250\212/index.html" +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Java 向 JavaScript 的通訊 -slug: >- - Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/LiveConnect_概要/Java_向_JavaScript_的通訊 -translation_of: Archive/Web/LiveConnect/LiveConnect_Overview ---- -

 

-

如果你想要在 Java 中使用 JavaScript 物件,你必須在你的 Java 原始碼中引入 netscape.javascript 包裝。這個包裝定義了下面的類別︰

- -

詳見 Core JavaScript 參考 以取得關於此類別的更多資訊。

-

LiveConnect 類別的位置

-

在舊版 Netscape 瀏覽器中,這些類別是連同瀏覽器一起散佈的。從 JavaScript 1.2 開始,這些類別是放在 .jar 檔案中散佈的;在稍早的 JavaScript 版本中,這些類別是放在 .zip 檔案中散佈的。例如,Windows NT 版本的 Netscape Navigator 4,這些類別是放在 Navigator 底下的 Program\Java\Classes 目錄裡的 java40.jar 檔案中散佈的。

-

最近這些類別已改和昇陽的 Java Runtime 一同散佈;一開始是放在 Java Runtime 的散佈版本(JRE 1.3)底下的 "jre/lib" 目錄裡的 "jaws.jar" 檔案中,然後改放在同一目錄下的 "plugin.jar" 檔案中(JRE 1.4 以上)。

-

在 JDK 中使用 LiveConnect 類別

-

若要存取 LiveConnect 類別,有如下兩種方式可以指定 JDK 編譯器的 CLASSPATH 裡的 .jar 或 .zip 檔案位置︰

- -

要在 Windows NT 下指定環境變數,你可在控制台中雙擊系統圖示,並建立稱作 CLASSPATH 的使用者環境變數,其中的值類似下面︰

-
C:\Program Files\Java\jre1.4.1\lib\plugin.jar
-
-

詳見昇陽 JDK 文件,以取得有關 CLASSPATH 的更多資訊。

-

附註: 因為 Java 是強類型語言,而 JavaScript 是弱類型,當你使用 LiveConnect 的時候,JavaScript 執行時期引擎會為其他語言把參數值轉換成適當的資料類型。詳見 資料類型的轉換 取得完整資訊。

-

{{ PreviousNext("Core_JavaScript_1.5_教學:LiveConnect_概要:JavaScript_向_Java_的通訊", "Core_JavaScript_1.5_教學:LiveConnect_概要:Java_向_JavaScript_的通訊:LiveConnect_類別的使用") }}

-

{{ languages( { "en": "en/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Java_to_JavaScript_Communication", "es": "es/Gu\u00eda_JavaScript_1.5/Concepto_general_de_LiveConnect/Comunicaci\u00f3n_de_Java_con_JavaScript", "ja": "ja/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Java_to_JavaScript_Communication", "pl": "pl/Przewodnik_po_j\u0119zyku_JavaScript_1.5/Podgl\u0105d_klas_LiveConnect/Komunikacja_mi\u0119dzy_Java_a_JavaScript" } ) }}

diff --git "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/java_\345\220\221_javascript_\347\232\204\351\200\232\350\250\212/liveconnect_\351\241\236\345\210\245\347\232\204\344\275\277\347\224\250/index.html" "b/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/java_\345\220\221_javascript_\347\232\204\351\200\232\350\250\212/liveconnect_\351\241\236\345\210\245\347\232\204\344\275\277\347\224\250/index.html" deleted file mode 100644 index e66427fab8..0000000000 --- "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/java_\345\220\221_javascript_\347\232\204\351\200\232\350\250\212/liveconnect_\351\241\236\345\210\245\347\232\204\344\275\277\347\224\250/index.html" +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: LiveConnect 類別的使用 -slug: >- - Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/LiveConnect_概要/Java_向_JavaScript_的通訊/LiveConnect_類別的使用 -translation_of: Archive/Web/LiveConnect/LiveConnect_Overview ---- -

 

-

LiveConnect 類別的使用

-

所有在 Java 代碼中的 JavaScript 物件都是以 netscape.javascript.JSObject 的實體呈現的。當你在你的 Java 代碼內部呼叫方法時,你可以把 JavaScript 物件當作方法的其中一個參數來傳入。要做到這一點,你必須定義能夠對應於 JSObject 類型的方法的參數形式。

-

除此之外,當你在 Java 代碼中使用 JavaScript 物件的任何時候,你就要把使用到 JavaScript 物件的呼叫放置於 try...catch 語法之中,並處理 netscape.javascript.JSException 類型的例外。如此一來,當執行 JavaScript 代碼並出現 JSException 類型的例外時,就可讓你的 Java 代碼處理這些錯誤。

-

使用 JSObject 存取 JavaScript

-

舉例來說,假定你正在使用稱為 JavaDog 的 Java 類別。如同下面的代碼所示,JavaDog 建構子可接受 JavaScript 物件 jsDog,這個物件被定義成和參數一樣的 JSObject 類型︰

-
import netscape.javascript.*;
-
-public class JavaDog
-{
-    public String dogBreed;
-    public String dogColor;
-    public String dogSex;
-
-    // define the class constructor
-    public JavaDog(JSObject jsDog)
-    {
-        // use try...catch to handle JSExceptions here
-        this.dogBreed = (String)jsDog.getMember("breed");
-        this.dogColor = (String)jsDog.getMember("color");
-        this.dogSex = (String)jsDog.getMember("sex");
-    }
-}
-
-

注意 JSObjectgetMember 方法是用來存取 JavaScript 物件的屬性。這個例子中使用 getMember 把 JavaScript 的 jsDog.breed 屬性值代給 Java 的資料成員 JavaDog.dogBreed

-

附註: 更接近實際使用的例子會把 getMember 的呼叫放置在 try...catch 語法的內部,以處理 JSException 類型的錯誤。詳見 在 Java 中處理 JavaScript 例外 以取得更多資訊。

-

為了獲得對 getMember 如何運作的良好感覺,仔細閱讀自訂 JavaScript 的物件 Dog 的定義︰

-
function Dog(breed,color,sex) {
-   this.breed = breed
-   this.color = color
-   this.sex = sex
-}
-
-

你可以如下呼叫 gabby 來建立 JavaScript 的 Dog 實體︰

-
gabby = new Dog("lab","chocolate","female")
-
-

如果你對 gabby.color 求值,你會看到他的值是 "chocolate"。現在假定你在你的 JavaScript 代碼中把 gabby 物件傳給建構子並建立 JavaDog 的實體如下︰

-
javaDog = new Packages.JavaDog(gabby)
-
-

如果你對 javaDog.dogColor 求值,你會看到他的值也是 "chocolate",因為在 Java 的建構子中的 getMember 方法會把 gabby.color 的值代給 dogColor

在 Java 中處理 JavaScript 例外

-

當在 Java 裡被呼叫的 JavaScript 代碼在執行時期失敗的時候,他就會拋出例外。如果你有意在 Java 裡呼叫 JavaScript 代碼,你可以在 try...catch 區塊裡捕捉例外。在你的 Java 代碼中可以取得形如 netscape.javascript.JSException 實體的 JavaScript 例外。

-

JSException 即包裝了由 JavaScript 拋出的所有例外類型的 Java 包裝器,類似於用在 JavaScript 物件的包裝器 JSObject 實體的運作方式。當你在 Java 代碼中對 JavaScript 求值時可以使用 JSException

-

當你在 Java 中對 JavaScript 代碼求值的時候,下列情況便會導致執行時期錯誤︰

- -

舉例來說,假設 Java 物件 eTest 會對你所傳入的字串 jsCode 求值。你可以藉由例外處理器的實行,來回應求值時所產生的任何一種執行時期錯誤的類型︰

-
import netscape.javascript.JSObject;
-import netscape.javascript.JSException;
-
-public class eTest {
-    public static Object doit(JSObject obj, String jsCode) {
-        try {
-            obj.eval(jsCode);
-        } catch (JSException e) {
-            if (e.getWrappedException()==null)
-                return e;
-            return e.getWrappedException();
-        }
-        return null;
-    }
-}
-
-

在本範例中,在 try 區塊裡的代碼試圖對你所傳入的字串 jsCode 求值。就讓我們假設你傳入了字串 "myFunction()" 當作 jsCode 的值。如果 myFunction 並未定義成 JavaScript 的函數,JavaScript 解譯器無法對 jsCode 求值。解譯器便會產生錯誤訊息,Java 處理器捕捉到錯誤訊息,然後 doit 方法會返回 netscape.javascript.JSException 的實體。

-

然而,假設 myFunction 已在 JavaScript 中定義如下︰

-
function myFunction() {
-   try {
-      if (theCondition == true) {
-         return "Everything's ok";
-      } else {
-         throw "JavaScript error occurred" ;
-      }
-   } catch (e) {
-      if (canHandle == true) {
-         handleIt();
-      } else {
-         throw e;
-      }
-   }
-}
-
-

如果 theCondition 為 false,函數就會拋出例外。例外會在 JavaScript 代碼中被捕捉,如果 canHandle 為 true,JavaScript 就會處理例外。如果 canHandle 為 false,就會再度拋出例外,Java 處理器捕捉到例外,然後 doit 方法返回 Java 字串︰

-
JavaScript error occurred
-
-

詳見 例外處理語法 以取得有關 JavaScript 例外的完整資訊。

向後相容性

-

在 JavaScript 1.3 及早期版本中,JSException 類別具有三個公開的建構子可選擇性的接受字串參數,這個參數可指明詳細的訊息或其他有關例外的資訊。getWrappedException 無法使用。

-

使用 try...catch 語法如下,以在 JavaScript 1.3 及其早期版本中處理 LiveConnect 例外︰

-
try {
-   global.eval("foo.bar = 999;");
-} catch (Exception e) {
-   if (e instanceof JSException) {
-      jsCodeFailed()";
-   } else {
-      otherCodeFailed();
-   }
-}
-
-

在本例子中,如果 foo 尚未定義,eval 語句就會失敗。如果 eval 語句在 try 區塊中拋出 JSExceptioncatch 區塊就會執行 jsCodeFailed 方法;如果 try 區塊拋出其他的錯誤,就會執行 otherCodeFailed 方法。

-

{{ PreviousNext("Core_JavaScript_1.5_教學:LiveConnect_概要:Java_向_JavaScript_的通訊", "Core_JavaScript_1.5_教學:LiveConnect_概要:資料類型的轉換") }}

-

{{ languages( { "en": "en/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Java_to_JavaScript_Communication/Using_the_LiveConnect_Classes", "es": "es/Gu\u00eda_JavaScript_1.5/Concepto_general_de_LiveConnect/Comunicaci\u00f3n_de_Java_con_JavaScript/Utilizar_las_clases_de_LiveConnect", "ja": "ja/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Java_to_JavaScript_Communication/Using_the_LiveConnect_Classes", "pl": "pl/Przewodnik_po_j\u0119zyku_JavaScript_1.5/Podgl\u0105d_klas_LiveConnect/Komunikacja_mi\u0119dzy_Java_a_JavaScript/U\u017cywanie_klas_LiveConnect" } ) }}

diff --git "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/javascript_\345\220\221_java_\347\232\204\351\200\232\350\250\212/index.html" "b/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/javascript_\345\220\221_java_\347\232\204\351\200\232\350\250\212/index.html" deleted file mode 100644 index df24e60251..0000000000 --- "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/javascript_\345\220\221_java_\347\232\204\351\200\232\350\250\212/index.html" +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: JavaScript 向 Java 的通訊 -slug: >- - Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/LiveConnect_概要/JavaScript_向_Java_的通訊 -translation_of: Archive/Web/LiveConnect/LiveConnect_Overview ---- -

 

-

JavaScript 向 Java 的通訊

-

當你參考 Java 的包裝 (package) 或類別的時候,或者運用 Java 物件或陣列的時候,你就使用了獨特的 LiveConnect 物件。所有 JavaScript 向 Java 的存取動作都會使用到這個物件,有關這些的摘要已列在下表中。

- -
物件 說明
JavaArray 已包裝的 Java 陣列,會在 JavaScript 中的代碼存取。
JavaClass JavaScript 對 Java 類別的參考。
JavaObject 已包裝的 Java 物件,會在 JavaScript 中的代碼存取。
JavaPackage JavaScript 對 Java 包裝(package)的參考。
-

表 9.1 LiveConnect 物件

-


-附註: 因為 Java 是強類型的語言,而 JavaScript 是弱類型,當你使用 LiveConnect 的時候,JavaScript 執行時期引撉會針對其他的語言把參數值轉換成適當的資料類型。參閱 資料類型的轉換 以取得完整資訊。

-

某方面來看,LiveConnect 物件是一種隱形的存在,因為你會以相當直觀的方法與 Java 互動。例如,你可以使用 new 運算子和 Java 的建構子建立 Java 的 String 物件,並把這個物件代入給 JavaScript 的變數 myString,如下︰

-
var myString = new java.lang.String("Hello world")
-
-

在這個例子中,變數 myString 就是 JavaObject,因為他握有 Java 物件 String 的實體。就如同 JavaObjectmyString 也可以存取 java.lang.String 公開的實體方法,以及他的親類別 java.lang.Object。這些 Java 方法就在 JavaScript 中作為 JavaObject 的方法來使用,你可以按如下方式呼叫︰

-
myString.length() // 返回 11
-
-

可在 JavaClass 物件上直接呼叫靜態成員。

-
alert(java.lang.Integer.MAX_VALUE); // 警報 2147483647
-
-

Packages 物件

-

如果有某一個 Java 類別並不屬於 javasunnetscape 包裝,你就使用到 Packages 來存取那個類別。例如,假設 Redwood 公司使用了稱為 redwood 的 Java 包裝用來容納各種該公司所實裝的 Java 類別。若要建立 redwood 裡的 HelloWorld 類別的實體,你可如下存取類別的建構子︰

-
var red = new Packages.redwood.HelloWorld()
-
-

你也可以存取位在預設包裝中的類別(也就是無須明確表示包裝名稱的類別)。例如,如果 HelloWorld 類別正好位在 CLASSPATH 裡而不在包裝裡,你可如下來做存取︰

-
var red = new Packages.HelloWorld()
-
-

LiveConnect 的 javasunnetscape 物件針對常用的 Java 包裝提供簡寫。例如,你可如下使用︰

-
var myString = new java.lang.String("Hello world")
-
-

以取代較長的形式︰

-
var myString = new Packages.java.lang.String("Hello world")
-

Java 陣列的運用

-

當你在 JavaScript 中使用任意的 Java 方法建立陣列並加以參照的時候,你已經使用到 JavaArray。例如,下面的代碼以 10 個類型為 int 的元素建立了 JavaArray x

-
x = java.lang.reflect.Array.newInstance(java.lang.Integer, 10)
-
-

就如同 JavaScript Array 物件,JavaArray 也有可返回元素數目的 length 屬性。有別於 Array.lengthJavaArray.length 是唯讀的屬性,因為 Java 陣列中的元素數目在建立的時候就已經固定住了。

包裝和類別的參考

-

在 JavaScript 中建立 JavaPackage 和 JavaClass 物件,就能簡單的參照 Java 包裝和類別。在稍早的 Redwood 公司的例子中,參考 Packages.redwood 的就是 JavaPackage 物件。同樣的,參考諸如 java.lang.String 的也是 JavaClass 物件。

-

大多數時候,你不必為 JavaPackageJavaClass 物件而擔心—你只需使用 Java 包裝和類別來做事,LiveConnect 會默默的建立這些物件。在此有一個 LiveConnect 載入類別時會失敗的例子,而且需要你如下手工載入︰

-
var Widgetry = java.lang.Thread.currentThread().getContextClassLoader().loadClass("org.mywidgets.Widgetry");
-
-

在 JavaScript 1.3 及早期版本中,當你把 JavaClass 物件傳給 Java 方法作為參數的時候,這些物件並不會自動轉換成 java.lang.Class 的實體—你必須建立 java.lang.Class 實體的包裝器 (wrapper)。在下面的範例中,forName 方法建立了包裝器物件 theClass,然後把他傳給 newInstance 方法來建立陣列。

-
// JavaScript 1.3
-theClass = java.lang.Class.forName("java.lang.String")
-theArray = java.lang.reflect.Array.newInstance(theClass, 5)
-
-

在 JavaScript 1.4 以後的版本中,你可以直接把 JavaClass 物件傳送給方法,就如同下面的例子︰

-
// JavaScript 1.4
-theArray = java.lang.reflect.Array.newInstance(java.lang.String, 5)
-

char 類型的參數

-

在 JavaScript 1.4 和以後的版本中,你可以把單一字元的字串傳給所需參數的類型為 char 的 Java 方法。例如,你可以把字串 "H" 傳給 Character 建構子如下︰

-
c = new java.lang.Character("H")
-
-

在 JavaScript 1.3 和早期版本中,你就必須給這些方法傳入與字元的 Unicode 值相對應的整數。例如,下面的代碼會把值 "H" 代入給變數 c

-
c = new java.lang.Character(72)
-

在 JavaScript 中處理 Java 的例外

-

當 Java 代碼在執行時期失敗的時候,他就會丟出例外。如果你的 JavaScript 代碼存取 Java 的資料成員或方法並且失敗的時候,Java 的例外會被傳送到 JavaScript 以供你處理。從 JavaScript 1.4 開始,你可以在 try...catch 區塊裡捕捉這些例外。(雖然這個機能連同其他部分已在 Gecko 1.9 中失效 (詳見 bug 391642),不再於 Mozilla 內部維護 Mozilla 特有的 LiveConnect 代碼,但已在 Java 6 更新的 11 和 12 的建置版本中,在 Mozilla 實裝的通用 (跨瀏覽器) NPAPI 插件的代碼中提供對 Java 的支援,並修復此問題。)

-

例如,假設你使用 Java 的 forName 方法把 Java 類別的名稱代給稱為 theClass 的變數。如果你傳給他的值並不是 Java 類別的名稱,forName 方法就會丟出例外。把 forName 的代入語句放在 try 區塊以處理例外,如下︰

-
function getClass(javaClassName) {
-   try {
-      var theClass = java.lang.Class.forName(javaClassName);
-   } catch (e) {
-      return ("The Java exception is " + e);
-   }
-   return theClass
-}
-
-

在這個例子中,如果 javaClassName 可求出合理的類別名稱,例如 "java.lang.String",代入就會成功。如果 javaClassName 求出無效的類別名稱,例如 "String",getClass 函數會捕捉例外,並返回類似下面的東西︰

-
The Java exception is java.lang.ClassNotFoundException: String
-
-

若要針對例外的類型做特別的處理,可以使用 instanceof 運算子︰

-
try {
-  // ...
-} catch (e) {
-  if (e instanceof java.io.FileNotFound) {
-     // handling for FileNotFound
-  } else {
-    throw e;
-  }
-}
-
-

參閱 例外處理語法 以取得更多有關於 JavaScript 例外的資訊。

-

{{ PreviousNext("Core_JavaScript_1.5_教學:LiveConnect_概要:包裝器的運用", "Core_JavaScript_1.5_教學:LiveConnect_概要:Java_向_JavaScript_的通訊") }}

-

{{ languages( { "en": "en/Core_JavaScript_1.5_Guide/LiveConnect_Overview/JavaScript_to_Java_Communication", "es": "es/Gu\u00eda_JavaScript_1.5/Concepto_general_de_LiveConnect/Comunicaci\u00f3n_de_JavaScript_con_Java", "ja": "ja/Core_JavaScript_1.5_Guide/LiveConnect_Overview/JavaScript_to_Java_Communication", "pl": "pl/Przewodnik_po_j\u0119zyku_JavaScript_1.5/Podgl\u0105d_klas_LiveConnect/Komunikacja_mi\u0119dzy_JavaScript_a_Java" } ) }}

diff --git "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\345\214\205\350\243\235\345\231\250\347\232\204\351\201\213\347\224\250/index.html" "b/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\345\214\205\350\243\235\345\231\250\347\232\204\351\201\213\347\224\250/index.html" deleted file mode 100644 index 91b98b1697..0000000000 --- "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\345\214\205\350\243\235\345\231\250\347\232\204\351\201\213\347\224\250/index.html" +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: 包裝器的運用 -slug: >- - Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/LiveConnect_概要/包裝器的運用 -translation_of: Archive/Web/LiveConnect/LiveConnect_Overview ---- -

 

-

包裝器的運用

-

在 JavaScript 中,包裝器 (wrapper) 是一種目的語言資料類型的物件,可包裝來源語言的物件。當在 JavaScript 中設計程式的時候,你可以使用包裝器物件存取 Java 物件的方法和欄位;呼叫或存取包裝器裡的方法或屬性,用以在 Java 物件上產生呼叫。對 Java 而言,JavaScript 物件是被包裝在類別為 netscape.javascript.JSObject 的實體之中,並傳送給 Java。

-

當 JavaScript 物件傳送給 Java 的時候,執行時期引撉會建立類型為 JSObject 的 Java 包裝器;當 JSObject 從 Java 傳送到 JavaScript 的時候,執行時期引撉會解開包裝,還原為原本的 JavaScript 物件類型。JSObject 類別提供了可呼叫 JavaScript 方法和檢查 JavaScript 屬性的介面。

-

{{ PreviousNext("Core_JavaScript_1.5_教學:LiveConnect_概要", "Core_JavaScript_1.5_教學:LiveConnect_概要:JavaScript_向_Java_的通訊") }}

- -

{{ languages( { "en": "en/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Working_with_Wrappers", "es": "es/Gu\u00eda_JavaScript_1.5/Concepto_general_de_LiveConnect/Trabajando_con_envoltorios", "ja": "ja/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Working_with_Wrappers", "pl": "pl/Przewodnik_po_j\u0119zyku_JavaScript_1.5/Podgl\u0105d_klas_LiveConnect/Praca_z_klas\u0105_opakowuj\u0105c\u0105" } ) }}

diff --git "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/index.html" "b/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/index.html" deleted file mode 100644 index b541dc1aaf..0000000000 --- "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/index.html" +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: 資料類型的轉換 -slug: >- - Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/LiveConnect_概要/資料類型的轉換 -translation_of: Archive/Web/LiveConnect/LiveConnect_Overview ---- -

 

-

資料類型的轉換

-

因為 Java 是一種強類型的語言,而 JavaScript 是弱類型,JavaScript 執行時期引擎會在使用 LiveConnect 的時候,為其他的語言把參數值轉換成適當的資料類型。這些轉換過程會在以下的章節中詳述︰

- -

{{ PreviousNext("Core_JavaScript_1.5_教學:LiveConnect_概要:Java_向_JavaScript_的通訊:LiveConnect_類別的使用", "Core_JavaScript_1.5_教學:LiveConnect_概要:資料類型的轉換:從_JavaScript_到_Java_的轉換") }}

-

 

- -

{{ languages( { "en": "en/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Data_Type_Conversions", "es": "es/Gu\u00eda_JavaScript_1.5/Concepto_general_de_LiveConnect/Conversiones_de_tipos_de_datos", "ja": "ja/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Data_Type_Conversions", "pl": "pl/Przewodnik_po_j\u0119zyku_JavaScript_1.5/Podgl\u0105d_klas_LiveConnect/Konwersja_typu_danych" } ) }}

diff --git "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/\345\276\236_java_\345\210\260_javascript_\347\232\204\350\275\211\346\217\233/index.html" "b/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/\345\276\236_java_\345\210\260_javascript_\347\232\204\350\275\211\346\217\233/index.html" deleted file mode 100644 index 258cd81717..0000000000 --- "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/\345\276\236_java_\345\210\260_javascript_\347\232\204\350\275\211\346\217\233/index.html" +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: 從 Java 到 JavaScript 的轉換 -slug: >- - Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/LiveConnect_概要/資料類型的轉換/從_Java_到_JavaScript_的轉換 -translation_of: Archive/Web/LiveConnect/LiveConnect_Overview ---- -

 

-

從 Java 到 JavaScript 的轉換

-

從 Java 傳給 JavaScript 的值將如下做轉換︰

- -

注意,java.lang.Double 或 java.lang.Integer 的實體會被轉換成 JavaScript 物件,而非 JavaScript 數字。同樣的,java.lang.String 實體也會被轉換成 JavaScript 物件,而非 JavaScript 字串。

-

Java 的 String 物件也可對應於 JavaScript 的包裝器。如果你呼叫需要 JavaScript 字串的 JavaScript 方法,並且把包裝器傳給這個方法,你會碰到錯誤。正確方法是,藉由附加空的字串把包裝器轉換成 JavaScript 字串,如下所示︰

-
var JavaString = JavaObj.methodThatReturnsAString();
-var JavaScriptString = JavaString + "";
-
-

{{ Previous("Core_JavaScript_1.5_教學:LiveConnect_概要:資料類型的轉換:從_JavaScript_到_Java_的轉換") }}

-

{{ languages( { "en": "en/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Data_Type_Conversions/Java_to_JavaScript_Conversions", "es": "es/Gu\u00eda_JavaScript_1.5/Concepto_general_de_LiveConnect/Conversiones_de_tipos_de_datos/Conversiones_de_Java_a_JavaScript", "ja": "ja/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Data_Type_Conversions/Java_to_JavaScript_Conversions", "pl": "pl/Przewodnik_po_j\u0119zyku_JavaScript_1.5/Podgl\u0105d_klas_LiveConnect/Konwersja_typu_danych/Konwersja_Java_do_JavaScript" } ) }}

diff --git "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/\345\276\236_javascript_\345\210\260_java_\347\232\204\350\275\211\346\217\233/index.html" "b/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/\345\276\236_javascript_\345\210\260_java_\347\232\204\350\275\211\346\217\233/index.html" deleted file mode 100644 index a928ec1a0d..0000000000 --- "a/files/zh-tw/web/javascript/obsolete_pages/obsolete_pages/obsolete_pages/liveconnect_\346\246\202\350\246\201/\350\263\207\346\226\231\351\241\236\345\236\213\347\232\204\350\275\211\346\217\233/\345\276\236_javascript_\345\210\260_java_\347\232\204\350\275\211\346\217\233/index.html" +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: 從 JavaScript 到 Java 的轉換 -slug: >- - Web/JavaScript/Obsolete_Pages/Obsolete_Pages/Obsolete_Pages/LiveConnect_概要/資料類型的轉換/從_JavaScript_到_Java_的轉換 -translation_of: Archive/Web/LiveConnect/LiveConnect_Overview ---- -

 

-

從 JavaScript 到 Java 的轉換

-

當你從 JavaScript 呼叫 Java 的方法並傳入參數的時候,你所傳入的參數的資料類型會按下列規則而被轉換︰

- -

netscape.javascript.JSObject 的方法的返回值永遠會被轉換成 java.lang.Object 的實體。這些返回值的轉換規則也會在這些小節中描述。

-

舉例來說,如果 JSObject.eval 返回了 JavaScript 數值,你可以在 {{ Anch("數值") }} 中找到數字轉成 java.lang.Object 實體的規則。

-

數值

-

當你給 Java 方法傳入 JavaScript 數字類型當作參數的時候,Java 會按照描述在下表中的對應規則做轉換︰

- -
Java 參數類型 轉換規則
double
  • 值會被分毫不差的傳給 Java,而不經過捨入、或精度、符號的損失。
  • NaN 會被轉換成 NaN。
java.lang.Double
java.lang.Object
java.lang.Double 的新實體會被建立,值會被分毫不差的傳給 Java,而不經過捨入、或精度、符號的損失。
float
  • 值會被捨入成浮點精度。
  • 過大或過小的值會被表示為捨入過的正無限大或負無限大。
  • NaN 會被轉換成 NaN。
byte
char
int
long
short
  • 值會以捨入至負無限大的方向進行捨入。
  • 過大或過小的值將導致執行時期錯誤。
  • 無法轉換 NaN 並導致執行時期錯誤。
java.lang.String 值會被轉換成字串。例如︰
  • 237 變成 "237"
boolean
  • 0 和 NaN 值會被轉換成 false。
  • 其他的值會被轉換成 true。
-

當 JavaScript 的數字被當作參數傳給 Java 的方法時,Java 的方法預期的是 java.lang.String 的實體,數字會被轉換成字串。使用 equals() 方法來和其他的字串值比較轉換的結果。

真假值

-

當你把 JavaScript 的布林類型當作參數傳給 Java 方法的時候,Java 會按照描述在下表中的對應規則做轉換︰

- -
Java 參數類型 轉換規則
boolean 所有的值全都直接被轉換成 Java 的等價物。
java.lang.Boolean
java.lang.Object
java.lang.Boolean 的新實體會被建立。每一個參數都會建立一個新實體,而非一個實體持有同一原始值。
java.lang.String 值會被轉換成字串。例如︰
  • true 變成 "true"
  • false 變成 "false"
byte
char
double
float
int
long
short
  • true 變成 1
  • false 變成 0
-

當 JavaScript 的真假值被當作參數傳給 Java 方法的時候,Java 方法預期的是 java.lang.String 的實體,真假值會被轉換成字串。使用 == 運算子與其他的字串值和轉換的結果做比較。

字串值

-

當你把 JavaScript 的字串類型當作參數傳給 Java 方法的時候,Java 會按照描述在下表中的對應規則做轉換︰

- -
Java 參數類型 轉換規則
java.lang.String
java.lang.Object

JavaScript 1.4︰

  • JavaScript 字串會被轉換成以 Unicode 值表示的 java.lang.String 實體。

JavaScript 1.3 及早期版本︰

  • JavaScript 字串會被轉換成以 ASCII 值表示的 java.lang.String 實體。
byte
double
float
int
long
short
所有的值都會被轉換成 ECMA-262 所述的數字。JavaScript 字串值會根據 ECMA-262 所述的規則轉換成數字。
char

JavaScript 1.4︰

  • 單一字元的字串會被轉換成 Unicode 字元。
  • 其餘的值會被轉換成數字。

JavaScript 1.3 及早期版本︰

  • 所有的值都會被轉換成數字。
boolean
  • 空字串會變成 false。
  • 其餘的值會變成 true。
-

Undefined 值

-

當你把 JavaScript 的 undefined 類型當作參數傳給 Java 方法的時候,Java 會按照描述在下表中的對應規則做轉換︰

- -
Java 參數類型 轉換規則
lava.lang.String
java.lang.Object
值會被轉換成 java.lang.String 實體,且其值為字串 "undefined"。
boolean 值會變成 false。
double
float
值會變成 NaN。
byte
char
int
long
short
值會變成 0。
-

undefined 的值轉換只能出現在 JavaScript 1.3 及其後版本。JavaScript 的早期版本並不支援 undefined 值。

-

當 JavaScript 的 undefined 被當作參數傳給 Java 的方法時,Java 的方法預期的是 java.lang.String 的實體,undefined 值會被轉換成字串。使用 == 運算子來和其他的字串值比較轉換的結果。

Null 值

-

當你把 JavaScript 的 null 值當作參數傳給 Java 方法的時候,Java 會按照描述在下表中的對應規則做轉換︰

- -
Java 參數類型 轉換規則
所有的類別
所有的界面類型
值會變成 null。
byte
char
double
float
int
long
short
值會變成 0。
boolean 值會變成 false。
-

JavaArray 以及 JavaObject 物件

-

在大多數情況下,當你把 JavaScript 的 JavaArray 或 JavaObject 當作參數傳給 Java 方法的時候,Java 只是簡單的把物件解開;在少數情況下,物件會根據描述在下表中的規則,強制轉換成其他的資料類型。

- -
Java 參數類型 轉換規則
任何與解開後的物件具代入相容性的界面或類別。 直接解開物件。
java.lang.String 直接解開物件,解開後的 Java 物件的 toString 方法會被呼叫,並返回 java.lang.String 的新實體。
byte
char
double
float
int
long
short

直接解開物件,並發生下列其中一種情況︰

  • 如果解開後的 Java 物件具有 doubleValue 方法,JavaArray 或 JavaObject 就會被轉換成這個方法的返回值。
  • 如果解開後的 Java 物件沒有 doubleValue 方法,就會發生錯誤。
boolean

在 JavaScript 1.3 及其後版本中,會直接解開物件並發生下列其中一種情況︰

  • 如果物件是 null,就會把他轉換成 false。
  • 如果物件具有任何其他的值,就會把他轉換成 true。

在 JavaScript 1.2 及早期版本中,會直接解開物件並發生下列其中一種情況︰

  • 如果解開後的物件具有 booleanValue 方法,來源物件就會被轉換成這個方法的返回值。
  • 如果物件沒有 booleanValue 方法,轉換就會失敗。
-

如果解開後的物件是 Java 參數類型的實體,界面或類別就與這個解開後的物件具有代入相容性。也就是說,下面的語句必須返回 true︰

-
unwrappedObject instanceof parameterType
-
-

JavaClass 物件

-

當你把 JavaScript 的 JavaClass 物件當作參數傳給 Java 方法的時候,Java 會按照描述在下表中的對應規則做轉換︰

- -
Java 參數類型 轉換規則
java.lang.Class 直接解開物件。
netscape.javascript.JSObject
java.lang.Object
JavaClass 物件會被包裝在新的 netscape.javascript.JSObject 實體。
java.lang.String 直接解開物件,解開後的 Java 物件的 toString 方法會被呼叫,並返回新的 java.lang.String 實體。
boolean

在 JavaScript 1.3 及其後版本中,會直接解開物件並發生下列其中一種情況︰

  • 如果物件是 null,就會把他轉換成 false。
  • 如果物件具有任何其他的值,就會把他轉換成 true。

在 JavaScript 1.2 及早期版本中,會直接解開物件並發生下列其中一種情況︰

  • 如果解開後的物件具有 booleanValue 方法,來源物件就會被轉換成這個方法的返回值。
  • 如果物件沒有 booleanValue 方法,轉換就會失敗。

其他的 JavaScript 物件

-

當你把 JavaScript 的任何其他的物件當作參數傳給 Java 方法的時候,Java 會按照描述在下表中的對應規則做轉換︰

- -
Java 參數類型 轉換規則
netscape.javascript.JSObject
java.lang.Object
物件會被包裝在新的 netscape.javascript.JSObject 實體。
java.lang.String 直接解開物件,解開後的 Java 物件的 toString 方法會被呼叫,並返回新的 java.lang.String 實體。
byte

char
double
float
int
long

short
物件會使用在 ECMA-262 中所述的 ToPrimitive 運算子的邏輯轉換成值。運算子所使用的 PreferredType 提示是 Number。
boolean

在 JavaScript 1.3 及其後版本中,會直接解開物件並發生下列其中一種情況︰

  • 如果物件是 null,就會把他轉換成 false。
  • 如果物件具有任何其他的值,就會把他轉換成 true。

在 JavaScript 1.2 及早期版本中,會直接解開物件並發生下列其中一種情況︰

  • 如果解開後的物件具有 booleanValue 方法,來源物件就會被轉換成這個方法的返回值。
  • 如果物件沒有 booleanValue 方法,轉換就會失敗。
-

{{ PreviousNext("Core_JavaScript_1.5_教學:LiveConnect_概要:資料類型的轉換", "Core_JavaScript_1.5_教學:LiveConnect_概要:資料類型的轉換:從_Java_到_JavaScript_的轉換") }}

-

{{ languages( { "en": "en/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Data_Type_Conversions/JavaScript_to_Java_Conversions", "es": "es/Gu\u00eda_JavaScript_1.5/Concepto_general_de_LiveConnect/Conversiones_de_tipos_de_datos/Conversiones_de_JavaScript_a_Java", "ja": "ja/Core_JavaScript_1.5_Guide/LiveConnect_Overview/Data_Type_Conversions/JavaScript_to_Java_Conversions", "pl": "pl/Przewodnik_po_j\u0119zyku_JavaScript_1.5/Podgl\u0105d_klas_LiveConnect/Konwersja_typu_danych/Konwersja_JavaScript_do_Java" } ) }}

diff --git a/files/zh-tw/web/javascript/reference/global_objects/object/watch/index.html b/files/zh-tw/web/javascript/reference/global_objects/object/watch/index.html deleted file mode 100644 index 9dc8afa27f..0000000000 --- a/files/zh-tw/web/javascript/reference/global_objects/object/watch/index.html +++ /dev/null @@ -1,191 +0,0 @@ ---- -title: Object.prototype.watch() -slug: Web/JavaScript/Reference/Global_Objects/Object/watch -translation_of: Archive/Web/JavaScript/Object.watch ---- -
{{JSRef}}
- -
-

Warning: Generally you should avoid using watch() and {{jsxref("Object.prototype.unwatch", "unwatch()")}} when possible. These two methods are implemented only in Gecko, and they're intended primarily for debugging use. In addition, using watchpoints has a serious negative impact on performance, which is especially true when used on global objects, such as window. You can usually use setters and getters or proxies instead. See {{anch("Browser compatibility")}} for details. Also, do not confuse {{jsxref("Object.prototype.watch", "Object.watch")}} with {{jsxref("Object.prototype.observe", "Object.observe")}}.

-
- -

The watch() method watches for a property to be assigned a value and runs a function when that occurs.

- -

語法

- -
obj.watch(prop, handler)
- -

參數

- -
-
prop
-
所需要監聽其值是否改變的物件屬性
-
handler
-
當監聽的變數其數值變換時所執行的function
-
- -

回傳值

- -

{{jsxref("undefined")}}.

- -

Description

- -

Watches for assignment to a property named prop in this object, 呼叫 handler(prop, oldval, newval) whenever prop is set and storing the return value in that property. A watchpoint can filter (or nullify) the value assignment, by returning a modified newval (or by returning oldval).

- -

當你刪掉所監聽的物件屬性,並不會結束針對該物件屬性的監聽。當你重新產生該屬性時,監聽依舊維持作用。

- -

要停止該次監聽, 須使用 {{jsxref("Object.unwatch", "unwatch()")}} 函式. By default, the watch method is inherited by every object descended from {{jsxref("Object")}}.

- -

The JavaScript debugger has functionality similar to that provided by this method, as well as other debugging options. For information on the debugger, see Venkman.

- -

In Firefox, handler is only called from assignments in script, not from native code. For example, window.watch('location', myHandler) will not call myHandler if the user clicks a link to an anchor within the current document. However, window.location += '#myAnchor' will call myHandler.

- -
-

Note: Calling watch() on an object for a specific property overrides any previous handler attached for that property.

-
- -

範例

- -

使用watch 和 unwatch

- -
var o = { p: 1 };
-
-o.watch('p', function (id, oldval, newval) {
-  console.log('o.' + id + ' changed from ' + oldval + ' to ' + newval);
-  return newval;
-});
-
-o.p = 2;
-o.p = 3;
-delete o.p;
-o.p = 4;
-
-o.unwatch('p');
-o.p = 5;
-
- -

上述程式執行結果:

- -
o.p changed from 1 to 2
-o.p changed from 2 to 3
-o.p changed from undefined to 4
-
- -

使用 watch 驗證物件的屬性

- -

You can use watch to test any assignment to an object's properties. This example ensures that every Person always has a valid name and an age between 0 and 200.

- -
Person = function(name, age) {
-  this.watch('age', Person.prototype._isValidAssignment);
-  this.watch('name', Person.prototype._isValidAssignment);
-  this.name = name;
-  this.age = age;
-};
-
-Person.prototype.toString = function() {
-  return this.name + ', ' + this.age;
-};
-
-Person.prototype._isValidAssignment = function(id, oldval, newval) {
-  if (id === 'name' && (!newval || newval.length > 30)) {
-    throw new RangeError('invalid name for ' + this);
-  }
-  if (id === 'age'  && (newval < 0 || newval > 200)) {
-    throw new RangeError('invalid age for ' + this);
-  }
-  return newval;
-}
-
-will = new Person('Will', 29);
-console.log(will);   // Will, 29
-
-try {
-  will.name = '';
-} catch (e) {
-  console.log(e);
-}
-
-try {
-  will.age = -4;
-} catch (e) {
-  console.log(e);
-}
-
- -

上述程式執行結果:

- -
Will, 29
-RangeError: invalid name for Will, 29
-RangeError: invalid age for Will, 29
-
- -

規格

- -

Not part of any specifications. Implemented in JavaScript 1.2.

- -

瀏覽器相容性

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -

Compatibility notes

- - - -

參閱

- - diff --git a/files/zh-tw/webapi/alarm/index.html b/files/zh-tw/webapi/alarm/index.html deleted file mode 100644 index fc1eddb8d3..0000000000 --- a/files/zh-tw/webapi/alarm/index.html +++ /dev/null @@ -1,196 +0,0 @@ ---- -title: Alarm API -slug: WebAPI/Alarm -translation_of: Archive/B2G_OS/API/Alarm_API ---- -

{{ SeeCompatTable() }}

-

摘要

-

Alarm API 可存取裝置的警示設定功能。而警示設定功能可排定通知的時間,或在特定時間啟動某個 App。如鬧鐘、行事曆、自動更新等的 Apps,就可能需要透過 Alarm API,在特定時點觸發裝置的特定動作。

-

而 Alarm API 本身僅可進行警示排程。透過 System Message API 即可將警示發送到 Apps,因此若 Apps 要對警示做出反應,就必須先將 Apps 註冊至 alarm 訊息。

-

另外,使用 MozAlarmsManager 介面的 window.navigator.mozAlarms 物件,即可設定警示。

-

警示排程

-

使用警示功能的第一件事,就是警示排程。若依照時區來分,共可分成 2 種警示,且均可透過 MozAlarmsManager.add 函式進行排程。

-
-

注意:若未針對特定 Apps 來設定警示,則只要是正在監聽警示的 Apps,均將接到系統所發送的警示。

-
-

忽略時區的警示

-

系統將根據裝置的本端時間,發送此類警示。若裝置變更了時區設定,則系統將根據新的時區而發送警示。舉例來說,如果使用者位在巴黎,設定了 12 PM CET (Central European Time) 發出警示,結果出差到舊金山時,那同樣會在 12 PM PDT (Pacific Daylight Time) 發送警示。

-
// This the date to schedule the alarm
-var myDate  = new Date("May 15, 2012 16:20:00");
-
-// This is arbitrary data pass to the alarm
-var data    = {
-  foo: "bar"
-}
-
-// The "ignoreTimezone" string is what make the alarm ignoring it
-var request = navigator.mozAlarms.add(myDate, "ignoreTimezone", data);
-
-request.onsuccess = function () {
-  console.log("The alarm has been scheduled");
-};
-
-request.onerror = function () {
-  console.log("An error occurred: " + this.error.name);
-};
-
-

遵守時區的警示

-

系統將根據排程當下的時區,發送此類警示。若裝置因為某個理由變更了時區,系統同樣是根據原始的排程時區而發出警示。舉例來說,如果使用者位在巴黎,設定於 12 PM CET (Central European Time) 發送警示,結果出差到舊金山時,系統將於 3 AM PDT (Pacific Daylight Time) 發送警示。

-
// This the date to schedule the alarm
-var myDate  = new Date("May 15, 2012 16:20:00");
-
-// This is arbitrary data pass to the alarm
-var data    = {
-  foo: "bar"
-}
-
-// The "honorTimezone" string is what make the alarm honoring it
-var request = navigator.mozAlarms.add(myDate, "honorTimezone", data);
-
-request.onsuccess = function () {
-  console.log("The alarm has been scheduled");
-};
-
-request.onerror = function () {
-  console.log("An error occurred: " + this.error.name);
-};
-
-

管理警示

-

針對目前 App 已排定的警示,MozAlarmsManager.getAll 函式將回傳完整的警示清單。這份清單則為 mozAlarm 物件的陣列

-

mozAlarm

-

這些物件均為非同步 JavaScript 物件,並包含下列屬性:

-
-
- id
-
- 1 組號碼代表警示的 ID
-
- date
-
- Date 物件代表警示的排程時間
-
- respectTimezone
-
- 1 組字串指出警示將遵守或忽略 date 物件的時區資訊。該值可為 ignoreTimezonehonorTimezone
-
- data
-
- 與警示一同儲存的所有資料,均納入此 JavaScript 物件中
-
-
var request = navigator.mozAlarms.getAll();
-
-request.onsuccess = function () {
-  this.result.forEach(function (alarm) {
-    console.log('Id: ' + alarm.id);
-    console.log('date: ' + alarm.date);
-    console.log('respectTimezone: ' + alarm.respectTimezone);
-    console.log('data: ' + JSON.stringify(alarm.data));
-  });
-};
-
-request.onerror = function () {
-  console.log("An error occurred: " + this.error.name);
-};
-
-

MozAlarmsManager.remove 函式則可解除已排程的警示。

-
var alarmId;
-
-// Set an alarm and store it's id
-var request = navigator.mozAlarms.add(new Date("May 15, 2012 16:20:00"), "honorTimezone");
-
-request.onsuccess = function () {
-  alarmId = this.result;
-}
-
-// ...
-
-// Later on, removing the alarm if it exists
-if (alarmId) {
-  navigator.mozAlarms.remove(alarmId);
-}
-
-

處理警示

-

在系統發送警示之後,任何 Apps 均可做出回應。為了要能處理警示,Apps 必須將本身註冊為警示處理器 (Alarm handler)。透過 System Messaging API 的 2 個步驟即可完成註冊:

-

首先,Apps 必須將 alarm 納入本身 manifest 檔案的 message 屬性中,而此 manifest 檔案需包含「已註冊回呼 (Callback) 函式的文件」之網址。一旦發送警示時,就會呼叫該文件中所註冊的回呼函式。

-
"messages": [
-  { "alarm": "/index.html" }
-]
-

其次,Apps 必須以 alarm 訊息綁定回呼函式;可透過 navigator.mozSetMessageHandler 函式完成此步驟。此回呼函式將接收 mozAlarm 物件,其內為警示所附掛的資料。

-
navigator.mozSetMessageHandler("alarm", function (mozAlarm) {
-  alert("alarm fired: " + JSON.stringify(mozAlarm.data));
-});
-
-

如果 App 想確認是否有警示延宕在系統端尚未發出,則可使用navigator.mozHasPendingMessage 函式並搭配 alarm 值。

-
navigator.mozHasPendingMessage("alarm");
-
-

規格

- - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Alarm API')}}{{Spec2('Alarm API')}}Initial specification.
-

瀏覽器相容性

-

{{ CompatibilityTable() }}

-
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatUnknown()}}{{CompatGeckoDesktop("16")}} {{ property_prefix("moz") }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
-
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatUnknown() }}{{ CompatNo() }}{{CompatGeckoMobile("10")}} {{ property_prefix("moz") }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
-

另可參閱

- diff --git a/files/zh-tw/webapi/camera/index.html b/files/zh-tw/webapi/camera/index.html deleted file mode 100644 index f6f1df5e2c..0000000000 --- a/files/zh-tw/webapi/camera/index.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Camera API -slug: WebAPI/Camera -translation_of: Archive/B2G_OS/API/Camera_API ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

Camera API 可讓 Apps 管理裝置上的相機,進一步拍照、錄製影片,並取得如焦距、縮放、白平衡、閃光燈等的資訊。Camera API 屬於 Priviledged API,並僅限 Certified Apps 使用。

-
-

注意:除非你打算建構新 App 以取代預設的「Camera」App,否則應不會使用此 API。如果你只是要使用裝置上的相機功能,則應使用 Web Activities API

-
-

另可參閱

- -

 

diff --git a/files/zh-tw/webapi/contacts/index.html b/files/zh-tw/webapi/contacts/index.html deleted file mode 100644 index 6775c57248..0000000000 --- a/files/zh-tw/webapi/contacts/index.html +++ /dev/null @@ -1,197 +0,0 @@ ---- -title: Contacts API -slug: WebAPI/Contacts -translation_of: Archive/B2G_OS/API/Contacts_API ---- -

{{ SeeCompatTable }}

-

{{ B2GOnlyHeader2('privileged') }}

-

摘要

-

Contacts API 提供簡易的管理介面,可用於系統通訊錄所儲存的聯絡人資訊。Contacts API 的常見使用範例,就是針對通訊錄而建構出管理 Apps。

-
-

注意:由於聯絡人資訊屬於高敏感性的個人資料,因此僅限 Privileged 與 Certified Apps 可直接存取該 API。其他 Apps 均建議透過 Web Activities 而委派相關作業。

-
-

管理聯絡人資訊

-

透過 ContactManager 介面的 navigator.mozContacts 屬性,即可存取儲存於系統通訊錄中的資訊。

-

新增聯絡人

-

若要在系統通訊錄中建立新的項目,可分為 2 個步驟:

-
    -
  1. 建立新的 mozContact 物件,並列出其必要屬性的欄位。mozContact 介面將定義既有聯絡人的所有可能屬性。這些屬性絕大部分均與 vCard 4.0 規格所定義的相同。以下列出例外: - -
  2. -
  3. ContactManager.save() 函式搭配聯絡人物件,並作為第一屬性。此函式將回傳 DOMRequest 以追蹤儲存作業是否成功或發生錯誤。
  4. -
-
var person = new mozContact();
-person.givenName  = ["John"];
-person.familyName = ["Doe"];
-person.nickName   = ["No kidding"];
-
-var saving = navigator.mozContacts.save(person);
-
-saving.onsuccess = function() {
-  console.log('new contact saved');
-  // This update the person as it is stored
-  // It includes its internal unique ID
-  // Note that saving.result is null here
-};
-
-saving.onerror = function(err) {
-  console.error(err);
-};
-
-

尋找聯絡人

-

有 2 個函式可檢索系統通訊錄中的聯絡人:

- -

這 2 組函式都是讓參數 (本身即為物件) 能定義出篩選與排序的選項。ContactManager.getAll 僅接受排序選項。這些選項為:

- -

還有其他搜尋選項:

- -

find 將回傳 DOMRequest 物件;getAll 將回傳 DOMCursor 物件,以存取成功或錯誤的搜尋作業。

-

若搜尋成功,則可於 DOMRequest.result 屬性中找到搜尋結果。可能是 findmozContact 物件陣列;也可能是 getAll 的單一 mozContact 物件。若要以 getAll 接收清單中的其他結果,則可呼叫指示器的 continue() 函式。

-
var options = {
-  filterValue : "John",
-  filterBy    : ["givenName","name","nickName"],
-  filterOp    : "contains",
-  filterLimit : 1,
-  sortBy      : "familyName"
-  sortOrder   : "ascending"
-}
-
-var search = navigator.mozContacts.find(options);
-
-search.onsuccess = function() {
-  if (search.result.length === 1) {
-    var person = search.result[0];
-    console.log("Found:" + person.givenName[0] + " " + person.familyName[0]);
-  } else {
-    console.log("Sorry, there is no such contact.")
-  }
-}
-
-search.onerror = function() {
-  console.warn("Uh! Something goes wrong, no result found!");
-}
-
-var allContacts = navigator.mozContacts.getAll({sortBy: "familyName", sortOrder: "descending"});
-
-allContacts.onsuccess = function(event) {
-  var cursor = event.target;
-  if (cursor.result) {
-    console.log("Found: " + cursor.result.givenName[0] + " " + cursor.result.familyName[0]);
-    cursor.continue();
-  } else {
-    console.log("No more contacts");
-  }
-}
-
-allContacts.onerror = function() {
-  console.warn("Something went terribly wrong! :(");
-}
-
-
-

更新聯絡人

-

在透過 find()getAll() 檢索聯絡人時,又或針對新聯絡人而成功呼叫 save() 時,此聯絡人必須附加某些後設資料 (Meta-data):

- -

若更新某位聯絡人,其實只是更改其屬性值,再呼叫 save() 函式即可儲存。

-
-

注意:每次只要新增、更新、刪除聯絡人,就會觸發 contactchange 事件,以追蹤系統通訊錄的所有變更。另可透過 ContactManager.oncontactchange 屬性而處理該事件。

-
-

刪除聯絡人

-

呼叫 ContactManager.remove() 函式,只會刪除已傳入的 mozContact 物件。

-

在某些極端情況下,也可透過 ContactManager.clear() 而刪除所有的聯絡人。因為一旦完成就沒辦法恢復資料,所以呼叫此函式時請特別謹慎。

-

規格

- - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{ SpecName('Contacts', '', 'Contacts Manager API') }}{{ Spec2('Contacts') }}First Working Draft (未穩定)
vCard Format SpecificationRFCRFC6350
-

瀏覽器相容性

-

{{ CompatibilityTable() }}

-
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
基本支援{{CompatNo()}}{{CompatNo()}}{{CompatNo()}}{{CompatNo()}}{{CompatNo()}}
-
-
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支援{{CompatNo()}}{{CompatNo()}}{{CompatVersionUnknown()}}{{CompatNo()}}{{CompatNo()}}{{CompatNo()}}
-
-

Gecko 說明

-

此規格尚未確定,因此目前 Gecko 仍屬非標準建構。

-

另可參閱

- diff --git a/files/zh-tw/webapi/device_storage/index.html b/files/zh-tw/webapi/device_storage/index.html deleted file mode 100644 index d09fd49015..0000000000 --- a/files/zh-tw/webapi/device_storage/index.html +++ /dev/null @@ -1,228 +0,0 @@ ---- -title: Device Storage API -slug: WebAPI/Device_Storage -translation_of: Archive/B2G_OS/API/Device_Storage_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('privileged') }}

-

摘要

-

Device Storage API 可存取 Web Apps 中的檔案系統。存取檔案系統可能牽涉極高的安全敏感度,所以此 API 僅可用於 Privileged Apps。

-
-

注意:若裝置儲存媒體的存取速度極慢,可能是受限於實體層 (Physical level) 的關係。在許多情況下,若以 IndexedDB 資料庫儲存檔案,取代實體的裝置儲存媒體,將可達到更高的速度。

-
-

存取儲存媒體

-

進入點

-

若使用 navigator.getDeviceStorage() 函式,則可存取儲存區。此函式所接受的字串參數,可代表所要存取的儲存媒體名稱。函式回傳的 DeviceStorage 物件,可存取相關的儲存區。

-

Firefox OS 提供下列儲存名稱:

- -
var pics = navigator.getDeviceStorage('pictures');
-

為了要能使用所有儲存區,Apps 必須在自己的 manifest 檔案中載明這些儲存區。舉例來說,如果 Apps 要存取 sdcard 儲存區,則其 manifest 檔案中必須具備「device-storage:sdcard」的授權。

-
"permissions": {
-  "device-storage:videos":{ "access": "readonly" },
-  "device-storage:pictures":{ "access": "readwrite" }
-}
-

使用儲存媒體

-

只要 Apps 能夠存取儲存區,就可在該儲存區中新增、取得、移除檔案。

-

新增檔案

-

透過 addNamedadd 函式,即可新增檔案。前者可在儲存檔案時,設定明確的名稱;而後者則可自動建立名稱。這 2 組函式均屬非同步函式,並將回傳 DOMRequest 物件以處理作業的 successerror 狀態。因為在實體層上讀/寫檔案極為緩慢,所以此作業特別重要。

-

這 2 組函式均以 Blob 作為其第一參數。此物件將於背景之下轉為檔案並儲存起來。當建立 Blob 物件時將強制給予其 type,而因為某些儲存區會因類型而有所限制,所以此 MIME 類型格外重要:

- -
var sdcard = navigator.getDeviceStorage("sdcard");
-var file   = new Blob(["This is a text file."], {type: "text/plain"});
-
-var request = sdcard.addNamed(file, "my-file.txt");
-
-request.onsuccess = function () {
-  var name = this.result;
-  console.log('File "' + name + '" successfully wrote on the sdcard storage area');
-}
-
-// An error typically occur if a file with the same name already exist
-request.onerror = function () {
-  console.warn('Unable to write the file: ' + this.error);
-}
-
-
-

注意:儲存區中的 Repository (Repo) 屬於隱性 (Implicit),因此不能建立顯性 (Explicit) 的空白 Repo。如果要使用 Repo 的結構,則必須針對 Repo 的名稱,使之成為儲存檔案名稱的一部分。所以,如果你要在 foo 庫中儲存 bar 檔案,就必須使用 addNamed 函式再搭配 addNamed(blob, "foo/bar") 檔案的完整路徑名稱。一旦要使用這個名稱檢索檔案,也可使用同樣的方式 (參閱下列)。

-

基於安全理由,如果檔案新增於既定的受限儲存區內,則檔案路徑名稱不能以「/」或「../」開頭 (且「./」為無意義)。

-
-

取得檔案

-

現有 2 種方法可檢索檔案:使用檔案名稱,或依序存取檔案列表。

-

最簡單的方式,就是使用 getgetEditable 函式來檢索檔案。前者可提供File 物件,即如同唯讀檔案一樣;後者則提供 FileHandle 物件,可更新底層檔案 (Under-laying file)。這 2 組函式均屬非同步函式,並會回傳 DOMRequest 物件,以處理作業的 successerror 狀態。

-
var sdcard = navigator.getDeviceStorage('sdcard');
-
-var request = sdcard.get("my-file.txt");
-
-request.onsuccess = function () {
-  var file = this.result;
-  console.log("Get the file: " + file.name);
-}
-
-request.onerror = function () {
-  console.warn("Unable to get the file: " + this.error);
-}
-
-

另一個檔案檢索方式,就是透過 enumerateenumerateEditable 函式瀏覽儲存區的內容。前者可提供 File 物件;後者則提供 FileHandle 物件。此 2 組均為非同步函式,並可回傳 DOMCursor 物件以依序存取檔案列表。DOMCursor 其實就是 DOMRequest,但又額外具備「非同步依序存取列表 (這裡則指檔案列表)」的功能。

-
var pics = navigator.getDeviceStorage('pictures');
-
-// Let's browse all the images available
-var cursor = pics.enumerate();
-
-cursor.onsuccess = function () {
-  var file = this.result;
-  console.log("File found: " + file.name);
-
-  // Once we found a file we check if there is other results
-  if (!this.done) {
-    // Then we move to the next result, which call the cursor
-    // success with the next file as result.
-    this.continue();
-  }
-}
-
-cursor.onerror = function () {
-  console.warn("No file found: " + this.error);
-}
-
-
-

只要傳送 2 組選擇性參數至 enumerateenumerateEditable 函式,即可限制結果的數量。

-

第一組參數可為字串,代表所要搜尋的子資料夾。

-

第二組參數則是具備 since 屬性的物件,可限制在既定期間內搜尋。

-
var pics = navigator.getDeviceStorage('pictures');
-
-// Lets retrieve picture from the last week.
-var param = {
-  since: new Date((+new Date()) - 7*24*60*60*1000)
-}
-
-var cursor = pics.enumerate(param);
-
-cursor.onsuccess = function () {
-  var file = this.result;
-  console.log("Picture taken on: " + file.lastModifiedDate);
-
-  if (!this.done) {
-    this.continue();
-  }
-}
-
-
-

刪除檔案

-

透過 delete 函式,即可從儲存區移除檔案。此函式僅需所要刪除的檔案名稱。如同來自於 DeviceStorage 介面的其他所有函式,此函式亦屬於非同步 API,並會回傳 DOMRequest 物件,以處理作業的 successerror 的狀態。

-
var sdcard = navigator.getDeviceStorage('sdcard');
-
-var request = sdcard.delete("my-file.txt");
-
-request.onsuccess = function () {
-  console.log("File deleted");
-}
-
-request.onerror = function () {
-  console.log("Unable to delete the file: " + this.error);
-}
-
-
-

儲存資訊

-

除了存取檔案之外,儲存區亦提供數個函式,可輕鬆取得某些重要資訊。

-

可用空間

-

在儲存檔案時,必須先了解的要素之一就是可用空間。DeviceStorage 介面則針對空間而提供 2 組有用函式:

- -

這些函式亦屬於非同步 APIs,並會回傳 DOMRequest 物件,以處理作業的 successerror 的狀態。

-
var videos = navigator.getDeviceStorage('videos');
-
-var request = videos.usedSpace();
-
-request.onsuccess = function () {
-  // The result is express in bytes, lets turn it into megabytes
-  var size = this.result / 1000000;
-
-  console.log("The videos on your device use a total of " + size.toFixed(2) + "Mo of space.");
-}
-
-request.onerror = function () {
-  console.warn("Unable to get the space used by videos: " + this.error);
-}
-
-

監聽變動狀態

-

可能有許多 Apps 同時存取相同的儲存區。如果 Apps 能知道儲存區中的變化,則可避免不必要的錯誤。又若 Apps 不依賴 DeviceStorage 介面的函式所回傳的 DOMRequest 物件,卻需執行非同步作業,那得知儲存區的變化亦頗有助益。

-

因為如此,只要建立、修改、刪除了某個檔案,就會觸發 change 事件。而透過 onchange 屬性或 addEventListener() 函式,即可取得這個事件。而事件處理器 (Event Handler) 所取得的 DeviceStorageChangeEvent 物件,則是擁有額外 2 組屬性的常態 Event 物件:

- -
var sdcard = navigator.getDeviceStorage('sdcard');
-
-sdcard.onchange = function (change) {
-  var reason = change.reason;
-  var path   = change.path;
-
-  console.log('The file "' + path + '" has been ' + reason);
-}
-
-

規格

-

目前尚無規格。

-

瀏覽器相容性

-

{{ CompatibilityTable() }}

-
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
-
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
-

另可參閱

- diff --git a/files/zh-tw/webapi/idle/index.html b/files/zh-tw/webapi/idle/index.html deleted file mode 100644 index e4eaaaaac2..0000000000 --- a/files/zh-tw/webapi/idle/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: Idle -slug: WebAPI/Idle -translation_of: Archive/B2G_OS/API/Idle_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

摘要

-

當使用者讓裝置進入閒置/待機狀態,可通知 App 以採取相對應的行動。最常見的情形就是待機省電。而待機省電狀態又可另外搭配 Power Management API

-

Idle Observer

-

若要讓任一 App 收到「系統閒置」的通知,就必須先註冊 Idle Observer。而 Idle Observer 物件具備了 3 項屬性:

- -
// NOTE: mozPower is part of the Power Management API
-
-var fadeLight = {
-  time: 10, // Ten seconds
-
-  onidle: function () {
-    // The user does not seem active, let's dim the screen down
-    navigator.mozPower.screenBrightness = 0.5;
-  },
-
-  onactive: function () {
-    // Ok, the user is back, let's brighten the screen up
-    navigator.mozPower.screenBrightness = 1;
-  }
-}
-
-var screenOff = {
-  time: 15, // fifteen seconds
-
-  onidle: function () {
-    // Ok, the user had his chance but he's really idle, let's turn the screen off
-    navigator.mozPower.screenEnabled = false;
-  },
-
-  onactive: function () {
-    // Ok, the user is back, let's turn the screen on
-    navigator.mozPower.screenEnabled = true;
-  }
-}
-
-

任一 App 均可依需要而定義為多個 Idle Observer。但不論定義成幾個 Idle Observer,都必須以 navigator.addIdleObserver() 函式完成註冊,才能由系統所處理。

-
navigator.addIdleObserver(fadeLight);
-navigator.addIdleObserver(screenOff);
-
-

又如果 App 不再需要知道使用者是否閒置了系統,則可透過 navigator.removeIdleObserver() 函式移除 Idle Observer。

-
navigator.removeIdleObserver(fadeLight);
-navigator.removeIdleObserver(screenOff);
-
-

規格

-

目前仍未有任何規格,但 W3C 將此 API 納入為 System Applications Working Group 討論的一部分。

-

另可參閱

- diff --git a/files/zh-tw/webapi/network_stats/index.html b/files/zh-tw/webapi/network_stats/index.html deleted file mode 100644 index c9aa8a94c1..0000000000 --- a/files/zh-tw/webapi/network_stats/index.html +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: 網路流量統計 -slug: WebAPI/Network_Stats -translation_of: Archive/B2G_OS/API/Network_Stats_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

摘要

-

Network Stats API 將監控資料用量,並將此數據提供給 Certified Apps。

-

navigator.mozNetworkStats 屬於 MozNetworkStatsManager 介面的實體 (Instance)。透過 navigator.mozNetworkStats 即可取得相關資料。

-

存取資料

-

有關已接收/已傳送資料量的資訊,均將由系統自動儲存。而 MozNetworkStatsManager.getNetworkStats() 函式可存取相關資訊。此函式的第一組參數屬於組態物件,且必備下列屬性:

- -

一旦呼叫此函式,隨即回傳 DOMRequest 以處理資訊請求的成功或失敗狀態。若為成功狀態,則請求的 result 即為 MozNetworkStats 物件。

-
var manageWifi   = navigator.mozNetworkStats.connectionTypes.indexOf('wifi')   > -1;
-var manageMobile = navigator.mozNetworkStats.connectionTypes.indexOf('mobile') > -1;
-
-var config = {
-  start: new Date(),
-  end  : new Date(),
-  connectionType: manageWifi ? 'wifi' : null
-};
-
-var request = navigator.mozNetworkStats.getNetworkStats(config);
-
-request.onsuccess = function () {
-  console.log("Data received: " + request.result.data[0].rxBytes + " bytes");
-  console.log("Data sent: " + request.result.data[0].txBytes + " bytes")
-}
-
-request.onerror = function () {
-  console.log("Something goes wrong: ", request.error);
-}
-
-

隨著時間連續取樣

-

資料總量的相關資訊均儲存於區塊 (Chunk) 中,以利隨時查看資料流量。各個區塊均為 1 組值,代表上個區塊儲存之後所交換的資料總量。

-

在請求統計資料時,MozNetworkStats 物件將針對 startend 日期之間所定義的間隔,儘量攜帶夠多的資料區塊。區塊的總數將因下列 2 組參數 (均屬唯讀參數) 而有所變化:

- -

各個資料區塊均為 1 個 MozNetworkStatsData 物件。透過MozNetworkStats.data 屬性即可取得各個既定時間框架 (Time frame) 的所有資料區塊,進而形成 MozNetworkStatsData 物件的 Array

-
var rate = navigator.mozNetworkStats.sampleRate;
-var max  = navigator.mozNetworkStats.maxStorageSample;
-
-var config = {
-  start: new Date() - (rate * max), // This allows to get all the available data chunks.
-  end  : new Date(),
-  connectionType: 'mobile'
-};
-
-var request = navigator.mozNetworkStats.getNetworkStats(config);
-
-request.onsuccess = function () {
-  var total = {
-    receive: 0,
-    send   : 0
-  };
-
-  this.result.forEach(function (chunk) {
-    total.receive += chunk.rxBytes;
-    total.send    += chunk.txBytes;
-  });
-
-  console.log("Since: " + config.start.toString());
-  console.log("Data received: " + (total.receive * 1000).toFixed(2) + "Ko");
-  console.log("Data sent: " + (total.send * 1000).toFixed(2) + "Ko")
-}
-
-request.onerror = function () {
-  console.log("Something goes wrong: ", request.error);
-}
-

規格

-

尚無任何規格。

-

另可參閱

- diff --git a/files/zh-tw/webapi/power_management/index.html b/files/zh-tw/webapi/power_management/index.html deleted file mode 100644 index da501d4238..0000000000 --- a/files/zh-tw/webapi/power_management/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: Power Management -slug: WebAPI/Power_Management -translation_of: Archive/B2G_OS/API/Power_Management_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

摘要

-

Power Management API 可管理裝置的耗電情形。

-

管理電力

-

電力管理與電力本身不盡相同,如避免大量耗電、限制回流 (Reflow) 等等,都屬於電源管理的一部分。而 Power Management API 則直接控管如 CPU 與螢幕等的耗電量。透過 navigator.mozPower 即可存取電力管理的主要介面。而 navigator.mozPower 則為 PowerManager 介面的實例 (Instance)。

-

基本電力操作

-

PowerManager 介面可管理基本的電力操作情形。

-

通用電力操作

-

powerOff() 函式可關閉裝置;reboot() 函式則可重新開機。

-
navigator.mozPower.powerOff();
-

螢幕電力操作

-

透過可讀寫的 screenEnabled 屬性即可開/關螢幕畫面;而存取/更改畫面亮度也能達到相同效果。如可讀寫的 screenBrightness (用以定義螢幕背光的亮度) 就能變更畫面亮度,可調整為 0 (全暗) 到 1 (全亮)。

-
// It doesn't make sense to change the brightness if the screen is off
-if (navigator.mozPower.screenEnabled) {
-  navigator.mozPower.screenBrightness = 0.5;
-}
-

CPU 電力操作

-

目前並無法直接關閉 CPU。但可進一步設定 cpuSleepAllowed,以決定關閉畫面之時是否要關閉 CPU。在畫面關閉 (true) 或開啟 (false) 時,此函式可定義是否讓裝置的 CPU 休眠。若畫面處於開啟狀態 (false),則該函式將避免裝置進入靜止狀態。

-

進階電力操作

-

若管理電力的 Apps 可確實接收到第三方 Apps 的需求通知,就能達到更好的電力管理效果。舉例來說,在使用者欣賞影片時,當然不希望系統在幾分鐘之後自動關閉畫面。

-

請求 Wake locks

-

任何 Apps 均可請求 Wake locks,避免裝置切斷 Apps 本身所需資源的電力。可透過 navigator.requestWakeLock() 函式請求 Wake locks。

-

特定資源所要求的 Wake locks,可能會因不同的理由而取消。舉例來說,行動裝置的電力管理功能,可能會在閒置一段時間之後決定關閉畫面,進而達到省電目的。在關閉相關資源之前,處理資源的 Apps 往往會檢查相關資源的鎖定狀態。再舉個例子,某個頁面可能持續 screen 上的鎖定狀態,以避免畫面關閉或螢幕保護程式運作。

-

依預設值,Firefox OS 允許 screen、cpu、wifi 資源。但只要是處理資源的任何 App 均可定義資源名稱,並針對該鎖定功能設定規則。舉例來說,資源管理功能可無視 Apps 對 screen 所進行的 Wake locks,讓 Apps 無法插手鎖定狀態。

-
var lock = navigator.requestWakeLock('screen');
-

requestWakeLock 函式所回傳的物件將包含 topic 屬性,代表目前要鎖定的資源。而 unlock() 函式可供手動解鎖。另請注意,若 App 進入關閉狀態 (真的關閉,而不是閒置),就會自動送出該 App 需要的所有鎖定請求。

-

處理 Wake locks

-

只要是可管理鎖定的 Certified Apps,均可得知鎖定狀態的變化。其實任何管理電力的 Apps 均應監聽 screencpu 鎖定狀態的變化。透過 PowerManager.addWakeLockListener() 函式即可達到此目的。另可透過 PowerManager.removeWakeLockListener() 函式而停止監聽鎖定請求。

-

addWakeLockListener 函式所接收的回呼 (Callback) 需具備 2 組參數。第一組字串代表應處理的資源 (本範例為 screencpu);第二組字串則代表鎖定的狀態。

-

鎖定可分為 3 種狀態:

-
-
- unlocked
-
- 沒有任何 App 針對既有資源持續 Wake lock。
-
- locked-foreground
-
- 至少 1 個 App 持續 Wake lock,且於前景顯示該 App。
-
- locked-background
-
- 至少 1 個 App 持續 Wake lock,但所有 Apps 均在背景而未顯示。
-
-
// This is used to keep track of the last change on the lock state
-var screenTimeout;
-
-// A reference to the Power Manager
-var power = window.navigator.mozPower;
-
-// Here are the actions to handle based on the lock state
-var powerAction = {
-
-  // If there is no lock at all, we will suspend the device:
-  // * Turn the screen off
-  // * Allow the cpu to shut down
-  unlocked: function suspendDevice() {
-    power.cpuSleepAllowed = true;
-    power.screenEnabled   = false;
-  },
-
-  // If there is a lock but the applications requesting it
-  // are all in the background, we just turn the screen off
-  'locked-background': function shutOffOnlyScreen() {
-    power.cpuSleepAllowed = false;
-    power.screenEnabled   = false;
-  },
-
-  // At last, if there is an active application that requests a lock,
-  // actually there is nothing to do. That's the whole point.
-}
-
-function screenLockListener(topic, state) {
-  // If the lock is not about the screen, there is nothing to do.
-  if ('screen' !== topic) return;
-
-  // Each time the lock changes state, we stop any pending power management operations
-  window.clearTimeout(screenTimeout);
-
-  // If there is an action defined for the given state
-  if (powerAction[state]) {
-    // We delay that action by 3s
-    screenTimeout = window.setTimeout(powerAction[state], 3000);
-  }
-}
-
-// We make sure our power management application is listening for any change on locks.
-power.addWakeLockListener(screenLockListener);
-

規格

-

尚無任何規格。

-

另可參閱

- diff --git a/files/zh-tw/webapi/settings/index.html b/files/zh-tw/webapi/settings/index.html deleted file mode 100644 index 2e5198a2a0..0000000000 --- a/files/zh-tw/webapi/settings/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Settings API -slug: WebAPI/Settings -translation_of: Archive/B2G_OS/API/Settings_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

摘要

-

Settings API 可存取、變更、監聽裝置設定的任何變化。裝置的設定選項可能帶有高敏感度的資訊並可能危害整個系統,因此僅限 Certified Apps 可使用此 API。

-

使用設定選項

-

透過 naviator.mozSettings 物件 (即 SettingsManager 介面的實例),即可操作設定選項。

-

存取設定選項

-

若要存取設定選項,必須先以 createLock() 函式建立鎖定機制。因為可能有多個 Apps 同時存取並更改設定,所以必須確保各個 App 不會受到其他 Apps 的影響。而建立鎖定機制之後,各個 App 均可於特定時間單獨存取設定。

-

在 Apps 擁有鎖定機制後,即可透過 get() 函式讀取任何設定。此函式將回傳 DOMRequest 物件,以處理成功或失敗的作業。不論任何狀況下,只要完成了成功/失敗的請求,均會自動解鎖之後才讓其他 Apps 存取設定。若有必要,也可透過鎖定機制的 closed 屬性,得知是否已解開鎖定。

-

在下列程式碼片段中,則建立了鎖定並請求了系統 wifi.enabled 設定的數值。另呼叫 console.log() 即可於主控台上顯示輸出的結果:

-
var lock    = navigator.mozSettings.createLock();
-var setting = lock.get('wifi.enabled');
-
-setting.onsuccess = function () {
-  console.log('wifi.enabled: ' + setting.result);
-}
-
-setting.onerror = function () {
-  console.warn('An error occured: ' + setting.error);
-}
-
-

更改設定

-

設定值的更改程序與存取程序完全相同,但必須呼叫 set() 函式,此函式將回傳 DOMRequest 物件,讓你知道設定更改請求是否成功。

-

set() 函式會將物件作為自己的輸入參數。此物件為鍵值/數值的集合,而各個鍵值即代表 1 組設定的名稱,對應的數值又是設定的新數值。可參閱 Firefox OS 設定清單以進一步了解 (另請注意,不同裝置所使用的設定亦將有所差異)。

-

這裡可看到建立的 1 組鎖定,並於主控台上顯示 wifi.enabled 設定的結果。

-
var lock = navigator.mozSettings.createLock();
-var result = lock.set({
-  'wifi.enabled': true
-});
-
-result.onsuccess = function () {
-  console.log("the settings has been changed");
-}
-
-result.onerror = function () {
-  console.log("An error occure, the settings remain unchanged");
-}
-

監聽設定中的變化

-

App 除了讀取、更改設定之外,亦可監聽發生過的任何變更。只要變更過設定,系統隨即觸發 settingchange 事件。此事件為 MozSettingEvent。此常態事件又可透過 2 項額外屬性進一步延伸:

- -

只要設定 SettingsManager.onsettingchange 以指定 1 組回呼 (Callback,只要設定改變就會呼叫該回呼) 即可監聽 settingchange 事件。如果只想監聽某一特定設定的變化,則可呼叫如下的 SettingsManager.addObserver() 函式:

-
function handleWifi(event) {
-  if (event.settingValue === true) {
-    console.log("Hey! I can download that crazy heavy 4GB file")
-  } else {
-    console.log("Oh! I should stop downloading that crazy 4GB file")
-  }
-}
-
-navigator.mozSettings.addObserver('wifi.enabled', handleWifi);
-
-

 

-

規格

-

目前仍未有任何規格。可參與 W3C 於 System Applications Working Group 中對此API 的討論。

-

另可參閱

- diff --git a/files/zh-tw/webapi/simple_push/index.html b/files/zh-tw/webapi/simple_push/index.html deleted file mode 100644 index da0015bd11..0000000000 --- a/files/zh-tw/webapi/simple_push/index.html +++ /dev/null @@ -1,115 +0,0 @@ ---- -title: Simple Push API -slug: WebAPI/Simple_Push -translation_of: Archive/B2G_OS/API/Simple_Push_API ---- -

{{ SeeCompatTable() }}

-

Simple Push API 也是所謂的 Push Notification API,可在接收通知時喚醒 App。多個 App 可請求「共用其伺服器」的單一網址,以便傳送 App 的後續版本號碼。另外亦可作為同步化機制,從第三方伺服器取得最新資料。

-

SimplePush API 可透過 push 屬性 (來自於 PushManager 專案) 而擴充 window.navigator,並添增新的事件給使用者,以監控推播 (Push) 的狀態。

-

範例

-

在本範例中,我們將依照下列步驟而設定完整的推播:

-
    -
  1. push 的授權新增至 manifest 檔案中
  2. -
  3. 呼叫 push.register() 以請求終端 (Endpoint)
  4. -
  5. 將終端傳送到自己的伺服器
  6. -
  7. 針對 App 之內的推播通知,新增訊息處理器 (Message handler)
  8. -
  9. 從自己的伺服器中送出通知
  10. -
-

修改 manifest 檔案

-

另外需修改 manifest 檔案中的 2 個地方:

-
    -
  1. messages 欄位:新增 pushpush-register 訊息。
  2. -
  3. permissions 欄位:新增想要接收推播通知的 App。
  4. -
-
"messages": [
-   { "push": "/index.html"},
-   { "push-register": "/index.html"}
-],
-"permissions": {
-  "push": {
-    "description": "Required for be updated with new goals in soccer matchs",
-  }
-}
-

呼叫 {{domxref("PushManager.register")}} 以請求終端

-

一旦你認為該是請求終端的時候 (例如使用者登入,或有人想看場棒球賽的時候),即可呼叫此程式碼。

-
if (navigator.push) {
-  var req = navigator.push.register();
-
-  req.onsuccess = function(e) {
-    var endpoint = req.result;
-      debug("New endpoint: " + endpoint );
-    }
-
-   req.onerror = function(e) {
-     debug("Error getting a new endpoint: " + JSON.stringify(e));
-   }
-} else {
-  // No push on the DOM
-}
-

將終端傳送至自己的伺服器

-

一旦獲得終端之後,就必須將之傳送至自己的 App 伺服器上。現有很多傳送終端的方法,如寄送電子郵件,或透過 POST、PUT、GET 均可傳送終端。我們建議以「來自於 App 的使用者資料」來儲存終端,例如 cookie、使用者名稱,或任何你用來識別終端使用者的資料均可。

-

但如果你正把資料傳送到伺服器,我們還是建議下列要點:

-
    -
  1. 以 XMLHttpRequest 傳送。
  2. -
  3. 最好使用 HTTPS。如果某人中斷了你的終端,即可開始將通知傳送到自己的 App。
  4. -
  5. 使用如 cookie 的機制,可比對使用者 (或 App 安裝作業) 與終端。
  6. -
-

新增 push 訊息處理器

-

一旦設定終端完畢,就可讓 App 開始監聽推播訊息。此功能亦可註冊在主要的 index.html 檔案,或註冊在自己的 main.js 指令碼中;也能註冊在特殊的 push-message.html 檔案 (特殊之處在於該檔案之內僅有指令碼) 上。這功能之所以方便的原因在於:如果接收到 push 訊息且 App 處於關閉狀態時,則該 App 只會載入一小部分的 HTML/JavaScript 程式碼,而且你也可以決定是否要完全開啟 App,或在背景中執行某些作業即可。

-
if (window.navigator.mozSetMessageHandler) {
-  window.navigator.mozSetMessageHandler('push', function(e) {
-    debug('My endpoint is ' + e.pushEndpoint);
-    debug('My new version is ' +  e.version);
-    //Remember that you can handle here if you have more than
-    //one pushEndpoint
-    if (e.pushEndpoint === emailEndpoint) {
-      emailHandler(e.version);
-    } else if (e.pushEndpoint === imEndpoint) {
-      imHandler(e.version);
-    }
-  });
-} else {
-  // No message handler
-}
-

新增 push-register 訊息處理器

-
-

請確實添增此處理器,並檢查是否正常運作。只要在產生 push-register 訊息當下,你並未重新註冊自己的終端,則之後將無法繼續接收其他推播通知。

-
-

一旦裝置變更了自己的 UAID (可能是因為推播伺服器變更,或當機之後需恢復作業,或其他更多情形),就會將 push-register 訊息傳送至所有 App。也就是說,因為你之前的終端均已無效,所以你必須再次重新註冊所有的終端。

-
if (window.navigator.mozSetMessageHandler) {
-  window.navigator.mozSetMessageHandler('push-register', function(e) {
-    console.log('push-register received, I need to register my endpoint(s) again!');
-
-    var req = navigator.push.register();
-    req.onsuccess = function(e) {
-      var endpoint = req.result;
-      console.log("New endpoint: " + endpoint );
-      localStorage.endpoint = endpoint;
-    }
-
-    req.onerror = function(e) {
-      console.error("Error getting a new endpoint: " + JSON.stringify(e));
-    }
-  });
-} else {
-  // No message handler
-}
-

傳送通知

-

一旦你的伺服器擁有 endpoint 之後,「傳送通知」就如同「將 HTTP PUT 的請求 (其內容具備 version=<version>) 傳送至終端」一樣簡單。先假想某個終端具備下列網址:

-

https://push.src.openwebdevice.com/v1/notify/abcdef01234567890abcdefabcdef01234567890abcdef

-

而且是版本 5:

-

version=5

-

搭配 curl:

-

curl -X PUT -d "version=5" https://push.src.openwebdevice.com/v1/notify/abcdef01234567890abcdefabcdef01234567890abcdef

-

如果伺服器正確運作,所取得的反應內容就會包含 200 Status (OK){} 各 1 組作為內容 (Body)。如果發生錯誤,則會送出有效的 JSON 以解釋該錯誤。

-

另請注意,版號應該為逐漸遞增的整數。如果新版本的版號,小於裝置/伺服器上已儲存的版本,則 App 不會獲得新的通知。

-

規格

-

{{page("/en-US/docs/Web/API/PushManager","Specifications")}}

-

瀏覽器相容性

-

{{page("/en-US/docs/Web/API/PushManager","Browser_compatibility")}}

-

另可參閱

- diff --git a/files/zh-tw/webapi/tcp_socket/index.html b/files/zh-tw/webapi/tcp_socket/index.html deleted file mode 100644 index ae0c75e434..0000000000 --- a/files/zh-tw/webapi/tcp_socket/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: TCP Socket -slug: WebAPI/TCP_Socket -translation_of: Archive/B2G_OS/API/TPC_Socket_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('privileged') }}

-

摘要

-

TCPSocket API 可開啟並使用 TCP 連線,亦可讓 Apps 開發者基於 TCP 架構,建構相關通訊協定 (如 IMAP、IRC、POP、HTTP等);甚至建立自己所需的協定以滿足特殊需求。

-

概述

-

透過 navigator.mozTCPSocket 屬性 (本身為 TCPSocket 物件) 即可存取此 API。

-

開啟 Socket

-

TCPSocket.open() 函式即可開啟 Socket。該函式共有 3 組參數:

-
    -
  1. 以 1 組字串代表所要連線的伺服器主機名稱 (亦可為該伺服器的原始 IP 位址)。
  2. -
  3. 以 1 組數字代表 Socket 所要使用的 TCP 通訊埠 (某些協定擁有標準埠,如 HTTP 為 80、SSL 為 447、SMTP 為 25 等。若為 1024 以上的通訊埠數字,則不會用於任何特定的通訊協定,也就是說可用於任何用途)。
  4. -
  5. 最後是 1 組選填的物件,內含最多 2 個選項。
    - i.) 名為 useSSL 的 Boolean 值,代表 Socket 必須使用 SSL,預設值為 false。
    - ii.) 名為 binaryType 的字串,可指定 Apps 透過 data 事件所取得的資料型態,可為 stringarraybuffer 值。預設值為 string
  6. -
-
var socket = navigator.mozTCPSocket.open('localhost', 80);
-
-

注意:僅限 Certified Apps 可使用 1024 以下的通訊埠。

-
-

傳送資料

-

TCPSocket.send() 函式將透過 1 組字串,或 1 組 Uint8Array 物件而傳送資料。另請注意,由於 TCP Socket 僅處理二進制資料,因此使用 Uint8Array 可達較高的安全性。

-

對 TCP 通訊協定而言,單次傳輸量最好以 64kb 為上限而能達到最佳效果。只要緩衝的資料不到 64kb,送至 send 函式的呼叫即會回傳 true。一旦緩衝區滿載,則函式隨即回傳 false,進而要求該 App 暫停並清空緩衝區。每次只要清空緩衝區就會發出 drain 事件,讓該 App 針對此事件再度開始傳送資料。

-

透過 TCPSocket.bufferedAmount 屬性,即可得知目前已緩衝的實際資料量。

-
function getData() {
-  var data;
-
-  // do stuff that will retrieve data
-
-  return data;
-}
-
-function pushData() {
-  var data;
-
-  do {
-    data = getData();
-  } while (data != null && socket.send(data));
-}
-
-// Each time the buffer is flushed
-// we try to send data again.
-socket.ondrain = pushData;
-
-// Start sending data.
-pushData();
-
-

取得資料

-

只要 Socket 獲得主機所傳來的資料,就會發出 data 事件。App 可透過此事件而存取來自於 Socket 的資料。當 Socket 為開啟狀態時,則資料型態將根據已設定的選項而有所不同 (可參閱前述的第三種參數)。

-
socket.ondata = function (event) {
-  if (typeof event.data === 'string') {
-    console.log('Get a string: ' + event.data);
-  } else {
-    console.log('Get a Uint8Array');
-  }
-}
-

在送出所需的 data 事件之後,有時也必須暫停後續資料流入。此時呼叫 TCPSocket.suspend() 函式,即可暫停讀取後續資料並停止發送 data。若要再次開始讀取資料並發送事件,則可呼叫 TCPSocket.resume() 函式。

-

關閉 Socket

-

TCPSocket.close() 可關閉 Socket。

-

標準

-

尚未有任何規格。若要進一步了解此 API,可至 W3C 的 Raw Sockets 提案之下,參閱 System Applications Working Group 的相關討論。

-

另可參閱

- diff --git a/files/zh-tw/webapi/time_and_clock/index.html b/files/zh-tw/webapi/time_and_clock/index.html deleted file mode 100644 index aa772cf083..0000000000 --- a/files/zh-tw/webapi/time_and_clock/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Time and Clock API -slug: WebAPI/Time_and_Clock -translation_of: Archive/B2G_OS/API/Time_and_Clock_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('certified') }}

-

摘要

-

Time/Clock API 可輕鬆更改系統的時間。

-

概述

-

此 API 可被存取,且回傳的物件可揭露單一函式。

-

而該函式可用以實際更改系統時間,並接受某個數字或 Date 物件作為參數。在提供了數字之後,就會開始 1970 年 1 月 1 日 (UTC 時區) 起算的時間,並以毫秒 (Millisecond) 計算。

-

每次只要更改了時間,就會啟動事件。而只要透過函式 (使用 moztimechange 事件名稱),或將事件處理器 (Event Handler) 附加至屬性,即可在 window 物件層級擷取到該事件。

-
-

注意:如果你要更改自己裝置的時區,就必須使用 Settings API

-
-

範例

-
function setTime(time) {
-  navigator.mozTime.set(time);
-}
-
-window.addEventListener('moztimechange', function () {
-  console.log('Time has changed');
-});
-
-setTime(new Date());
-
-
-

規格

-

不屬於任何規格

diff --git a/files/zh-tw/webapi/web_activities/index.html b/files/zh-tw/webapi/web_activities/index.html deleted file mode 100644 index 6c71c46bd8..0000000000 --- a/files/zh-tw/webapi/web_activities/index.html +++ /dev/null @@ -1,415 +0,0 @@ ---- -title: Web Activities -slug: WebAPI/Web_Activities -translation_of: Archive/B2G_OS/API/Web_Activities ---- -

{{ non-standard_header() }}

-

{{B2GOnlyHeader2('installed')}}

-

摘要

-

Web Activities 即定義「App 將 Activity 委託 (Delegate) 予另一個 App (往往是由使用者所選擇)」的方法。

-

Web Activities 目前僅能用於 Firefox OS 上,而完整規格可參閱 WikiMo

-

Activity

-

所謂「Activity」就是使用者想做的事情,如選取影像、傳送電子郵件等。App 開發者可能會定義某個 App 去處理該 Activity,或定義某個 App 委託予 Activity。

-

將 App 註冊為 Activity handler

-

App 開發者可建構 App 以處理單或多個 Activity。也就是說,這個 App 可經由其他 App 呼叫之後,而執行 Activity 所定義的某些特定動作。舉例來說,我們可能用其他 App 呼叫相片管理 App,進而選取相片。若 App 是作為 Activity Handler,就會成為其他 App 作業流程的一部分。

-

註冊 Activity

-

如果要將 App 註冊為 Activity Handler,目前唯一方法就是到 App 的 manifest 檔案中宣告。

-
-

注意:任何 App 均可針對現有的 Activity,將本身註冊為 Activity Handler;亦可建立自己的 Activity。不論是哪種情況,對 manifest 檔案的處理方式都相同。但若要建立新的 Activity,最好是在新 Activity 名稱的前方加上網址 (例如 example.org/myActivity org.example.myActivity),以避免發生衝突。

-
-

App manifest (亦所謂的宣告註冊)

-

如同下列範例所示,必須透過 App 的 manifest 檔案,宣告 App 將會處理 Activity:

-
{
-  // Other App Manifest related stuff
-
-  // Activity registration
-  "activities": {
-
-    // The name of the activity to handle (here "pick")
-    "pick": {
-      "href": "./pick.html",
-      "disposition": "inline",
-      "filters": {
-        "type": ["image/*","image/jpeg","image/png"]
-      },
-      "returnValue": true
-    }
-  }
-}
-
-

動態註冊

-

透過 navigator 物件,即可讓 App 動態的註冊自己。但目前尚未提供此 API。可留意 bug 775181 以持續追蹤此 API。

-

Activity Handler 說明

-
-
- href
-
- 當其他 App 或網頁所啟動的 Activity,同樣也受到此 App 所支援時,則只要選定此 App 執行 Activity,則 href 將指定所應開啟的網頁。另可透過 disposition 屬性指定網頁的開啟方式。 -
- 注意:此頁面的 URL 將受到同源規範 (Same-origin policy) 的限制。
-
-
-
-
- disposition {{optional_inline()}}
-
-
-
- 在開始 Activity 時,指定「href 所指定的頁面」呈現方式。其值必為下列之一 (若略過不設定,則預設為 window): -
    -
  • window ─ 只要是處理 Activity 的頁面,均將以新視窗開啟之;若在行動裝置上,則是以此畫面取代「請求該 Activity 的原始 App」。頁面必須針對自己所支援的各個 Activity,呼叫 navigator.mozSetMessageHandler(),再執行「接收到訊息」的Activity。
  • -
  • inline ─ 將以覆蓋原頁面的方式,開啟「處理 Activity 的頁面」;若在行動裝置上,則會在「請求該 Activity 的原始 App」上彈出框。如果 disposition 同樣是 window,則後續動作將一模一樣。
  • -
-
-
-
-
- returnValue {{optional_inline()}}
-
- 表示 Activity 是否將回傳數值。如果 App 不回傳數值,則一旦選定 App,UA 隨即傳送 - - success - 事件。如果要回傳數值,那只要 Activity 成功,Activity Handler 會呼叫 MozActivityRequestHandler.postResult();反之則呼叫 MozActivityRequestHandler.postError()。此處 Activity Handler 中,將於 mozSetMessageHandler 指定第一引數的類型,其實就是 MozActivityRequestHandler。在事件處理器呼叫了 postResultpostError 之後,將分別觸發 successerror 事件。
-
-
-
- filters {{optional_inline()}}
-
- 此 Dictionary 收錄了「用以指定篩選器 (Filter)」的各個屬性。在確認 App 是否適合處理目前 Activity 時,就會套用這些篩選器。篩選器名稱可為任何形式的文字,但需對應 MozActivityOptionsdata 屬性名稱。篩選器的值可能為基本數值 (數字或字串)、基本數值構成的陣列,或篩選器的定義物件。任一 Activity 必須先滿足所有篩選器之後,才會決定是否要處理其他 Activity。
-
-

根據各個篩選器數值的不同,處理篩選器的方式也有所差異:

- -

處理 Activity

-

一旦把 App 宣告為 Activity Handler 之後,我們就必須在實作中處理其他 App 所傳來的 Activity 請求。

-

若要處理 Activity,就必須註冊「執行所有必要動作」的函式。先透過 navigator.mozSetMessageHandler() 來設定訊息處理器 (Message handler),並特別指派至「activity」訊息 (不能為 Activity 的名稱)。接著將傳入 MozActivityRequestHandler 物件,以作為 Activity Handler 函式的參數。

-
navigator.mozSetMessageHandler('activity', function(activityRequest) {
-  // Do something to handle the activity
-});
-

在 Activity Handler 函式執行動作時,將透過 Activity 請求而檢索 Activity 的相關資訊,並依需要而回傳答案。

-

另外,呼叫 Activity 的 App 必須提供某些資料 (請參閱下表)。而透過請求的 source 屬性 (亦為 MozActivityOptions 物件) 即可取得這些資料。該物件將提供 Activity 呼叫的 name 與相關 data

-
navigator.mozSetMessageHandler('activity', function(activityRequest) {
-  var option = activityRequest.source;
-
-  if (option.name === "pick") {
-    // Do something to handle the activity
-  }
-});
-

一旦執行所有動作以處理 Activity 之後,我們就可以呼叫請求的 postResult() 函式,針對委託該 Activity 的 App,回傳所需的結果。

-

如果發生錯誤,則可呼叫請求的 postError() 函式,以回傳該 Activity 的錯誤訊息。

-
navigator.mozSetMessageHandler('activity', function(activityRequest) {
-  var option = activityRequest.source;
-
-  if (option.name === "pick") {
-    // Do something to handle the activity
-    ...
-
-    // Send back the result
-    if (picture) {
-      activityRequest.postResult(picture);
-    } else {
-      activityRequest.postError("Unable to provide a picture");
-    }
-  }
-});
-
-

注意:如果並未呼叫 postErrorpostResult(),則均應由 UA 送出錯誤訊息;例如使用者離開了 App (關閉桌面上的分頁,或回到行動裝置的首頁) 的情形。

-
-

開始 Activity

-

Web Activities 的另一方面來說,就是有 App 會將 Activity 委託予我們的 App。若要執行這種委託作業,則 App 必須建立 (Instantiate) MozActivity 物件,進而呼叫 Activity。這種物件其實就是 DOMRequest 物件,可等待來自於 Activity Handler 的任何反應。只要建立了物件之後,就會開始 Activity (也會立刻為使用者顯示 UI)。

-
var activity = new MozActivity({
-  // Ask for the "pick" activity
-  name: "pick",
-
-  // Provide de data required by the filters of the activity
-  data: {
-    type: "image/jpeg"
-  }
-});
-
-activity.onsuccess = function() {
-  var picture = this.result;
-  console.log("A picture has been retrieve");
-};
-
-activity.onerror = function() {
-  console.log(this.error);
-};
-
-

Firefox OS 的 Activity

-

Gaia 即為 Firefox OS 的原生介面,並已內建許多 App 以定義基本的 Activity。這些 Activity 如下:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameApplicationExpected Data (filters)Comments
browseGallery -
-type: "photos"
-
 
configureSettings -
-target: "device"
-
 
costcontrol/balanceCostcontrolNone 
costcontrol/data_usageCostcontrolNone 
costcontrol/telephonyCostcontrolNone 
dialCommunication -
-type: "webtelephony/number",
-number: {
-  regexp:/^[\\d\\s+#*().-]{0,50}$/
-}
-
當 App 要傳送一通電話時使用。
newCommunication -
-type: "webcontacts/contact"
-
當 App 要建立新的聯絡人資料時使用。
Email -
-type: "mail"
-
 
SMS -
-type: "websms/sms",
-number: {
-  regexp:/^[\\w\\s+#*().-]{0,50}$/
-}
-
當 App 要傳送一封文字簡訊時使用。
openCommunication -
-type: "webcontacts/contact"
-
 
Gallery -
-type: [
-  "image/jpeg",
-  "image/png",
-  "image/gif",
-  "image/bmp"
-]
-
 
Music -
-type: [
-  "audio/mpeg",
-  "audio/ogg",
-  "audio/mp4"
-]
-
 
Video -
-type: [
-  "video/webm",
-  "video/mp4",
-  "video/3gpp",
-  "video/youtube"
-]
-

Also expect a blob property which is a {{domxref("Blob")}} object.

-
當 App 要顯示影片時使用 (而 view 的Activity 同樣可辦到) 。
pickCamera, Gallery, Wallpaper -
-type: ["image/*", "image/jpeg"]
-
當 App 要取得圖片時使用。
Communication -
-type: [
-  "webcontacts/contact",
-  "webcontacts/email"
-]
-
當 App 要檢索某個聯絡人資訊或電子郵件時使用。
recordCamera -
-type: ["photos", "videos"]
-
當 App 要錄製影片時使用。
save-bookmarkHomescreen -
-type: "url",
-url: {
-  required:true,
-  regexp:/^https?:/
-}
-
 
shareBluetooth -
-number: 1
-
-
 
Email, Wallpaper -
-type: "image/*"
-
當 App 要分享圖片時使用。
viewBrowser -
-type: "url"
-url: {
-  required: true,
-  regexp: /^https?:.{1,16384}$/
-}
-
當 App 要開啟 URL 時使用。
Email -
-type: "url",
-url: {
-  required:true,
-  regexp:/^mailto:/
-}
-
 
PDFjs -
-type: "application/pdf"
-
當 App 要顯示 PDF 文件內容時使用。
Video -
-type: [
-  "video/webm",
-  "video/mp4",
-  "video/3gpp",
-  "video/youtube"
-]
-

Also expect a url property which is a string.

-
當 App 要顯示影片時使用 (而 open 的 Activity 同樣可辦到)。
updateCommunication -
-type: "webcontacts/contact"
-
當 App 要更新聯絡人時使用。
-

規格

-

Web Activities 目前尚不屬於任何規格,但其中某些部分與當前的 Web Intents 有所重複。事實上,Mozilla 規劃 Web Activities 正是想提議用以替代 Web Intents。若要進一步了解相關資訊,可參閱 Web Intents Task Force ML 上的討論。

-

另可參閱

- diff --git a/files/zh-tw/webapi/webfm_api/index.html b/files/zh-tw/webapi/webfm_api/index.html deleted file mode 100644 index 76a85372f1..0000000000 --- a/files/zh-tw/webapi/webfm_api/index.html +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: WebFM API -slug: WebAPI/WebFM_API -translation_of: Archive/B2G_OS/API/WebFM_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

摘要

-

WebFM API 可存取裝置的 FM 收音機,進而開/關收音機並切換電台。另可透過 navigator.mozFMRadio 屬性 (為 FMRadio 物件) 而存取此 API。

-

開/關收音機

-

FMRadio.enable() 函式可開啟收音機;FMRadio.disable() 函式則是關閉收音機。

-

在開啟收音機之前,應先檢查裝置是否具備天線 (若無天線,內建的收音機當然也收不到訊號)。透過 FMRadio.antennaAvailable 屬性即可獲得天線資訊。行動裝置往往將耳機纜線作為收音機天線。由於使用者可隨時插入/拔除耳機,因此每次只要天線狀態改變,WebFM API 均將發出 antennaavailablechange 事件。

-

開啟收音機就必須要有可聆聽的頻道。而頻率 (以 MHz 為單位) 將以數字形式傳送至 FMRadio.enable() 函式。

-
// The frequency of the radio station
-// to listen express in MHz
-var frequency = 99.1;
-var radio = navigator.mozFMRadio;
-
-if (radio.antennaAvailable) {
-  radio.enable(frenquency);
-} else {
-  alert("You need to plug your headphone");
-}
-
-radio.addEventListener('antennaavailablechange', function () {
-  if (radio.antennaAvailable) {
-    radio.enable(frenquency);
-  } else {
-    radio.disable();
-  }
-})
-
-
-

注意:透過裝置上的可用 normal 音訊通道,即可輸出音訊。

-
-

切換不同頻率

-

使用者可手動或讓裝置自動切換頻率。不論是手動或自動,均將透過 FMRadio.frequency 屬性存取目前的收音機頻率。該屬性則以 MHz 呈現頻率。

-

手動切換

-

必須以 FMRadio.setFrequency() 函式設定新的頻率,但所能設定的值有某些限制。此函式將回傳 DOMRequest 物件,以處理函式呼叫的成功或錯誤狀態。而頻率必須滿足下列要求:

- -
var change = radio.setFrequency(frequency);
-
-change.onerror = function () {
-  var min = radio.frequencyLowerBound;
-  var max = radio.frequencyUpperBound;
-  console.warn('The frequency must be within the range [' + min + ',' + max + ']');
-}
-
-change.onsuccess = function () {
-  console.log('The frequency has been set to ' + radio.frequency);
-}
-
-

自動搜尋

-

WebFM API 亦可自動搜尋收音機頻道。我們使用 FMRadio.seekUp()FMRadio.seekDown() 函式。前者將從目前頻道再尋找更高的頻率;後者反之。此 2 組函式均將回傳 DOMRequest 物件,以處理函式呼叫的成功或錯誤狀態。

-

WebFM API 亦可自動搜尋收音機頻道。我們使用 FMRadio.seekUp()FMRadio.seekDown() 函式。前者將從目前頻道再尋找更高的頻率;後者反之。此 2 組函式均將回傳 DOMRequest 物件,以處理函式呼叫的成功或錯誤狀態。

-

且此 2 組函式在到達 frequencyLowerBoundfrequencyUpperBound 的值之後,均將再次循環較高/較低頻率。一旦找到新頻道,就會更改目前頻率並發出 frequencychange 事件。

-

此 2 組函式並無法同時搜尋,也就是無法同時往上並往下搜尋頻率,否則將發生錯誤。而呼叫 FMRadio.cancelSeek() 函式即可停止搜尋頻率。此函式亦將回傳 DOMRequest 物件。

-
var radio   = navigator.mozFMRadio;
-var seeking = false;
-var UP      = document.querySelector("button.up");
-var DOWN    = document.querySelector("button.down");
-
-// When the frequency change, the seek
-// functions automatically stop to seek.
-radio.onfrequencychange = function () {
-  seeking = false;
-}
-
-function seek(direction) {
-  var cancel, search;
-
-  // If the radio is already seeking
-  // we will cancel the current search.
-  if (seeking) {
-    var cancel = radio.cancelSeek();
-    cancel.onsuccess = function () {
-      seeking = false;
-
-      // Once the radio no longer seek,
-      // we can try to seek as expected
-      seek(direction);
-    }
-
-  // Let's seek up
-  } else if (direction === 'up') {
-    // Just to be sure that the radio is turned on
-    if (!radio.enabled) {
-      radio.enable(radio.frequencyLowerBound);
-    }
-    search = radio.seekUp();
-
-  // Let's seek up
-  } else if (direction === 'down' {
-    // Just to be sure that the radio is turned on
-    if (!radio.enabled) {
-      radio.enable(radio.frequencyUpperBound);
-    }
-    search = radio.seekDown();
-  }
-
-  if (search) {
-    search.onsuccess = function () {
-      // Ok, we are seeking now.
-      seeking = true;
-    };
-    search.onerror = function () {
-      // Something goes wrong... ok, let's try again.
-      seek(direction);
-    }
-  }
-}
-
-UP.addEventListener('click', function () {
-  seek('up');
-});
-
-DOWN.addEventListener('click', function () {
-  seek('down');
-});
-
-

規格

-

尚無任何規格。

-

另可參閱

- diff --git a/files/zh-tw/webapi/websms/index.html b/files/zh-tw/webapi/websms/index.html deleted file mode 100644 index 16ef3887cf..0000000000 --- a/files/zh-tw/webapi/websms/index.html +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: WebSMS -slug: WebAPI/WebSMS -translation_of: Archive/B2G_OS/API/Mobile_Messaging_API ---- -

{{ non-standard_header() }}

- -

{{ B2GOnlyHeader2('certified') }}

- -

摘要

- -

WebSMS API 可讓網頁內容能建立、傳送、接收文字簡訊 (SMS) 或多媒體訊息 (MMS)。

- -

透過 window.navigator.mozSms (將回傳 MozSmsManager 物件),或是 window.navigator.mozMobileMessage (將回傳 MozMobileMessageManager 物件),均可存取此 API。

- -

DOM 介面

- -

SMS 介面

- - - -

MMS 與 SMS 介面

- - - -

範例程式碼與介紹

- - - -

規格

- -

此 API 目前尚未成為標準規格。可至 W3C 的 System Application Working Group 參與相關討論。

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Messaging')}}{{Spec2('Messaging')}}Editor Draft (WIP).
- -

瀏覽器相容性

- -

當然,主要支援行動瀏覽器。

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatNo() }}{{ CompatGeckoMobile("12.0") }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
- -

相關設定

- - - -

另可參閱

- - diff --git a/files/zh-tw/xpcom/index.html b/files/zh-tw/xpcom/index.html deleted file mode 100644 index 126d4d0a00..0000000000 --- a/files/zh-tw/xpcom/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: XPCOM -slug: XPCOM -translation_of: Mozilla/Tech/XPCOM ---- -
XPCOM 入門 - -

來自 IBM developerWorks 的教程︰第一部分第二部分第三部分第四部分第五部分

-
- -
-

XPCOM is no longer available for use by Firefox extensions. Use WebExtensions instead.

-
-
XPCOM(Cross Platform Component Object Model)是一種跨平台元件物件模型,類似於微軟的 COM。它有多種語言繫結(Language Binding),使 XPCOM 元件可使用並實現於C++、JavaScript、Java 及 Python。XPCOM 的介面是由稱為 XPIDL (IDL 的方言)所定義。 - -

XPCOM 自身提供了一套核心元件和類別,例如,檔案和記憶體管理、線程、基本資料結構(strings, arrays, variants)等。大多數 XPCOM 元件並非由核心元件所提供,而是由其他平台(例如 GeckoNecko)或應用程式、甚至是延伸套件所提供。

-
- - -
-
Accessing the Windows Registry Using XPCOM
When implementing Windows-specific functionality, it is often useful to access the Windows registry for information about the environment or other installed programs. To this end, there exist XPCOM interfaces to read and write registry data. This article will show you how to use the available interfaces in several Mozilla products.
Aggregating the In-Memory Datasource
already_AddRefed
already_AddRefed in association with nsCOMPtr allows you to assign in a pointer without AddRefing it.
Binary compatibility
If Mozilla decides to upgrade to a compiler that does not have the same ABI as the current version, any built component may fail. It is a possiblity that is introduced when upgrading to a new compiler without recompiling everything. Effectively, it is a different platform.
Bundling multiple binary components
Binary XPCOM components are sometimes required to implement low-level features for extensions. Since binary components are linked against a single Gecko SDK, a dependency to a particular version of Gecko is created. If the component uses only "frozen" XPCOM interfaces, there is a good chance the same binary component will work with different versions of Gecko (version 1.8 and 1.9, for example). The more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between Gecko versions. This can create a difficult situation for extension developers trying to support multiple Gecko versions (Firefox 2 and 3, for example).
Creating a Python XPCOM component
Creating Applications with Mozilla already provides a tutorial for making a simple JavaScript or C++ component (implementing the nsISimple interface). Here is how to make the same component in Python using PyXPCOM.
Fun With XBL and XPConnect
Generating GUIDs
GUIDs are used in Mozilla programming for identifying several types of entities, including XPCOM Interfaces (this type of GUIDs is callled IID), components (CID), and legacy add-ons—like extensions and themes—that were created prior to Firefox 1.5. Add-ons can (and should) be identified with IDs of the form extensionname@organization.tld since Firefox 1.5.
Generic factory
Most XPCOM factories can be very simple. Rick Potts wrote a templated-based generic factory (nsFactory<t>) that simplifies the factory creation process that just requires writing a CreateInstance() method. The new nsIGenericFactory interface takes this a step further, by providing a single interface that can be reused anytime a simple implementation of nsIFactory is needed. Here is the interface, and a description of its use.</t>
How to build a binary XPCOM component using Visual Studio
This is a simple tutorial for building XPCOM objects in C++ using Visual Studio. XPCOM is Mozilla’s cross platform component object model, similar to Microsoft’s COM technology. XPCOM components can be implemented in C, C++, and JavaScript, and can be used from C, C++, and JavaScript. That means you can call JavaScript methods from C++ and vice versa. For more information on the workings of XPCOM look elsewhere.
How To Pass an XPCOM Object to a New Window
If you want to be able to call functions within an XPCOM object from a XUL window's code, you can do so if you pass the XPCOM object as one of the arguments to the window creation method.
Interfacing with the XPCOM cycle collector
This is a quick overview of the cycle collector introduced into XPCOM for Firefox 3, including a description of the steps involved in modifying an existing C++ class to participate in XPCOM cycle collection. If you have a class that you think is involved in a cyclical-ownership leak, this page is for you.
Introduction to XPCOM for the DOM
Warning: this document has not yet been reviewed by the DOM gurus, it might contain some errors.
Language bindings
An XPCOM Language Binding is a bridge between a particular language and XPCOM to provide access to XPCOM objects from that language, and to let modules written in that language be used as XPCOM objects by all other languages for which there are XPCOM bindings.
Monitoring HTTP activity
Gecko includes the nsIHttpActivityObserver interface, which you can implement in your code to monitor HTTP transactions in real time, receiving a callback as the transactions take place.
nsCOMPtr versus RefPtr
Gecko code uses both nsCOMPtr and RefPtr as smart pointers. This guide provides some explanation and advice on how to choose between them.
Observer Notifications
The following are topics that you can observe during the course of an application. Unless otherwise noted you register for the topics using the nsIObserverService.
Setting HTTP request headers
HTTP is one of the core technologies behind the Web. In addition to the actual content, some important information is passed with HTTP headers for both HTTP requests and responses.
Storage
Storage is a SQLite database API. It is available to trusted callers, meaning extensions and Firefox components only.
The Thread Manager
The Thread Manager, introduced in Firefox 3, offers an easy to use mechanism for creating threads and dispatching events to them for processing.
-
Troubleshooting XPCOM components registration
Often the first time you create an XPCOM component, it may fail to register correctly.
Using nsCOMPtr
This document is the sum total of everything written down about nsCOMPtr. If you have a question about nsCOMPtr, and this document doesn't answer it, there probably isn't a document that answers it. You'll have to turn to the XPCOM newsgroup or another experienced nsCOMPtr user, or find the answer by experimentation.
Using nsIClassInfo
If you use a C++ class which implements nsIClassInfo from JavaScript, then you don't have to explicitly call QueryInterface on the JavaScript object to access the object's interfaces.
Using nsIDirectoryService
nsDirectoryService implements the nsIProperties interface. This implementation will allow you to Get(), Set(), Define(), and Undefine() nsIFile.
Using nsIPasswordManager
Technical review completed.
Using nsISimpleEnumerator
Using the clipboard
This section provides information about cutting, copying, and pasting to and from the clipboard.
Using the Gecko SDK
Weak reference
In XPCOM, a weak reference is a special object that contains a pointer to an XPCOM object, but doesnot keep that object alive. If the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull.
Working with Multiple Versions of Interfaces
In this short note we illustrate how one can update an XPCOM module in -order for it to work in both Firefox 2 and Firefox 3, even if the interfaces have -changed in the interim.
Working with out parameters
wrappedJSObject
wrappedJSObject is a property sometimes available on XPConnect wrappers. When available, it lets you access the JavaScript object hidden by the wrapper.
XPCOM ABI
XPCOM ABI is the binary interface of XPCOM components. While XPCOM components written in a scripting language (such as JavaScript) can be moved across platforms (such as Windows and OS X) without adaptation, those written in a compiled language (such as C++) require recompilation when moving to a different platform. Often, compiled XPCOM components are called 'binary' or 'native'.
XPCOM category image-sniffing-services
In versions of Firefox prior to Firefox 3, extensions could add decoders for new image types. However, such decoders relied on servers sending correct MIME types; images sent with incorrect MIME types would not be correctly displayed.
XPCOM glue
The XPCOM Glue is a static library which component developers and embedders can link against. It allows developers to link only against the frozen XPCOM method symbols and maintain compatibility with multiple versions of XPCOM.
XPCOM guide
These articles provide tutorials and usage documentation for XPCOM, including how to use it in your own projects and how to build XPCOM components for your Firefox add-ons and the like.
XPCOM ownership guidelines
...naturally. If you create a temporary object, obviously it's up to you to destroy it. That's a sure sign of ownership. If you create an object with a longer lifespan, you will own it until you give ownership away.
XPCOM reference
This reference describes the interfaces and functions provided by the XPCOM library. In addition, it details the various helper classes and functions, as well as the components, provided by the XPCOM glue library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.
XPCOM tasks
The XPCOM module roughly parallels the C/C++ standard libraries. It overlaps them significantly, but goes beyond them in capabilities. XPCOM sits above the standard libraries. Its role is to extend them with facilities tailored to XPCOM development in general, and specifically the needs of Mozilla. Like the standard libraries, XPCOM must be a fairly self-contained library, so as not to encumber clients with any unnecessary external dependencies.
XPCOM Thread Synchronization
XPCOM thread synchronization primitives have the same semantics as those in NSPR, and each method of these synchronization objects (e.g. Mutex::Lock()) has a matching function in NSPR (PR_Lock()). This is no accident, as mozilla:: primitives are merely bare-minimum wrappers around NSPR's.
xptcall FAQ
xptcall is a small low level XPCOM method call library. It is implemented using platform specific C/C++ and assembly language code. It is used to facilitate cross language and cross thread method calls. Porting this code is required in order to make Mozilla run on any given platform.
Xptcall Porting Guide
Original Author: John Bandhauer, 31 May 1999.
Xptcall Porting Status
This is a status page for the multiplatform porting of xptcall. xptcall has a FAQ and a Porting Guide.
-
- -
- -
-

Join the XPCOM community

-
-
Choose your preferred method for joining the discussion:
- -
- -
-
- - diff --git "a/files/zh-tw/xul_\346\225\231\345\255\270/index.html" "b/files/zh-tw/xul_\346\225\231\345\255\270/index.html" deleted file mode 100644 index ea8941b2cd..0000000000 --- "a/files/zh-tw/xul_\346\225\231\345\255\270/index.html" +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: XUL 教學 -slug: XUL_教學 -translation_of: Archive/Mozilla/XUL/Tutorial ---- -

 

-

這份教學介紹 XULXML User-interface Language)。Mozilla 使用它來建立應用程式的使用介面

-
引言
- -
Simple Elements
- -
The Box Model
- -
More Layout Elements
- -
Toolbars and Menus
- -
Events and Scripts
- -
Document Object Model
- -
Trees
- -
RDF and Templates
- -
Skins and Locales
- -
Bindings
- -
Specialized Window Types
- -
Installation
- -
-

This XUL tutorial was originally created by Neil Deakin. He has graciously given us permission to use it as part of the MDC.

-
-
-
Original Document Information
- -
-

Interwiki Language Links

diff --git a/files/zh-tw/zones/index.html b/files/zh-tw/zones/index.html deleted file mode 100644 index 5d6bf109d3..0000000000 --- a/files/zh-tw/zones/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Zones -slug: Zones -translation_of: Zones ---- -

MDN zones provide you one-stop access to information about specific topic areas or products. Here's a list of all the zones available to you.

- -
-
-

Web and app development

- -
-
App Center
-
Learn how to create open Web apps—rich experiences that run across multiple devices and form factors—using the same Web standards and open technologies you already know.
-
Learning Area
-
This zone is all about articles to help newcomers to Web development get started in this exciting new world.
-
Developer tools
-
Learn how to use the Firefox developer tools to debug, test, and optimize your Web apps and sites.
-
Firefox Marketplace
-
An open, non-proprietary online marketplace for Web applications built using HTML, CSS, and JavaScript. Submit apps to the Firefox Marketplace or use the code to build your own marketplace.
-
Game development
-
Learn how to develop games for the Web, how to port existing games to Web technologies, and how to turn your games into Web apps.
-
-
- -
-

Products and projects

- -
-
Emscripten
-
An LLVM to JavaScript compiler; this lets you compile, for example, C++ code into JavaScript code which can be run in any Web browser.
-
L20n
-
A JavaScript localization framework for unleashing your natural language's power with simple code.
-
The MDN project
-
The Mozilla Developer Network (this site) relies on its community of readers and contributors to grow and improve. You can learn here how to help use, contribute to, and build the code behind MDN!
-
Persona
-
A new simple, privacy-sensitive single-sign in system developed by Mozilla which lets users log into your Web site using their email address, freeing you from password management.
-
- -

Mozilla technologies

- -
-
Add-ons
-
Learn how to build and install extensions, themes, and plug-ins for Mozilla-based software, including the popular Firefox Web browser.
-
Firefox
-
Learn all about Firefox, from how to build and revise it to how to build add-ons specifically for it.
-
Firefox OS
-
A new mobile operating system developed by Mozilla which lets users install and run open Web applications created using HTML, CSS, and JavaScript.
-
-
-
- -

diff --git "a/files/zh-tw/\344\273\245_windows_\347\231\273\351\214\204\347\242\274\345\256\211\350\243\235\346\223\264\345\205\205\345\245\227\344\273\266/index.html" "b/files/zh-tw/\344\273\245_windows_\347\231\273\351\214\204\347\242\274\345\256\211\350\243\235\346\223\264\345\205\205\345\245\227\344\273\266/index.html" deleted file mode 100644 index 521a6c1445..0000000000 --- "a/files/zh-tw/\344\273\245_windows_\347\231\273\351\214\204\347\242\274\345\256\211\350\243\235\346\223\264\345\205\205\345\245\227\344\273\266/index.html" +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: 以 Windows 登錄碼安裝擴充套件 -slug: 以_Windows_登錄碼安裝擴充套件 -tags: - - 擴充套件 -translation_of: >- - https://extensionworkshop.com/documentation/publish/signing-and-distribution-overview/ ---- -

簡介

-

本文演示以 Windows 登錄碼 (Registry)「安裝」Firefox/Thunderbird 擴充套件的方法。此功能可以方便協力廠商的程式為 Firefox 或 Thunderbird 安裝套件。 -

注意 本文所描述的功能只在 Firefox/Thunderbird 1.5 以上版本有用。 -

-

安裝

-

在下列兩個登錄碼下新增項目便可安裝套件: -

-
HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions
-HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions
-
-

若要裝在 Thunderbird 中,則將上面的 Firefox 改為 Thunderbird 即可。 -

新增的項目需以擴充套件的 ID 為名、型態設定為 REG_SZ,其值則為套件安裝檔所在資料夾的完整路徑。舉例來說,要安裝製作擴充套件範例中的套件,則需新增一個名為 sample@foo.net 的登錄碼項目,並將其值設定為 c:\extensions\myExtension。 -

新增登錄碼之後,下回 Firefox/Thunderbird 啟動時便會偵測其值遂行安裝。在 Firefox/Thunderbird 執行中時依然可以更動登錄碼。 -

如果 HKEY_CURRENT_USERHKEY_LOCAL_MACHINE 中有相同的登錄碼項目,則會先行採用 HKEY_CURRENT_USER 中的套件;如果使用者自行安裝過相同的擴充套件,則自行安裝的會優先使用。 -

-

移除

-

要移除以 Windows 登錄碼安裝的套件,只要將相對應的登錄碼項目移除即可。移除登錄碼之後,下回 Firefox/Thunderbird 啟動偵測後便會一併移除套件。在 Firefox/Thunderbird 執行中時依然可以更動登錄碼。 -

-

延伸閱讀

-

包裝擴充套件 -

-
-
-{{ languages( { "en": "en/Adding_Extensions_using_the_Windows_Registry", "ja": "ja/Adding_Extensions_using_the_Windows_Registry", "zh-cn": "cn/Adding_Extensions_using_the_Windows_Registry" } ) }} diff --git "a/files/zh-tw/\344\275\210\346\231\257\344\270\273\351\241\214/background/index.html" "b/files/zh-tw/\344\275\210\346\231\257\344\270\273\351\241\214/background/index.html" deleted file mode 100644 index 0d87ee8724..0000000000 --- "a/files/zh-tw/\344\275\210\346\231\257\344\270\273\351\241\214/background/index.html" +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: Background Themes -slug: 佈景主題/Background -translation_of: Mozilla/Add-ons/Themes/Lightweight_themes ---- -

我家的多多小姐又再亂咬東西了如何創建自己的背景主題

- -
-

主題是由一個“頭”圖形圖像文件,它外觀中的默認UI Firefox的背景。

- -

完成你的設計?您可以馬上提交!

- -

創建主題標題圖片

- -

頭圖像顯示在瀏覽器窗口頂部的背景下,偎依在工具欄,地址欄,搜索欄和標籤欄的後面。它將被錨定到右上角的瀏覽器窗口。

- -

- - - -

圖片要求

- - - -

提示

- - - -

在線圖像編輯器資源

- - - -

創建主題頁腳圖像

- -

在舊版本的Firefox或更新版本的安裝一定的附加組件,頁腳圖像顯示為瀏覽器窗口底部的背景下,該加載項並找到酒吧的後面。它將被固定在瀏覽器窗口的左下角。頁腳圖像是可選的。

- -

- - - -

圖片要求

- - - -

提示

- - - -

提交您的主題圖像

- -

要開始提交您的圖片,轉到主題提交頁面:

- -
    -
  1. 命名的主題 -挑你的主題的唯一名稱。重複的名稱是不允許的,所以你可能需要嘗試幾次找到唯一的名稱。
  2. -
  3. 選擇一個類別和標籤 -選擇一個類別,並輸入一些標籤最能描述你的主題。請記住,審閱者可能會拒絕你的主題,如果很明顯,您的類別和/或標籤無關您的主題。
  4. -
  5. 描述你的主題 -寫你的主題進行了簡短說明。請記住,審閱者可能會拒絕你的主題,如果你的描述不是你的主題準確地表述。
  6. -
  7. 為您的主題牌 -決定了你工作的版權許可。了解更多關於類型的知識共享許可。 -
      -
    • 重要提示:請確保您有使用圖像在你的主題的權利!
    • -
    -
  8. -
  9. 上傳圖片 -確保他們受到300 KB的大小和JPG或PNG格式!
  10. -
  11. 選擇文本和標籤的顏色 -您可以選擇最適合您的標題圖片選項卡(“背景”)的顏色和前景文本顏色。
  12. -
  13. 預覽你的主題 -你準備好預覽您的主題!只需將鼠標懸停在上面提交主題按鈕,看看它的樣子瞬間影像。
  14. -
  15. 提交你的主題 -如果一切看起來正常,點擊提交按鈕的主題,你就大功告成了!你可以查看你的個人資料頁面上撰寫的主題。 -
      -
    • 提示:為確保您的主題已被批准用於畫廊,確保它與內容準則和服務條款的規定!
    • -
    -
  16. -
- -

- -

提交你的主題現在

- -

更多教程

- -

Mozilla的主題聯絡點漿紗上 -上側重於上漿主題化,通過VanillaOrchids教程。

-
diff --git "a/files/zh-tw/\344\275\210\346\231\257\344\270\273\351\241\214/index.html" "b/files/zh-tw/\344\275\210\346\231\257\344\270\273\351\241\214/index.html" deleted file mode 100644 index fdcea039ce..0000000000 --- "a/files/zh-tw/\344\275\210\346\231\257\344\270\273\351\241\214/index.html" +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: 佈景主題 -slug: 佈景主題 -tags: - - 佈景主題 -translation_of: Mozilla/Add-ons/Themes ---- -

 

- -
新手上路
-Firefox 佈景主題製作入門。
- -
佈景主題 是 Mozilla 各種應用程式的介面外觀。Mozilla 應用程式可以讓使用者依喜好更動程式的視覺觀感,而這些佈景主題可以簡單更換使用介面的色彩等項目,也可以更動物件的顯示位置。
- -

<div style="clear:both;" />

- - - - - - - - -
-

文件

- -
-
製作 Firefox 佈景主題
-
Firefox 佈景主題製作入門。
-
- -
-
包裝佈景主題
-
為 Firefox 及 Thunderbird 包裝佈景主題安裝檔。
-
- -
-
Firefox 1.0 至 1.5 間關於佈景主題的變動(MozillaZine 討論區文章)
-
MozillaZine 一篇討論 Firefox 1.0 至 1.5 間關於佈景主題變動項目的文章。
-
- -
-
開發佈景主題
-
一篇廣泛談論各種 XUL 程式佈景主題設計開發細節的文章。
-
- -
-
佈景主題設計第一步
-
一篇有點舊的文章,談 Firefox 的佈景主題設計。
-
- -

所有文章...

-
-

社群

- -
    -
  • 查閱 Mozilla 討論區...
  • -
- - - - - -

工具

- - - -

所有文章...

- -

相關主題

- -
-
CSS
-
-
- -

Categories

- -

Interwiki Language Links

- -

 

- -
 
- -

{{ languages( { "de": "de/Themes", "en": "en/Themes", "es": "es/Temas", "fr": "fr/Th\u00e8mes", "ja": "ja/Themes", "pl": "pl/Motywy", "zh-cn": "cn/\u4e3b\u9898" } ) }}

diff --git "a/files/zh-tw/\346\223\264\345\205\205\345\245\227\344\273\266/index.html" "b/files/zh-tw/\346\223\264\345\205\205\345\245\227\344\273\266/index.html" deleted file mode 100644 index a6df5c978b..0000000000 --- "a/files/zh-tw/\346\223\264\345\205\205\345\245\227\344\273\266/index.html" +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: 擴充套件 -slug: 擴充套件 -tags: - - 待翻譯 - - 擴充套件 -translation_of: Mozilla/Add-ons ---- -
-

擴充套件(Extensions)可加入新功能到 Mozilla 應用程式(如 Firefox、SeaMonkey 及 Thunderbird)。從工具列按鈕到全新的功能,擴充套件都做的到。擴充套件使應用程式能夠自訂,以符合使用者的個人需求,並保持應用程式的輕巧以便下載。

-

擴充套件與外掛(plugin)並不相同,外掛可幫助瀏覽器顯示特別的內容,像是播放多媒體檔案。擴充套件與搜尋外掛(search plugin)也不相同,搜尋外掛可在搜尋列上附加搜尋引擎。

-
-

文件

-


-全體(適用於全部的 Mozilla 應用程式):

- -

Firefox 

-

Thunderbird

-

SeaMonkey
-

-

Fennec (mobile 瀏覽器)

-

檢視所有標記為"擴充套件"的頁面...

社群

  • 瀏覽 Mozilla 擴充套件開發論壇...

{{ DiscussionList("dev-extensions", "mozilla.dev.extensions") }}

工具

... 更多工具 ...

相關主題

XUL, JavaScript, XPCOM, Themes, Developing Mozilla

Categories

Interwiki Language Links

    

    

{{ languages( { "en": "en/Extension", "de": "de/Erweiterungen", "es": "es/Extensiones", "fr": "fr/Extensions", "it": "it/Estensioni", "ja": "ja/Extensions", "ko": "ko/Extensions", "pl": "pl/Rozszerzenia", "pt": "pt/Extens\u00f5es", "ru": "ru/\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f", "zh-cn": "cn/\u6269\u5c55", "zh-tw": "zh_tw/\u64f4\u5145\u5957\u4ef6" } ) }}

diff --git "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/contents.rdf/index.html" "b/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/contents.rdf/index.html" deleted file mode 100644 index 4c19884c30..0000000000 --- "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/contents.rdf/index.html" +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: contents.rdf -slug: 製作_Firefox_佈景主題/contents.rdf -translation_of: Archive/Themes/Creating_a_Skin_for_Firefox/contents.rdf ---- -

-

將下列文字複製貼進純文字檔中,命名為「contents.rdf」: -

-
<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
-  <!-- 列出此佈景主題提供的外觀樣式 -->
-  <RDF:Seq about="urn:mozilla:skin:root">
-    <RDF:li resource="urn:mozilla:skin:My_Theme"/>
-  </RDF:Seq>
-
-  <RDF:Description about="urn:mozilla:skin:My_Theme"
-        chrome:displayName="My Theme"
-        chrome:accessKey="N"
-        chrome:author=""
-        chrome:authorURL=""
-        chrome:description=""
-        chrome:name="My_Theme"
-        chrome:image="preview.png" >
-   <chrome:packages>
-      <RDF:Seq about="urn:mozilla:skin:My_Theme:packages">
-        <RDF:li resource="urn:mozilla:skin:My_Theme:browser"/>
-        <RDF:li resource="urn:mozilla:skin:My_Theme:communicator"/>
-        <RDF:li resource="urn:mozilla:skin:My_Theme:global"/>
-        <RDF:li resource="urn:mozilla:skin:My_Theme:mozapps"/>
-        <RDF:li resource="urn:mozilla:skin:My_Theme:help"/>
-      </RDF:Seq>
-    </chrome:packages>
-  </RDF:Description>
-
-  <!-- 版本資訊,這個佈景主題僅支援主版本號碼為 1 的 Firefox。 -->
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:browser"/>
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:communicator"/>
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:global"/>
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:mozapps"/>
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:help"/>
-</RDF:RDF>
-
-
-
-{{ languages( { "de": "de/Theme_erstellen/contents.rdf", "en": "en/Creating_a_Skin_for_Firefox/contents.rdf", "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox/contents.rdf", "ja": "ja/Creating_a_Skin_for_Firefox/contents.rdf", "pl": "pl/Tworzenie_sk\u00f3rek_dla_Firefoksa/contents.rdf", "pt": "pt/Criando_um_visual_para_o_Firefox/contents.rdf" } ) }} diff --git "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/index.html" "b/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/index.html" deleted file mode 100644 index bf8d1ded4d..0000000000 --- "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/index.html" +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: 製作 Firefox 佈景主題 -slug: 製作_Firefox_佈景主題 -tags: - - 佈景主題 -translation_of: Archive/Themes/Creating_a_Skin_for_Firefox ---- -

 

- -

簡介

- -

要製作 Firefox 的佈景主題,必須先清楚編輯圖片的方法、解壓縮 ZIP 的方法以及更動 CSS 的方法。Firefox 的按鈕使用標準 GIF、PNG 及 JPEG 格式的圖片,而其餘介面則由 CSS 調整。

- -

什麼叫佈景主題?

- -

佈景主題不會把介面全盤修改,而只是讓外觀看起來不同。你無法藉佈景主題控制使用者在圖片上按下右鍵時的狀況,不過可以更動右鍵快捷選單的模樣(例如顯示為藍底加上粉紅斑點等等)。如果你想修改 Firefox 的功能,可能要查閱修改 chrome 的相關文件,這已超出本文範圍。

- -

內容

- - - -
-
-

原始文件資訊

- - -
- -
 
- -

{{ languages( { "de": "de/Theme_erstellen", "en": "en/Creating_a_Skin_for_Firefox", "es": "es/Creando_un_tema_para_Firefox", "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox", "ja": "ja/Creating_a_Skin_for_Firefox", "pl": "pl/Tworzenie_sk\u00f3rek_dla_Firefoksa" } ) }}

diff --git "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/install.rdf/index.html" "b/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/install.rdf/index.html" deleted file mode 100644 index 220bf9e99c..0000000000 --- "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/install.rdf/index.html" +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: install.rdf -slug: 製作_Firefox_佈景主題/install.rdf -translation_of: Archive/Themes/Creating_a_Skin_for_Firefox/install.rdf ---- -

-

將下列程式碼複製貼到純文字檔中,命名為「install.rdf」: -

-
<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-  <em:id>{Themes_UUID}</em:id>
-    <em:version>Themes_Version</em:version>
-
-<!-- 本附加元件所能支援的應用軟體及其版本,版本限制有最低需求跟最高限制兩種。 -->
-
-<em:targetApplication>
-    <Description>
-      <!-- Firefox 的 UUID -->
-      <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-      <em:minVersion>Min_FF_Version</em:minVersion>
-      <em:maxVersion>Max_FF_Version</em:maxVersion>
-    </Description>
-  </em:targetApplication>
-
-  <!-- 其他資訊 -->
-  <!-- My_Theme -->
-  <em:name>My_Theme</em:name>
-  <em:description>My_Theme</em:description>
-  <em:creator>Your_Name</em:creator>
-  <em:contributor>Contributors_Names</em:contributor>
-  <em:homepageURL>Themes_HomePage</em:homepageURL>
-  <em:updateURL> Url_of_Update_Location </em:updateURL>
-  <em:aboutURL> Url_of_About_Page </em:aboutURL>
-
-  <!-- 佈景主題管理員用-->
-    <em:internalName>My_Theme</em:internalName>
-  </Description>
-
-</RDF>
-
-
-
-{{ languages( { "de": "de/Theme_erstellen/install.rdf", "en": "en/Creating_a_Skin_for_Firefox/install.rdf", "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox/install.rdf", "ja": "ja/Creating_a_Skin_for_Firefox/install.rdf", "pl": "pl/Tworzenie_sk\u00f3rek_dla_Firefoksa/install.rdf", "pt": "pt/Criando_um_visual_para_o_Firefox/install.rdf" } ) }} diff --git "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/uuid/index.html" "b/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/uuid/index.html" deleted file mode 100644 index d992f7f9df..0000000000 --- "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/uuid/index.html" +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: UUID -slug: 製作_Firefox_佈景主題/UUID -translation_of: Archive/Themes/Creating_a_Skin_for_Firefox/UUID ---- -

-

-

UUID:通用唯一識別碼

-

UUID 可以至 http://www.famkruithof.net/uuid/uuidgen 取得,或者在 irc.mozilla.org 上輸入「firebot: uuid?」。 -

-

延伸閱讀

-

製作_GUID -

-
-
-{{ languages( { "en": "en/Creating_a_Skin_for_Firefox/UUID", "es": "es/Creando_un_skin_para_Firefox/UUID", "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox/UUID", "ja": "ja/Creating_a_Skin_for_Firefox/UUID", "pl": "pl/Tworzenie_sk\u00f3rek_dla_Firefoksa/UUID", "pt": "pt/Criando_um_visual_para_o_Firefox/UUID" } ) }} diff --git "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/\344\270\212\346\211\213\347\257\207/index.html" "b/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/\344\270\212\346\211\213\347\257\207/index.html" deleted file mode 100644 index 79c7e5bec1..0000000000 --- "a/files/zh-tw/\350\243\275\344\275\234_firefox_\344\275\210\346\231\257\344\270\273\351\241\214/\344\270\212\346\211\213\347\257\207/index.html" +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: 上手篇 -slug: 製作_Firefox_佈景主題/上手篇 -translation_of: Archive/Mozilla/Creating_a_sking_for_Firefox_Getting_Started ---- -

-

-

準備

-

下載最新版的 Firefox 後安裝,別忘了也把 DOM 觀察器裝上去。 -

-

解壓縮佈景主題

-

你可以修改任何既有的 Firefox 佈景主題,但為方便起見我們就以 Winstripe(Firefox 預設主題)為範例。這個主題放在 Firefox 安裝目錄的 <tt>classic.jar</tt> 檔案中,而 jar 檔其實就是改了名字的 zip 檔,你可用與開 zip 檔相同的程式開啟 jar 並解壓縮其中的檔案。如果應用程式看不懂這改了檔名的 zip 檔,你可以自己將其改名為 <tt>classic.zip</tt> 再解壓縮。 -

-
Classic.jar 位置
-

Linux: /usr/lib/MozillaFirefox/chrome/classic.jar -

Windows: \Program Files\Mozilla Firefox\chrome\classic.jar -

Mac OS X: -

- -

將 <tt>classic.jar</tt> 複製到另一個容易取用的資料夾(建議放到 <tt>Classic</tt> 中)後解壓縮,記得確保目錄結構完整。 -

-
註:你可以將 <tt>.jar</tt> 附檔名改為 <tt>.jar.zip</tt> 再解壓縮
-

目錄

-

在 <tt>classic.jar</tt> 中有個名為 <tt>skin</tt> 的目錄及 <tt>preview.png</tt> 和 <tt>icon.png</tt> 兩個檔案。 -

-
<tt>skin</tt> -
<tt>skin</tt> 裡頭就只有另一個 <tt>classic</tt> 目錄,內含佈景主題的各種檔案。 -
<tt>classic</tt> -
<tt>classic</tt> 內有以下各種目錄。 -
<tt>browser</tt> -
<tt>browser</tt> 內含工具列、書籤管理員及選項視窗的各種圖示。 -
<tt>global</tt> -
所有指定瀏覽器物件顯示方式的重要 CSS 檔差不多都在 <tt>global</tt> 裡面,所以這也是佈景主題最重要的目錄。 -
<tt>mozapps</tt> -
<tt>mozapps</tt> 則有擴充套件管理員和更新精靈等視窗的樣式及圖示。 -
<tt>help</tt> -
<tt>help</tt> 裡頭是說明手冊視窗的佈景檔。 -
<tt>communicator</tt> -
沒什麼重要的東西,基本上不理它也無妨。 -
-

安裝你的新佈景主題

-

由於動態變更佈景主題在設定上有點麻煩,所以修改 Firefox 佈景主題後若想看到變化,得先學學重新包裝內建主題使其可安裝於 Firefox 的方法。接下來我們將把範例佈景主題命名為「My_Theme」,當然你也可以換成自己喜歡的名字。 -

-
複製必備檔案
-

首先要將所有檔案以正確的目錄結構放好,所以請先建立一個名為 <tt>My_Theme</tt> 的目錄,然後在其中放進剛剛解壓縮出來的 <tt>browser</tt>、<tt>global</tt>、<tt>communicator</tt>、<tt>help</tt> 及 <tt>mozapps</tt> 目錄,當然 <tt>icon.png</tt> 和 <tt>preview.png</tt> 也要放進去。沒錯,這表示此新目錄內容結構與 <tt>classic.jar</tt> 沒什麼不同。 -

-
建立安裝檔
-
Contents.rdf
-

複製 contents.rdf 並放進 <tt>\My_Theme</tt> 中,接著以文字編輯器開啟之。這個檔案是用以描述佈景主題的小型 XML 資料庫。 -

在程式碼中搜尋所有的「My_Place」字串,換成你自己取的佈景主題名稱。 -

而接下來的「包裝」區段列出你修改了哪些瀏覽器外觀組件。假設這個佈景包含 Chatzilla 的樣式,那麼也要加上另一行類似的程式、改以指定 Chatzilla。不過,以下的清單就是我們要改的所有東西,所以只要把藍色字稍加修改,符合你在本節之前所用的主題名稱即可。 -

-
<RDF:li resource="urn:mozilla:skin:My_Theme:communicator"/>
-<RDF:li resource="urn:mozilla:skin:My_Theme:editor"/>
-<RDF:li resource="urn:mozilla:skin:My_Theme:global"/>
-<RDF:li resource="urn:mozilla:skin:My_Theme:messenger"/>
-<RDF:li resource="urn:mozilla:skin:My_Theme:navigator"/>
-
-

接著存檔,關閉文字編輯器。 -

-
install.rdf
-

複製 install.rdf 並放進 <tt>My_Theme</tt> 目錄中,接著以文字編輯器開啟之。這個檔案也是用以描述佈景主題的小型 XML 資料庫。 -

-
  <Description about="urn:mozilla:install-manifest">
-  <em:id>{Themes_UUID}</em:id>
-  <em:version>Themes_Version</em:version>
-
-

在第一段中你必須為佈景主題製作一個 UUID,然後為此佈景主題版本編號。將上述兩種資訊填入第一段後繼續看下去。 -

接著要更改目標應用程式(在本例為 Firefox)的相容版本,填入最低需求跟最高相容限制版本號: -

-
  <em:targetApplication>
-    <Description>
-      <!-- Firefox 的 UUID -->
-      <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-      <em:minVersion>Min_FF_Version</em:minVersion>
-      <em:maxVersion>Max_FF_Version</em:maxVersion>
-    </Description>
-  </em:targetApplication>
-
-

設定相容版本號可以確保佈景主題不會裝在無法相容(或還沒測試過)的版本上,以免出問題。 -

-

CSS 檔案

-

這些目錄中的 CSS 檔告訴瀏覽器顯示按鈕或其他控制項的方式、在哪裡放圖、邊框跟內距該有多少等資訊。 -

接下來的例子,我們就試著更動標準按鈕。 -

將 <tt>global</tt> 目錄裡的 <tt>button.css</tt> 開啟於純文字編輯器中,接著找到 button { 區段;這一段定義一般狀態(滑鼠未移上、未停用也未選取)下的按紐圖樣。 -

background-color: 特性值改為 DarkBlue,再將 color: 改為 White,接著存檔。file. -

-
原作者註:more after I get done with some tests
-

重新包裝 JAR

-

現在只要用任一種 ZIP 壓縮軟體依下列目錄結構重新包裝 JAR 檔就行了: -

/browser/*
-/communicator/*
-/global/*
-/help/*
-/mozapps/*
-/contents.rdf
-/install.rdf
-/icon.png
-/preview.png
-  
-

要注意的是別連 <tt>My_Theme</tt> 這個上層目錄都壓了進去,不然稍後用拖曳方式安裝佈景時會在毫無錯誤訊息的情況下安裝失敗。 -

-

從 Web 上安裝佈景主題

-

若想直接從網路上安裝佈景主題的 JAR 檔,可以採用這樣的 JavaScript: -

-
<a href='javascript:InstallTrigger.installChrome(InstallTrigger.SKIN,
- "myskin.jar", "My Skin Theme")'>安裝佈景主題</a>
-
-

而若要將 JAR 檔下載至硬碟後安裝,則可使用這個表單。 -

當然你也可以直接開啟 Mozilla 的佈景主題視窗,然後將 .jar 檔案拖進去安裝。 -

將資料夾轉為 .jar 檔超簡單,只要先壓縮成 .zip 檔後將「.zip」更名為「.jar」就行了。 -

-
-
-{{ languages( { "de": "de/Theme_erstellen/Einf\u00fchrung", "en": "en/Creating_a_Skin_for_Firefox//Getting_Started", "es": "es/Creando_un_skin_para_Firefox/Como_empezar", "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox//Premiers_pas", "ja": "ja/Creating_a_Skin_for_Firefox/Getting_Started", "pl": "pl/Tworzenie_sk\u00f3rek_dla_Firefoksa/Zaczynamy", "pt": "pt/Criando_um_visual_para_o_Firefox/Iniciando" } ) }} -- cgit v1.2.3-54-g00ecf