Inject JavaScript to all websites!

Overview

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

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

Thanks to:

TwoFactorHelper Amplosion

You might also like...
The Git interface you've been missing all your life has finally arrived.
The Git interface you've been missing all your life has finally arrived.

GitUp Work quickly, safely, and without headaches. The Git interface you've been missing all your life has finally arrived. Git recently celebrated it

A Swift library for Discord REST/Gateway API in all platforms.

swift-discord main develop A Swift library for Discord API. Package Products Discord, alias library that contains DiscordREST, DiscordGateway. Discord

WKZombie is a Swift framework for iOS/OSX to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser. It can be used to run automated tests / snapshots and manipulate websites using Javascript.
JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.

JSPatch 中文介绍 | 文档 | JSPatch平台 请大家不要自行接入 JSPatch,统一接入 JSPatch 平台,让热修复在一个安全和可控的环境下使用。原因详见 这里 JSPatch bridges Objective-C and JavaScript using the Object

Simple Design for Swift bridge with Javascript. Also can get javascript console.log.
Simple Design for Swift bridge with Javascript. Also can get javascript console.log.

SDBridgeOC is here. If your h5 partner confused about how to deal with iOS and Android. This Demo maybe help. YouTube video is here. bilibili Video is

Pick a date and explore websites from the early days of the internet to now all in an easy-to-use browser format! 💻
Pick a date and explore websites from the early days of the internet to now all in an easy-to-use browser format! 💻

Pick a date and explore websites from the early days of the internet to now all in an easy-to-use browser format! 💻

A library to inject your dependencies via property wrappers

💉 DependencyInjection A library to inject your dependencies via property wrappers 🌟 Features DependencyInjection allows you to define the dependenci

Inject-Dylib - ObjC Code to Programmatically Perform Dylib Injection
Inject-Dylib - ObjC Code to Programmatically Perform Dylib Injection

Inject-Dylib ObjC Code to Programmatically Perform Dylib Injection. Code leveraged from Wojciech Regula's FirefoxStealer project (https://github.com/r

Inject Dylib - Swift code to programmatically perform dylib injection
Inject Dylib - Swift code to programmatically perform dylib injection

Inject_Dylib Swift code to programmatically perform dylib injection. You can als

WebViewCustomFont - WKWebView extension to addScript for inject a custom font-face
WebViewCustomFont - WKWebView extension to addScript for inject a custom font-face

WebViewCustomFont WKWebView extension to addScript for inject a custom font-face

iOS Safari extension for forwarding away from AMP websites
iOS Safari extension for forwarding away from AMP websites

iOS Safari extension for forwarding away from AMP websites

Semi-automated Text Translator for Websites and Apps
Semi-automated Text Translator for Websites and Apps

macOS/Ubuntu/Windows: attranslate is a semi-automated tool for "synchronizing" translation-files. attranslate is optimized for fast and smooth rollout

WKZombie is a Swift framework for iOS/OSX to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser.
WKZombie is a Swift framework for iOS/OSX to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser.

WKZombie WKZombie is an iOS/OSX web-browser without a graphical user interface. It was developed as an experiment in order to familiarize myself with

A simple, reliable and scalable delivery API for transactional push notifications for websites and applications
A simple, reliable and scalable delivery API for transactional push notifications for websites and applications

Catapush is a simple, reliable and scalable delivery API for transactional push notifications for websites and applications. Ideal for sending data-dr

This is an iOS Safari Extension Sample that adds a "Develop menu" to Safari on iOS to allow you to analyze websites.

Develop Menu for Mobile Safari This is an iOS Safari Extension that adds a "Develop menu" to Safari on iOS to allow you to analyze websites. This is a

Vapor-telemetrydeck - Vapor client for posting signals to TelemetryDeck, a privacy-conscious analytics service for apps and websites

Vapor-telemetrydeck - Vapor client for posting signals to TelemetryDeck, a privacy-conscious analytics service for apps and websites

You can monitor your APIs and websites on your menubar. Gives you status code 🎉 Cool & good
You can monitor your APIs and websites on your menubar. Gives you status code 🎉 Cool & good

Hope not. Monitor your APIs and websites on your menubar. For macOS. Right now! YyeeeHav!

