نظرة عامة على "الأنشطة الموثوق بها على الويب"
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
النشاط الموثوق به على الويب هو طريقة جديدة لفتح محتوى تطبيق الويب، مثل تطبيق الويب التقدّمي (PWA) من تطبيق Android باستخدام بروتوكول يستند إلى علامات التبويب المخصّصة.
ملاحظة: تتوفّر ميزة "الأنشطة الموثوق بها على الويب" في الإصدار 72 من Chrome على Android والإصدارات الأحدث.
هل تبحث عن الرمز؟
هناك بعض الاختلافات بين ميزة "النشاط الموثوق به على الويب" وطرق فتح محتوى الويب الأخرى من تطبيق Android:
- يكون المحتوى في "النشاط الموثوق به على الويب" موثوقًا به، ومن المتوقّع أن يكون التطبيق والموقع الإلكتروني الذي يفتحه من المطوّر نفسه. (يتم التحقّق من ذلك باستخدام روابط تنقل إلى مواد عرض رقمية).
- يأتي المحتوى المعروض في "نشاط موثوق على الويب" من الويب: يعرضه متصفّح المستخدم بالطريقة نفسها التي يعرض بها المحتوى في المتصفّح، باستثناء أنّه يتم تشغيله بملء الشاشة. يجب أن يكون محتوى الويب متاحًا ومفيدًا في المتصفّح أولاً.
- يتم أيضًا تحديث المتصفّحات بشكل مستقل عن Android وتطبيقك، ما يحدّ من حجم حزمة APK ويضمن لك استخدام بيئة تشغيل حديثة للويب. (يُرجى العِلم أنّه منذ Lollipop، تم أيضًا تحديث WebView بشكل مستقل عن Android، ولكن هناك عدد كبير من مستخدمي Android الذين يستخدمون إصدارًا أقدم من Lollipop).
- لا يمكن للتطبيق المضيف الوصول مباشرةً إلى محتوى الويب في "نشاط الويب الموثوق به" أو أي نوع آخر من حالات الويب، مثل ملفات تعريف الارتباط و
localStorage
. ومع ذلك، يمكنك التنسيق مع محتوى الويب من خلال نقل البيانات من الصفحة وإليها في عناوين URL (مثلاً من خلال مَعلمات طلب البحث ومعرّفات الموارد المنتظمة للنوايا).
- تكون الانتقالات بين المحتوى على الويب والمحتوى الأصلي بين الأنشطة. كل نشاط (أي شاشة) في تطبيقك إما أن يقدّمه الويب بالكامل أو نشاط Android.
لتسهيل عملية الاختبار، لا تتوفّر حاليًا أيّ مؤهّلات للمحتوى الذي يتم فتحه في معاينة أنشطة الويب الموثوق بها. ومع ذلك، من المتوقّع أن تستوفي أنشطة الويب الموثوق بها متطلبات الإضافة إلى الشاشة الرئيسية نفسها. يمكنك فحص موقعك الإلكتروني للتأكّد من استيفائه لهذه المتطلبات باستخدام عملية تدقيق Lighthouse "يمكن أن يُطلب من المستخدم إضافة التطبيق إلى الشاشة الرئيسية".
في الوقت الحالي، يمكن للمتصفّحات الأخرى تنفيذ البروتوكول نفسه الذي تستخدمه أنشطة الويب الموثوق بها. على الرغم من أنّ التطبيق المضيف هو صاحب القرار النهائي بشأن المتصفّح الذي سيتم فتحه، ننصحك بالسياسة نفسها المتّبعة في علامات التبويب المخصّصة: استخدام المتصفّح التلقائي للمستخدم، ما دام هذا المتصفّح يوفّر الإمكانات المطلوبة.
ما هي الخطوة التالية؟
إذا كنت تبحث عن إنشاء تطبيق Android بسرعة لتشغيل تطبيق الويب التقدّمي وفتحه، يمكنك الاطّلاع على دليل البدء السريع.
في حال دمج ميزة "النشاط على الويب الموثوق به" في تطبيق Android حالي، يمكنك الاطّلاع على دليل الدمج للبدء.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Overview of Trusted Web Activities\n\n**Trusted Web Activity** is a new way to open *your* web-app content such as *your* Progressive Web App (PWA) from *your* Android app using a protocol based on Custom Tabs.\n\n**Note** : Trusted Web Activity is available in [Chrome on Android](https://play.google.com/store/apps/details?id=com.android.chrome), version 72 and above.\n\n*Looking for the code?*\n\n- [android-browser-helper library on GitHub](https://github.com/GoogleChrome/android-browser-helper)\n- [Trusted Web Activity demos](https://github.com/GoogleChrome/android-browser-helper/tree/master/demos)\n- [Bubblewrap, a NodeJs library / CLI to generate and build Trusted Web Activity projects](https://github.com/GoogleChromeLabs/bubblewrap)\n\nThere are a few things that make Trusted Web Activity different from other ways to open web content from your Android app:\n\n1. Content in a Trusted Web activity is **trusted** -- the app and the site it opens are expected to come from the same developer. (This is verified using [Digital Asset Links](https://developers.google.com/digital-asset-links/v1/getting-started).)\n2. The content rendered in a Trusted Web Activity comes from the **web**: they're rendered by the user's browser, in exactly the same way as a user would see it in their browser except they are run fullscreen. Web content must be accessible and useful in the browser first.\n3. Browsers are also updated independent of Android and your app. That saves on APK size and ensures you can use a modern web runtime. (Note that since Lollipop, WebView has also been updated independent of Android, but there are a [significant number](/about/dashboards) of pre-Lollipop Android users.)\n4. The host app doesn't have direct access to web content in a Trusted Web Activity or any other kind of web state, like cookies and `localStorage`. Nevertheless, you can coordinate with the web content by passing data to and from the page in URLs (e.g. through query parameters and [intent URIs](https://developer.chrome.com/docs/multidevice/android/intents).)\n5. Transitions between web and native content are between **activities**. Each activity (i.e. screen) of your app is either completely provided by the web, or by an Android activity\n\nTo make it easier to test, there are currently no qualifications for content opened in the preview of Trusted Web activities. You can expect, however, that Trusted Web activities need to meet the same [Add to Home Screen](https://web.dev/customize-install#criteria) requirements. You can audit your site for these requirements using the [Lighthouse](https://web.dev/measure/) \"*user can be prompted to Add to Home screen*\" audit.\n\nToday, it is possible for other browsers to implement the same protocol that Trusted Web activities use. While the host app has the final say on what browser gets opened, we recommend the same policy as for Custom Tabs: use the user's default browser, so long as that browser provides the required capabilities.\n\nWhere to go next?\n-----------------\n\nIf you are looking for quickly building an Android app that just starts and opens your PWA, checkout out the [Quick Start Guide](https://developer.chrome.com/docs/android/trusted-web-activity/quick-start).\n\nIf integrating Trusted Web Activity into an existing Android App, the [Integration Guide](https://developer.chrome.com/docs/android/trusted-web-activity/integration-guide) is a good place to get started."]]