import android.view.MotionEvent;
import android.webkit.WebView;
+import androidx.annotation.NonNull;
import androidx.core.view.NestedScrollingChild2;
import androidx.core.view.NestedScrollingChildHelper;
import androidx.core.view.ViewCompat;
private boolean domainSettingsApplied;
private int domainSettingsDatabaseId;
+ // Keep track of when the domain name changes so that domain settings can be reapplied. This should never be null.
+ private String currentDomainName = "";
+
// Track the resource requests.
private ArrayList<String[]> resourceRequests = new ArrayList<>();
private int blockedRequests;
}
+ // Current domain name. To function well when called, the domain name should never be allowed to be null.
+ public void setCurrentDomainName(@NonNull String domainName) {
+ // Store the current domain name.
+ currentDomainName = domainName;
+ }
+
+ public void resetCurrentDomainName() {
+ // Reset the current domain name.
+ currentDomainName = "";
+ }
+
+ public String getCurrentDomainName() {
+ // Return the current domain name.
+ return currentDomainName;
+ }
+
+
// Resource requests.
public void addResourceRequest(String[] resourceRequest) {
// Add the resource request to the list.