Seems that in Chrome for Android version 65, a "feature" was introduced which doesn't allow you to take a screenshot in Incognito mode.
When attempting to take a screenshot, Android will now show an alert saying "Taking screenshots isn't allowed by the app or your organization."
/**
* Sets the attributes flags to secure if there is an incognito tab visible.
*/
@VisibleForTesting
void updateIncognitoState() {
WindowManager.LayoutParams attributes = mWindow.getAttributes();
boolean currentSecureState = (attributes.flags & WindowManager.LayoutParams.FLAG_SECURE)
== WindowManager.LayoutParams.FLAG_SECURE;
boolean expectedSecureState = isShowingIncognito();
if (currentSecureState == expectedSecureState) return;
if (expectedSecureState) {
mWindow.addFlags(WindowManager.LayoutParams.FLAG_SECURE);
} else {
mWindow.clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
}
Source: chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoTabSnapshotController.java
This is imposing rules you can expect to have in a enterprise environment on a personal phone.
The operation system UI should make clear when and how other apps are recording the screen. As an app developer, I should not be bothered with avoiding screen captures. Breaking this functionality breaks the lowest common denominator of data sharing: Taking a screenshot. One of the reason to make a screenshot is just because an application misses a proper data export functionality.
Source: HN Discussion
Is there any way to disable or prevent this behavior?