Is it possible to disable paste protection "allow pasting" when using web-ext?

4,363 views
Skip to first unread message

Juraj M.

unread,
Apr 24, 2024, 4:22:44 AM4/24/24
to Chromium Extensions
I'm using amazing "web-ext" for development which opens new Chrome instance, which means all warnings are reset every time when I start working.

And one of the more annoying warnings is the "allow pasting" which needs to be typed manually:

Is there a way to disable it somehow? I see the "Chrome for Testing" has it disabled, but it also won't auto-update which is also not great.

Patrick Kettner

unread,
Apr 24, 2024, 8:06:59 AM4/24/24
to Juraj M., Chromium Extensions
Hi Juraj!

Not currently. There is a bug, but it isn't fixed yet. 

The "allow pasting" thing will show up for profiles that have fewer than 5 console unique history entries. The simplest way I have found to avoid having to type that is to do the numbers 1-5, hitting enter after each one. For whatever reason, I find this ever so slightly less obnoxious to use. 
If you would be able to chime in on that bug with your usecase for getting a flag to disable it, it will help that team prioritize it and potentially ship one faster. 

patrick

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/09ee9561-5a80-4c90-bb78-5ce0811f73ccn%40chromium.org.

Juraj M.

unread,
Apr 24, 2024, 8:55:46 AM4/24/24
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Juraj M.
Thanks Patrick!
Done :)

Patrick Kettner

unread,
Apr 24, 2024, 9:01:36 AM4/24/24
to Juraj M., Chromium Extensions
There may be a bug in web-ext with how it creates a chrome profile. Running `web-ext run -t chromium --chromium-profile /tmp/fakeprofile --profile-create-if-missing` will reuse the same directory, but wherever the setting that saves selfXssWarningDisabledSetting is stored, it is not being copied over. But when you use the chrome flag `--user-data-dir` directly, it does persist the setting.

Juraj M.

unread,
Apr 24, 2024, 9:14:42 AM4/24/24
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Juraj M.
Good idea!
I remember using existing profile used to be buggy in web-ext, I've reported some issues many years ago: https://github.com/mozilla/web-ext/issues/1363
Since then I'm always using clean profile so I've totally forgot there is this feature.

wOxxOm

unread,
Apr 24, 2024, 10:27:58 AM4/24/24
to Chromium Extensions, Juraj M., Patrick Kettner, Chromium Extensions
Reusing the same profile may be undesirable for testing.

There's a way to do it without reusing the entire profile by providing a barebones Preferences file.
You can also configure other parameters for devtools by copying them from your normal Preferences file, which is just a minified JSON.

1. Create an empty directory c:\foo in Windows or ~/foo in other OS
2. Inside of foo create an empty directory Default
3. Inside Default create Preferences file (without extension) like this:

{
  "devtools": {
    "preferences": {
      "disable-self-xss-warning": "true"
    }
  }
}

4. Start web-ext run --target chromium --chromium-profile c:\foo

Patrick Kettner

unread,
Apr 24, 2024, 10:34:02 AM4/24/24
to wOxxOm, Chromium Extensions, Juraj M.
Great call, thanks wOxxOm!

Juraj M.

unread,
Apr 25, 2024, 5:18:52 AM4/25/24
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Juraj M., wOxxOm
Whoa! This is amazing!
I'm looking at this "Preferences" file for my main Chrome and there is a bunch of other preferences you can set, things I've been doing manually, like moving the window to my secondary screen, changing dev-tools position/size...
And I can even pin my extension to toolbar with "pinned_extensions" array! :D Amazing! Even "snoozed_feature" to get rid of other popups.
This is gonna save me so much work and time!

Big THANKS @wOxxOm! You've made my day :)
Reply all
Reply to author
Forward
0 new messages