mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1168662 - Modify all outgoing Intents with CATEGORY_BROWSABLE. r=margaret
This commit is contained in:
parent
882413144c
commit
17fa688034
@ -1173,6 +1173,19 @@ public class GeckoAppShell
|
||||
final String action,
|
||||
final String title) {
|
||||
|
||||
final Intent intent = getOpenURIIntentInner(context, targetURI, mimeType, action, title);
|
||||
|
||||
if (intent != null) {
|
||||
// Only handle applications which can accept arbitrary data from a browser.
|
||||
intent.addCategory(Intent.CATEGORY_BROWSABLE);
|
||||
}
|
||||
|
||||
return intent;
|
||||
}
|
||||
|
||||
private static Intent getOpenURIIntentInner(final Context context, final String targetURI,
|
||||
final String mimeType, final String action, final String title) {
|
||||
|
||||
if (action.equalsIgnoreCase(Intent.ACTION_SEND)) {
|
||||
Intent shareIntent = getShareIntent(context, targetURI, mimeType, title);
|
||||
return Intent.createChooser(shareIntent,
|
||||
@ -1200,9 +1213,6 @@ public class GeckoAppShell
|
||||
return null;
|
||||
}
|
||||
|
||||
// Only handle applications which can accept arbitrary data from a browser.
|
||||
intent.addCategory(Intent.CATEGORY_BROWSABLE);
|
||||
|
||||
// Prevent site from explicitly opening our internal activities, which can leak data.
|
||||
intent.setComponent(null);
|
||||
nullIntentSelector(intent);
|
||||
|
Loading…
Reference in New Issue
Block a user