In my newest Bug 1067293 I had to implement something like this ```javascript let trimHttps = lazy.UrlbarPrefs.get("trimHttps"); if (trimHttps && this._untrimmedValue.startsWith("https://")) { untrim = fixedURI.displaySpec.replace("http://", "https://"); } else { untrim = fixedURI.displaySpec != expectedURI.displaySpec; } ``` in order to ensure that the correct protocol is restored when "untrimming".
Bug 1847723 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
In my newest Bug 1067293 I had to implement something like this ```javascript let trimHttps = lazy.UrlbarPrefs.get("trimHttps"); if (trimHttps && this._untrimmedValue.startsWith("https://")) { untrim = fixedURI.displaySpec.replace("http://", "https://"); } else { untrim = fixedURI.displaySpec != expectedURI.displaySpec; } ``` in order to ensure that the correct protocol is restored when "untrimming". So, yes I mean the first thing. `fixedURI.displaySpec` is not returning the 'http://' scheme also when a user enterd a url with `https://` scheme
In my newest Bug 1067293 I had to implement something like this ```javascript let trimHttps = lazy.UrlbarPrefs.get("trimHttps"); if (trimHttps && this._untrimmedValue.startsWith("https://")) { untrim = fixedURI.displaySpec.replace("http://", "https://"); } else { untrim = fixedURI.displaySpec != expectedURI.displaySpec; } ``` in order to ensure that the correct protocol is restored when "untrimming". So, yes I mean the first thing. `fixedURI.displaySpec` is not returning the 'http://' scheme when a user entered an URL with `https://` scheme
In my newest Bug 1067293 I had to implement something like this ```javascript let trimHttps = lazy.UrlbarPrefs.get("trimHttps"); if (trimHttps && this._untrimmedValue.startsWith("https://")) { untrim = fixedURI.displaySpec.replace("http://", "https://"); } else { untrim = fixedURI.displaySpec != expectedURI.displaySpec; } ``` in order to ensure that the correct protocol is restored when "untrimming". So, yes I mean the first thing. `fixedURI.displaySpec` is not returning the 'http://' scheme when a user entered an URL with `https://` scheme.
In Bug 1067293 I had to implement something like this ```javascript let trimHttps = lazy.UrlbarPrefs.get("trimHttps"); if (trimHttps && this._untrimmedValue.startsWith("https://")) { untrim = fixedURI.displaySpec.replace("http://", "https://"); } else { untrim = fixedURI.displaySpec != expectedURI.displaySpec; } ``` in order to ensure that the correct protocol is restored when "untrimming". So, yes I mean the first thing. `fixedURI.displaySpec` is not returning the 'http://' scheme when a user entered an URL with `https://` scheme.