baptx

restore Twitter search engine plugin on Firefox 78

Jul 5th, 2020
219
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. https://superuser.com/questions/7327/how-to-add-a-custom-search-engine-to-firefox/1566328#1566328
  2.  
  3. Here is how I restored the Twitter search engine for Firefox, which seems to have been removed in Firefox 78 (you could create a search for other websites also based on this answer):
  4.  
  5. I tested with the Linux version of Firefox (Ubuntu package) but it should work with any operating system by creating the `distribution` folder / subfolders and search plugin file (https://wiki.mozilla.org/Mobile/Distribution_Files).
  6.  
  7. In my profile folder `.mozilla/firefox/xxx.default/`, there was a file `search-metadata.json` that contained a link to a non-existing file `/usr/lib/firefox/distribution/searchplugins/locale/en-US/twitter.xml`.
  8.  
  9. So I created this file with the following content (based on the documentation https://developer.mozilla.org/en-US/docs/Mozilla/Creating_MozSearch_plugins and search plugins already present https://packages.ubuntu.com/focal/amd64/firefox/filelist):
  10.  
  11. <?xml version="1.0" encoding="utf-8"?>
  12. <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  13. <ShortName>Twitter</ShortName>
  14. <Description>Twitter Search</Description>
  15. <InputEncoding>UTF-8</InputEncoding>
  16. <Image height="16" width="16">data:image/x-icon;base64,
  17. AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAA
  18. AAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A
  19. ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD/
  20. //8A////AP///wD///8A////AP///wD///8A////AP///wz///8f////H////x////8Y////B///
  21. /wD///8A////AP///wD///8A////AP///wD///8A////A////yj7789g9tV+ofbVfqH21X6h+N+e
  22. ifz03lf///8o////A////wD///8A////AP///wD///8A////APr37g/PsGCftogQ7r2JAP/bnwD/
  23. 7qwA/+6sAP/urAD/9Mtftv357z////8D////AP///wD///8A////AP///wD///8A////AP///w/5
  24. 7c5a88VQwu6sAP/urAD/7qwA/+6sAP/xvDDb/fnvP////wD///8A////AP///wD///8A////AP//
  25. /wDz5L5X7bgv2+6sAP/urAD/7qwA/+6sAP/urAD/7qwA//G8MNv///8Y////AP///wD///8A////
  26. AP///wD///8M9NN+n+6wD/PurAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/9Nyegf///wD///8A
  27. ////AP///wD///8A+O3PVu6wD/PurAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/7qwA//G8MNv/
  28. //8A////AP///wD///8A////ANasQMXurAD/7qwA/+qpAP/YnAD/1JkA/+6sAP/urAD/7qwA/+6s
  29. AP/urAD/////FP///wD///8A////AP///wDz255+7qwA/9icAP+6ixDuz7Bgn9m8b5TurAD/7qwA
  30. /+6sAP/urAD/7qwA//jkr3j///8M////AP///wD///8A47Y/ysmRAP/PsGCf+vfuD////wDw584w
  31. 46QA/+6sAP/urAD/7qwA/9+hAP/orA/z9OrPQv///wD///8A////AMypT7Hhz55g////AP///wD/
  32. //8A////AMOaL9DMlAD/0JYA/8mRAP/FoEC/vpIf4OPQnmL///8A////AP///wD69+4P////AP//
  33. /wD///8A////AP///wD69+4P3ceOcNi/foHhz55g////APr37g/69+4P////AP///wD///8A////
  34. AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A
  35. ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD/
  36. //8A//8AAP//AAD//wAA8P8AAMA/AAD4HwAA8A8AAOAHAADgBwAAwAcAAOAHAADHAwAA3wMAAP/f
  37. AAD//wAA//8AAA==</Image>
  38. <Url type="text/html" method="get" template="https://twitter.com/search?q={searchTerms}"/>
  39. </OpenSearchDescription>
  40.  
  41. To get the Base64 of the latest Twitter icon that you can see above, I downloaded https://twitter.com/favicon.ico and used the Linux command `base64 favicon.ico`.
  42.  
  43. The following files were present in my profile folder but were not needed anymore so I removed them to avoid potential conflicts (you can backup files in case you want to reuse them): `search-metadata.json`, `search.json`, `search.json.mozlz4`.
  44.  
  45. The following answers did not work for me but contained useful information:
  46.  
  47. https://stackoverflow.com/questions/9963256/adding-a-custom-search-engine-to-firefox/10034461#10034461
  48.  
  49. https://stackoverflow.com/questions/9963256/adding-a-custom-search-engine-to-firefox/40651019#40651019
RAW Paste Data