@@ -123,32 +123,22 @@ document.querySelector("form").addEventListener("submit", async event => {
123
123
// We need the raw XML instead of the pretty HTML view
124
124
let url = json . url + "/raw" ;
125
125
126
- let { version} = await browser . runtime . getBrowserInfo ( ) ;
127
- version = + / ( \d + ) \. / . exec ( version ) [ 0 ] ;
128
- if ( version >= 78 ) {
129
- // Mozilla intentionally disabled AddSearchProvider :(
130
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1632447
131
-
132
- let link = document . createElement ( "link" ) ;
133
- link . rel = "search" ;
134
- link . type = "application/opensearchdescription+xml" ;
135
- link . title = document . querySelector ( "#input-name" ) . value ;
136
- link . href = url ;
137
-
138
- // This doesn't actually seem to work. Firefox seems to cache.
139
- let existing = document . querySelector ( "link[rel=search]" ) ;
140
- if ( existing ) {
141
- existing . remove ( ) ;
142
- }
143
-
144
- document . head . append ( link ) ;
145
-
146
- document . querySelector ( "#main" ) . style . display = "none" ;
147
- document . querySelector ( "#instructions" ) . style . display = "block" ;
148
- } else {
149
- // Where the magic used to happen ...
150
- window . external . AddSearchProvider ( url ) ;
126
+ let link = document . createElement ( "link" ) ;
127
+ link . rel = "search" ;
128
+ link . type = "application/opensearchdescription+xml" ;
129
+ link . title = document . querySelector ( "#input-name" ) . value ;
130
+ link . href = url ;
131
+
132
+ // This doesn't actually seem to work. Firefox seems to cache.
133
+ let existing = document . querySelector ( "link[rel=search]" ) ;
134
+ if ( existing ) {
135
+ existing . remove ( ) ;
151
136
}
137
+
138
+ document . head . append ( link ) ;
139
+
140
+ document . querySelector ( "#main" ) . style . display = "none" ;
141
+ document . querySelector ( "#instructions" ) . style . display = "block" ;
152
142
} catch ( error ) {
153
143
alert ( error ) ;
154
144
} ;
0 commit comments