Actually, it is easier than you think, it's not that hard.
IPFS native URL is not supported on the regular browser by default. Every time you try to browse a native URL it will redirect to the search engine by default. I tried to detect the ipfs:// protocol but that's the limitation of extension development it does not really detect the protocol. That's why I rely on the google search engine to detect the URL.
Google Search Engine has parameters for every query, that's the key! I make sure that the user uses the google search engine and that the search query must be equivalent to the native URL or contains an IPFS prefix.
Once detected, the extension will modify your search and redirect to gateway enabled URL instead.
And that's how it works! In simple words, it detects your native URL and redirects you to the gateway URL version. Instead of using an IPFS companion which will require you to run IPFS locally on your machine.
Here's the repository if you wish to check the code and help me improve it!
https://github.com/warengonzaga/ipfs-support-extension