نظرة عامة على علامات تبويب Android المخصَّصة
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
علامات التبويب المخصّصة هي ميزة في متصفّحات Android توفّر لمطوّري التطبيقات
طريقة لإضافة تجربة مخصّصة للمتصفّح مباشرةً داخل تطبيقاتهم.
كان تحميل محتوى الويب جزءًا من تطبيقات الأجهزة الجوّالة منذ الأيام الأولى للهواتف الذكية، ولكن يمكن أن تشكل الخيارات القديمة تحديات للمطوّرين. إنّ تشغيل المتصفّح الفعلي هو عملية تبديل سياق صعبة للمستخدمين ولا يمكن تخصيصها، في حين أنّ WebViews لا تتوافق مع جميع ميزات منصة الويب، ولا تشارك الحالة مع المتصفّح وتضيف عبءً إضافيًا على الصيانة.
تتيح علامات التبويب المخصّصة للمستخدمين البقاء داخل التطبيق أثناء التصفّح، ما يزيد من
التفاعل ويقلل من خطر إيقاف المستخدمين للتطبيق. تعمل علامات التبويب المخصّصة
باستخدام المتصفّح المفضّل للمستخدم مباشرةً وتشارك تلقائيًا
الحالة والميزات التي يوفّرها. لست بحاجة إلى كتابة رمز مخصّص لإدارة
الطلبات أو عمليات منح الأذونات أو ملفّات تعريف الارتباط.
ما هي الإجراءات التي يمكن أن تتّخذها علامات التبويب المخصّصة؟
باستخدام علامة تبويب مخصّصة، يتم تحميل محتوى الويب باستخدام أيّ محرك عرض
يشغّل المتصفّح المفضّل للمستخدم. وتتوفّر أي واجهة برمجة تطبيقات أو ميزة لمنصّة ويب هناك، كما تتوفّر في علامة التبويب المخصّصة. تظهر جلسة التصفّح
وكلمات المرور وطرق الدفع والعناوين المحفوظة تمامًا كما هو الحال في متصفحهم المعتاد.
ما الذي يمكنني تخصيصه في علامة التبويب المخصّصة؟
كثيرًا. تمنحك علامات التبويب المخصّصة إمكانية التحكّم بدقة في الكثير من ميزات المتصفّح Chrome وتجربة المستخدم. في تطبيقك، يمكنك تشغيل علامة تبويب مخصّصة باستخدام
Intent. عند استدعاء هذا الإجراء، يمكنك إضافة عدد من السمات إلى CustomTabIntent للحصول على التجربة الدقيقة التي تريدها. في ما يلي بعض
التخصيصات التي يمكنك إضافتها:
- رسوم متحركة مخصّصة للدخول والخروج لتتطابق مع بقية تطبيقك
- تعديل لون شريط الأدوات ليتناسب مع علامة تطبيقك التجارية
- اتساق الألوان في تطبيقك حتى في حال التبديل بين المظهرَين الفاتح والداكن
- الإجراءات والإدخالات المخصّصة في شريط أدوات المتصفّح وقوائمه
- التحكّم في ارتفاع إطلاق "العلامة المخصّصة"، ما يتيح بث
فيديوهاتك أثناء التفاعل مع متجرك على الويب
بالإضافة إلى ذلك، يمكن للمستخدمين تصغير علامة التبويب المخصّصة للتفاعل مع التطبيق الأساسي، واستعادتها في أي وقت بدون فقدان أي تقدّم لاستئناف تجربتهم. يمنح ذلك المستخدمين بديلاً لإغلاق "علامة التبويب المخصّصة" حتى يتمكّنوا من
تنفيذ مهام متعدّدة بسلاسة بين الويب والتطبيق الأصلي. تكون الميزة
مفعّلة تلقائيًا في "علامات التبويب المخصّصة".
هذا أبعد ما يكون عن الحقيقة. إنّ علامات التبويب المخصّصة فعّالة جدًا، وهي قيد تطوير نشط. على كل متصفّح إضافة إتاحة هذه الميزات عند بدء
توفّرها. على الرغم من أنّ جميع المتصفّحات توفّر مستوى معيّنًا من التوافق، من المهم معرفة
الميزات التي قد تكون متاحة أو غير متاحة في متصفّحات المستخدمين. يمكنك الرجوع إلى جدول مقارنة الميزات للاطّلاع سريعًا على مدى توفّر الميزات المختلفة في متصفّحات Android الرائجة.
يمكنك اختبار ذلك الآن باستخدام النموذج على GitHub.
متى يجب استخدام علامات التبويب المخصّصة؟
لا توجد طريقة واحدة "صحيحة" لتحميل محتوى الويب. في بعض الحالات، سيكون WebView هو التكنولوجيا المناسبة للاستخدام. على سبيل المثال، إذا كنت
تستضيف المحتوى الخاص بك حصريًا داخل تطبيقك، أو إذا كنت بحاجة إلى إدراج
javascript مباشرةً من تطبيقك. إذا كان تطبيقك يوجّه المستخدمين إلى عناوين URL خارج
النطاقات، تعني الحالة المشترَكة المضمّنة في علامات التبويب المخصّصة أنّها على الأرجح خيار
أفضل. تشمل نقاط القوة الأخرى لميزة "علامات التبويب المخصّصة" ما يلي:
- الأمان: تستخدم ميزة "علامات التبويب المخصّصة" ميزة "التصفّح الآمن" من Google لحماية المستخدم والجهاز من المواقع الإلكترونية الخطيرة.
- تحسين الأداء:
- بدء تشغيل المتصفّح مسبقًا في الخلفية مع تجنُّب سرقة موارد التطبيق
- يمكنك تسريع مدة تحميل الصفحة من خلال تحميل عناوين URL بشكل استباقي.
- إدارة دورة الحياة: لن يُخرج النظام التطبيقات التي تطلِق علامة تبويب مخصّصة أثناء استخدام علامة التبويب. يتم رفع أهمية علامة التبويب المخصّصة
إلى مستوى المقدّمة.
- نموذج مشترَك لحاويات ملفات تعريف الارتباط والأذونات حتى لا يحتاج المستخدمون إلى تسجيل الدخول إلى
المواقع الإلكترونية
التي سبق لهم الربط بها أو إعادة منح الأذونات التي سبق لهم منحَها.
- تتوفّر ميزات المتصفّح، مثل الملء التلقائي لإكمال النماذج بشكل أفضل، بشكل تلقائي.
- يمكن للمستخدمين العودة إلى التطبيق باستخدام زر الرجوع المدمج.
علامات التبويب المخصّصة في مقابل "النشاط الموثوق به على الويب"
توفّر ميزة الأنشطة الموثوق بها على الويب ميزات إضافية لبروتوكول علامات التبويب المخصَّصة وتشارك معظم
مزاياه. ولكن بدلاً من توفير واجهة مستخدم مخصّصة، يسمح هذا الإجراء للمطوّرين بفتح علامة تبويب في المتصفّح بدون أي واجهة مستخدم على الإطلاق. ننصح المطوّرين الذين يريدون
فتح تطبيق ويب تقدّمي خاص بهم في وضع ملء الشاشة داخل
تطبيق Android الخاص بهم.
أين تتوفّر علامات التبويب المخصّصة؟
علامات التبويب المخصّصة هي ميزة تتيحها المتصفّحات على نظام التشغيل Android. وقد تم طرحه
أصلاً من خلال Chrome في الإصدار 45. يتوافق البروتوكول مع
معظم متصفّحات Android.
نبحث عن ملاحظات وأسئلة واقتراحات حول هذا المشروع، لذلك ننصح
بإرسال المشاكل على crbug.com وطرح الأسئلة على Twitter
@ChromiumDev.
مزيد من المعلومات
للاطّلاع على الأسئلة، يمكنك البحث عن علامة chrome-custom-tabs على StackOverflow.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ 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 Android Custom Tabs\n\nCustom Tabs are a feature in Android browsers that gives app developers\na way to add a customized browser experience directly within their app.\n\nLoading web content has been a part of mobile apps since the early days of\nsmartphones, but older options can present challenges for developers. Launching\nthe actual browser is a heavy context switch for users that isn't customizable,\nwhile WebViews [don't support](https://research.google/pubs/pub46739/) all features of the web platform, don't share\nstate with the browser and add maintenance overhead.\n\nCustom Tabs lets users remain within the app while browsing, increasing\nengagement and reducing the risk of users abandoning the app. Custom Tabs are\npowered directly by the user's preferred browser and automatically share the\nstate and features offered by it. You don't need to write custom code to manage\nrequests, permission grants, or cookie stores.\n\nWhat can Custom Tabs do?\n------------------------\n\nBy using a Custom Tab, your web content loads in whatever rendering engine\npowers your user's preferred browser. Any API or web platform feature is\navailable there, and is available in your Custom Tab. Their browsing session,\nsaved passwords, payment methods, and addresses all show up just like they\nare accustomed to already.\n\nWhat can I customize in a Custom Tab?\n-------------------------------------\n\nQuite a bit! Custom Tabs give you fine grained control over a lot of the browser\nchrome and user experience. Within your app, you launch a Custom Tab using an\n[Intent](https://developer.android.com/guide/components/intents-filters). When this Intent is called, you can add a number of attributes to\nthe [CustomTabIntent](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent) to get the exact experience you want. Some\ncustomizations that you can add are listed here:\n\n- Custom entrance and exit animations to match the rest of your app\n- Modifing the toolbar color to match your app's branding\n- Color consistency that can stay with your app, even if they switch between light and dark themes\n- Custom actions and entries to the browser's toolbar, and menus\n- Control the launch height of the Custom Tab, enabling things like streaming your videos while interacting with your web store\n\nIn addition, users can minimize a Custom Tab to interact with the underlying\napp, and restore it at any time without losing any progress to resume their\njourney. This gives users an alternative to closing the Custom Tab so they can\nseamlessly multitask between the web and the native app. The feature is\nenabled by default for Custom Tabs.\n\nThat is far from everything. Custom Tabs are very powerful, and under active\ndevelopment. Each browser needs to add support for these features as they become\navailable. While nearly all have some level of support, it is important to know\nwhat may or may not be available in your user's browsers. Refer to the\n[feature comparison table](/docs/android/custom-tabs/browser-support) to quickly\ncheck the availability of the different features across popular Android\nbrowsers.\n\nYou can test this now with our [sample](https://github.com/GoogleChrome/android-browser-helper/tree/master/demos/custom-tabs-example-app) on GitHub.\n\nWhen should I use Custom Tabs?\n------------------------------\n\nThere is no single \"correct\" way to load web content. In certain situations,\nWebView is going to be the right technology to use. For example, if you are\nexclusively hosting your own content inside your app, or if you need to inject\njavascript directly from your app. If your app directs people to URLs outside\ndomains, the built-in shared state in Custom Tabs means they are likely a\nbetter choice. Other strengths of Custom Tabs include:\n\n1. Security: Custom Tabs use Google's Safe Browsing to protect the user and the device from dangerous sites.\n2. Performance optimization:\n 1. Pre-warming of the Browser in the background, while avoiding stealing resources from the application.\n 2. Speed up the page load time by speculatively loading URLs in advance.\n3. Lifecycle management: Apps launching a Custom Tab won't be evicted by the system during the Tab's use. The importance of the Custom Tab is raised to the *foreground* level.\n4. Shared cookie jar and permissions model so users don't have to sign in to sites they are already connected to, or re-grant permissions they have already granted.\n5. Browser features like autofill for better form completion are available out-of-the-box.\n6. Users can return to app with an integrated back button.\n\nCustom Tabs versus Trusted Web Activity\n---------------------------------------\n\n[Trusted Web Activities](/develop/ui/views/layout/webapps/trusted-web-activities) extend the Custom Tabs protocol and shares most of\nits benefits. But, instead of providing a customized UI, it allows developers to\nopen a browser tab without any UI at all. It is recommended for developers who\nwant to open their own [Progressive Web App](https://web.dev/progressive-web-apps/), in full screen, inside their\nown Android app.\n\nWhere are Custom Tabs available?\n--------------------------------\n\nCustom Tabs is a feature supported by browsers on the Android platform. It was\noriginally introduced by [Chrome](https://play.google.com/store/apps/details?id=com.android.chrome), on version 45. The protocol is supported\nby most Android browsers.\n\nWe're looking for feedback, questions and suggestions on this project, so we\nencourage you to file issues on [crbug.com](https://crbug.com) and ask questions on Twitter\n[@ChromiumDev](https://twitter.com/ChromiumDev).\n\nLearn more\n----------\n\nFor questions, check the [chrome-custom-tabs](https://stackoverflow.com/questions/tagged/chrome-custom-tabs) tag on StackOverflow."]]