Experimental user scripts support (#857)

* version 0.5

* fix whitespace errors and rebase with 87.0.4280.106

* fix bug [FATAL:utf_string_conversions.cc(338)] Check failed: IsStringASCII(utf16). Tampermonkey • Userscript Sources

* add details for unmatch header, bug DOCUMENT_START not work, add a flag for logging

* deny network access to injected scripts

* removed log + fix ui + upstream update (@9f2aac4)

* update patch for v88

* force char as unsigned in invalidChar

* adapt to v89, add view script source, replace checkbox in preferences, removed extension work, add support to non-standard @url declaration, use saf directly

* updates for v90

* update for v91

* remove flag and keep only toggle
tell that the script has failed with errors
remove copy to temporary file
remove approach with XML overlays so that there are no exceptions thrown while inflating

* change install message + add homepage support + make url clickable

* adaptation for v92

* v93 ready

* add prompt also after selecting file by ui, remove prefs addon patch, add commit message

* add README.md
This commit is contained in:
uazo 2021-10-23 12:53:42 +02:00 committed by GitHub
parent 90baa52b27
commit 01d2217a21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10689 additions and 0 deletions

View file

@ -162,3 +162,4 @@ Site-setting-for-images.patch
Bromite-auto-updater.patch
Add-flag-to-disable-pull-to-refresh-effect.patch
Automated-domain-substitution.patch
experimental-user-scripts-support.patch

View file

@ -0,0 +1,44 @@
From: uazo <uazo@users.noreply.github.com>
Date: Mon, 17 May 2021 12:30:12 +0000
Subject: Add support for ISupportHelpAndFeedback
---
.../chrome/browser/settings/SettingsActivity.java | 10 +++++++---
.../components/browser_ui/settings/SettingsUtils.java | 4 ++++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
@@ -282,9 +282,13 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
finish();
return true;
} else if (item.getItemId() == R.id.menu_id_general_help) {
- HelpAndFeedbackLauncherImpl.getInstance().show(this,
- getString(R.string.help_context_settings), Profile.getLastUsedRegularProfile(),
- null);
+ if (mainFragment instanceof SettingsUtils.ISupportHelpAndFeedback) {
+ ((SettingsUtils.ISupportHelpAndFeedback)mainFragment).onHelpAndFeebackPressed();
+ } else {
+ HelpAndFeedbackLauncherImpl.getInstance().show(this,
+ getString(R.string.help_context_settings), Profile.getLastUsedRegularProfile(),
+ null);
+ }
return true;
}
return super.onOptionsItemSelected(item);
diff --git a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
--- a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
+++ b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
@@ -126,4 +126,8 @@ public class SettingsUtils {
ImageView imageButton = (ImageView) button;
return imageButton.getDrawable() == parentMenu.getOverflowIcon();
}
+
+ public interface ISupportHelpAndFeedback {
+ void onHelpAndFeebackPressed();
+ }
}
--
2.17.1

File diff suppressed because it is too large Load diff