Xcode-developer-disk-image-all-platforms - A repo which shares all developer disk images for iOS, tvOS, watchOS
Xcode-developer-disk-image-all-platforms - A repo which shares all developer disk images for iOS, tvOS, watchOS

Disclaimer: The available resources and files from this repo are uploaded from many contributors. The files are unverified, untested, and could have n

Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.
Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.

Erik Erik is a headless browser based on WebKit and HTML parser Kanna. An headless browser allow to run functional tests, to access and manipulate web

Comments
  • Injection code incorrect.

    Injection code incorrect.

    This code will be injected incorrectly.

    https://github.com/wdg/InjectJS/blob/main/InjectJS/Resources/content.js#L18-L25

    see: 8345DDCC-838A-4D3D-806A-BE27C8E0E78C

    For some reason it adds a Br tag

    bug 
    opened by 0xWDG 0
  • InjectJS doesn't work with twitter.com

    InjectJS doesn't work with twitter.com

    InjectJS does not seem to work properly on twitter.com (mobile.twitter.com).

    For example, I wrote the following code in InjectJS.

    setInterval(function(){
        alert("hello");
    }, 1000);
    

    Then, I saw the alert on all web pages, but not on twitter.com.

    I also wrote the following code in InjectJS.

    setInterval(function(){
        document.body.style.display = "none";
    }, 1000);
    

    Then, the screen went blank on all web pages, but nothing happened on twitter.com.

    Environment

    • iPhone 8
    • iOS 15.2.1
    opened by Eug1ena 2
  • JS Validator?

    JS Validator?

    try {
        eval(code); 
    } catch (e) {
        if (e instanceof SyntaxError) {
            alert(e.message);
        } else {
            throw e;
        }
    }
    

    Is there a better approach? like non-eval?

    opened by 0xWDG 0
Owner
Wesley De Groot
Hacker, Swift, Obj-C, @PHP, HTML, JavaScript, CSS, C, Autoit, Visual Basic, Bash, and more...
Wesley De Groot
A simple, reliable and scalable delivery API for transactional push notifications for websites and applications

Catapush is a simple, reliable and scalable delivery API for transactional push notifications for websites and applications. Ideal for sending data-dr

Catapush 0 Dec 29, 2021
Vapor-telemetrydeck - Vapor client for posting signals to TelemetryDeck, a privacy-conscious analytics service for apps and websites

Vapor-telemetrydeck - Vapor client for posting signals to TelemetryDeck, a privacy-conscious analytics service for apps and websites

Sidetrack 7 Jun 16, 2022
You can monitor your APIs and websites on your menubar. Gives you status code 🎉 Cool & good

Hope not. Monitor your APIs and websites on your menubar. For macOS. Right now! YyeeeHav!

Steven J. Selcuk 10 Nov 29, 2022
WebDomHandling - A Swift Package for handling JavaScript code between WebKit and Swift implemented by WebKit

WebDomHandling A Swift Package for handling JavaScript code between WebKit and S

null 0 Jan 23, 2022
PokePicker - a web application in JavaScript/VSCode with Google Firebase as the database

We would like to create a web application in JavaScript/VSCode with Google Firebase as the database. We want to make a Pokemon team creator

Saima Teasha 1 Aug 4, 2022
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!

SwiftGen SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them ty

null 8.3k Dec 31, 2022
Strucure: I used MVVM with Colusre binging modular architecture : Also I used openweathermap to get all information for current weather as it's easy t

Strucure: I used MVVM with Colusre binging modular architecture : Also I used openweathermap to get all information for current weather as it's easy t

Alaa Azab 0 Oct 7, 2021
MacLookup - Lookup for all Mac names, colors, model identifiers and part numbers

MacLookup Lookup for all Mac names, colors, model identifiers and part numbers.

Voyager Software Inc. 2 Jan 4, 2022
All my React Native examples

ReactNativeExamples All my React Native examples and experiements can be found here. This repo is divided into two sub folders, Instructions git clone

Joseph Khan 93 Oct 2, 2022
DBZ-Legends - A SwiftUI based app for all the DBZ peeps out there

DBZ-Legends Just a simple UI based app for all the DBZ fans. You can tap on the

Sougato Roy 2 Apr 5, 2022