Skip to content

Instantly share code, notes, and snippets.

@Rob--W
Created August 2, 2019 15:20
Show Gist options
  • Save Rob--W/cd9839f5157019912e68e8e4e3e15eb0 to your computer and use it in GitHub Desktop.
Save Rob--W/cd9839f5157019912e68e8e4e3e15eb0 to your computer and use it in GitHub Desktop.
Dummy extension to prevent elision of "http" / "file" / subdomains from the omnibox in Chrome. Use this instead of the "Suspicious Site Reporter".
// This is a dummy extension that prevents elision of "http" / "file" / subdomains
// from the omnibox by impersonating the "Suspicious Site Reporter" extension.
// Do not use this if you use the "Suspicious Site Reporter" extension.
//
// Usage:
// 1. Create a directory, e.g. "prevent-elision-in-locationbar"
// 2. Put the content of this file as "manifest.json" in that directory.
// 3. Visit chrome://extensions, choose the "Load Unpacked" button and select the directory.
// (OR use the --load-extension=path/to/prevent-elision-in-locationbar flag to load the extension)
// Result:
// - Schemes such as "https" / "file", and domains are not elided any more.
// Alternative:
// - Start Chrome with the following flag:
// --disable-features=OmniboxUIExperimentHideSteadyStateUrlScheme,OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains,OmniboxUIExperimentHideFileUrlScheme
//
// Note: The "http" scheme will still be elided.
// If you want to preserve "http", compile Chromium yourself, with this patch:
// https://github.com/Rob--W/https-by-default/blob/master/chrome/https-by-default.patch
{
"name": "ShouldPreventElision() = true",
"description": "Prevent elision; equivalent to --disable-features=OmniboxUIExperimentHideSteadyStateUrlScheme,OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains,OmniboxUIExperimentHideFileUrlScheme",
"version": "1",
"manifest_version": 2,
// Extension ID jknemblkbdhdcpllfgbfekkdciegfboi
// From https://chromium.googlesource.com/chromium/src/+/40dbe9f7832e6c975e22ee2c9a3335ff8e878220/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc#42
// Chosen because having the extension enabled prevents various parts of the omnibox from being stripped
// https://chromium.googlesource.com/chromium/src/+/c26ef30d0961cbcdf2a226792922d73e6a1fc59f/components/omnibox/browser/location_bar_model_impl.cc#54
// Introduced in https://bugs.chromium.org/p/chromium/issues/detail?id=914422
// Created on 9 July 2019, tested in Chromium 75.0.3770.90
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAowA8wOUQ8ShyITJ15B9rcJrnoolyo+OLj07g8QWBlEBikgszYwlbc88OIRL+dJOASok3yG6RQ60fvIjBrtNEk1yQZJfNwF/CN0jFrkE3HN3xVMoX0XIQPB93kDZARcfR5nwU3RUgwwWGTqt69KSSU8QzRRQJSEgM8GENa3OBhw1UBn/I/RbhaFcTykJSomo9j55goJwNzUhXTJk458DQ5diY+gWMadDXlDBa8cciCVlaGOjBV5ezmxnD6p1GXhrvyEKZP8IlreDJC2Nw9hxrT3GIo1FzbmeDPANKJ9pkY1H3LOVsGJDtytBpD/FRErlvfkJVqp3N5ifF2EQ8lOAHrQIDAQAB"
}
@chabala
Copy link

chabala commented Dec 10, 2022

A helpful warning from Chrome:

Manifest version 2 is deprecated, and support will be removed in 2023. See https://developer.chrome.com/blog/mv2-transition/ for more details.

Luckily, not needed any more. Right clicking in the address bar has an 'Always show full URLs' option at the bottom of the menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment