Apple - Is it possible to install a Safari extension on an iPhone?
Safari on iOS does not support general extensions added to the web browser. Apps on iOS can provide app extensions such as action extensions and share extensions which are supported on iOS, or content blockers, but these frameworks are limited in what access the extension has.
On iOS 12 you can run JavaScript on website through siri shortcuts share extension.