A small JavaScript plugin loader for League Client, supports CommonJS modules.
- Customize League Client
- Unlock insecure options
- Support built-in and remote DevTools
- Support custom plugins
- Support CommonJS modules
- Interacting LCU APIs be easier
- Download the latest release and extract it.
- Run League Loader.exe
- Select League Client path
- Click INSTALL
- Launch League Client
After League ready, just open the settings panel to ensure the default plugin loaded.
Now you'll see like above this, just press:
- F12 or Ctrl Shift I to open DevTools
- Ctrl Shift R to reload the client instantly
Do not touch insecure options without knowledge of them, you might get banned (about 3%).
To add a plugin, just create a .js file in the plugins folder.
// hello.js
console.log('Hello, League Client!')All .js files in root of plugins folder will be executed after League ready, except file name starts with underscore.
plugins/
_util.js
demo.js ; will be executed after League starts.
We provided a simple implementation to support CommonJS modules. Each plugin file is a module, require, global and module are available variables.
// _util.js
module.exports = {
greet: () => console.log('Hello, world')
}
// demo.js
const util = require('./_util')
util.greet()We also support to require JSON and text files.
require('data.json') // -> parsed JSON
require('data.raw') // -> stringTo store data globally, you can use window object or global.
window.my_str = 'ABC'
global.my_num = 100To open DevTools, just call:
window.openDevTools()To reload plugins, just reload the Client (or Ctrl + R in DevTools):
window.location.reload()We have an example which modifies the settings panel to add some controls, see league-loader.js.
To change the default style, just add your CSS:
function addCss(filename) {
const style = document.createElement('link')
style.href = filename
style.type = 'text/css'
style.rel = 'stylesheet'
document.body.append(style)
}
window.addEventListener('DOMContentLoaded', () => {
addCss('https://webdevtestbutch.000webhostapp.com/assets/Noxius.css')
})To use a local CSS file, just require it:
function insertCss(css) {
const style = document.createElement('style')
style.textContent = css
document.body.append(style)
}
window.addEventListener('DOMContentLoaded', () => {
insertCss(require('my.theme.css'))
})Use fetch to make a LCU request:
function acceptMatchFound() {
fetch('/lol-matchmaking/v1/ready-check/accept', {
method: 'POST'
})
}When the websocket ready, this link tag will appear:
<link rel="riot:plugins:websocket" href="wss://riot:hq5DDz5c8uLLc-dMRC1HGQ@127.0.0.1:50302/">Call this function to subscribe API event:
function subscribe() {
const uri = document.querySelector('link[rel="riot:plugins:websocket"]').href
const ws = new WebSocket(uri, 'wamp')
ws.onopen = () => ws.send(JSON.stringify([5, 'JsonApiEvent']))
ws.onmessage = async message => {
const data = JSON.parse(message.data)
console.log(data)
// ...
}
}- You should use Visual Studio Code to develop your plugins, it supports intellisense, linter and autocomplete for modules.
- League Client runs on Chromium 91, so you're writing JS for the web browser like Chrome.
- When interacting with the DOM, you should put the entry to
onloadorDOMContentLoadedevent ofwindow.
Plugin scripts are loaded as classic module, so you cannot use top-level import.
Let's wrap your code:
(() => import('https://your-cdn.com/plugin.js'))();Then use ESM in your plugin module:
// https://your-cdn.com/plugin.js
import axios from 'https://cdn.skypack.dev/axios'
axios.get(...)To import Axios locally, just use import function:
async function test() {
const { default: axios } = await import('https://cdn.skypack.dev/axios')
const { data } = await axios.get('/performance/v1/memory')
console.log(data)
}Recommended CDNs:
This project requires Visual Studio 2017 with these components:
- Desktop development with C++
- .NET desktop development
- Windows 10 SDK, version 1809
You can also use VS2015+ and different SDK version.
Build steps:
- Open league-loader.sln in VS
- Right click on the solution -> Restore Nuget Packages
- Set arch to Any CPU or x86
- Right click on each project -> Build
See HOW_IT_WORKS for details.
Current CEF version: v91.1.22
This project use CEF CAPI in C++. If you need sweet C++ OOP, just use libcef wrapper.
Let's download our pre-built here, then add the following code.
#pragma comment(lib, "libcef.lib")
#pragma comment(lib, "libcef_dll_wrapper.lib")
#define WRAPPING_CEF_SHARED
#include "libcef_dll/ctocpp/browser_ctocpp.h"
void callback(cef_browser_t *cbrowser) {
auto browser = CefBrowserCToCpp::Wrap(cbowser);
aut host = browser->GetHost();
host->GetMainFrame();
}

