Inject Javascript
Safari Extension
Hi, so, you want to Inject Javascript to a website? Great.
Since this is a very basic (demo) project it has not that many options.
How to install?
- Build this project.
- Run on your device.
- Enable extension in Safari (iOS 15+).
- Enable full access.
How to use?
- Open "InjectJS" Settings
- Fill in the javascript field (press DONE on keyboard, otherwise it will not save)
- Reload the page
Examples
To make a script to only run on a pre-defined domain, use the function domain("domainname.ext", function)
(Warning, "domainname.ext"
will be converted to a regular expression using new RegExp("domainname.ext")
).
For the rest, there are no (known) limitations.
Run on "Domain.com"
domain("domain.com", function() {
// .. run this
})
Run on "WDGWV.com" and "WDGWV.nl".
domain("wdgwv.(com|nl)", function() {
alert('Hi There!')
})
Future goals
- Built-in Javascript validator, if there's a fault in your code, it will not execute, and does not throw a error.
- Add a in-extension settings for managing different websites, now you'll need to use
domain(...)
for specific domains.
Extra
Thanks for using, feel free to create issues, pull requests, any help is appreciated.
Help/FAQ
My script isn't running
- Does the extension has the correct permissions?
- Is your script working outside of the extension? if so Please create a issue