mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-05 17:45:49 +01:00
feat(youtube): open-links-externally
patch
This commit is contained in:
parent
d65a107c53
commit
4cbe8338b3
@ -0,0 +1,19 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public class OpenLinksExternallyPatch {
|
||||
/**
|
||||
* Override 'android.support.customtabs.action.CustomTabsService',
|
||||
* in order to open links in the default browser. This is done by returning an empty string,
|
||||
* for the service that handles custom tabs in the Android support library
|
||||
* which opens links in the default service instead.
|
||||
*
|
||||
* @param original The original custom tabs service.
|
||||
* @return The new, default service to open links with or the original service.
|
||||
*/
|
||||
public static String enableExternalBrowser(String original) {
|
||||
if (SettingsEnum.ENABLE_EXTERNAL_BROWSER.getBoolean()) original = "";
|
||||
return original;
|
||||
}
|
||||
}
|
@ -100,6 +100,7 @@ public enum SettingsEnum {
|
||||
ENABLE_MINIMIZED_PLAYBACK("revanced_enable_minimized_playback", true, ReturnType.BOOLEAN),
|
||||
OPEN_LINKS_DIRECTLY("revanced_uri_redirect", true, ReturnType.BOOLEAN, true),
|
||||
DISABLE_ZOOM_HAPTICS("revanced_disable_zoom_haptics", true, ReturnType.BOOLEAN, false),
|
||||
ENABLE_EXTERNAL_BROWSER("revanced_enable_external_browser", true, ReturnType.BOOLEAN, true),
|
||||
|
||||
// Swipe controls
|
||||
ENABLE_SWIPE_BRIGHTNESS("revanced_enable_swipe_brightness", true, ReturnType.BOOLEAN),
|
||||
|
Loading…
Reference in New Issue
Block a user