Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Use GM_ instead of injecting manually #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions inject.user.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
// ==UserScript==
// @name Scratch 3 Developer Tools
// @namespace https://github.com/griffpatch/Scratch3-Dev-Tools
// @version 1.0.0
// @description ...to enhance your Scratch Editing Experience. Injects the code on the source code. Ported, based on the extension. (https://chrome.google.com/webstore/detail/scratch-3-developer-tools/phacniajokfchdcamjhonkbhlcipplno)
// @author griffpatch, ported by Hans5958
// @match http*://scratch.mit.edu/projects/editor
// @match http*://scratch.mit.edu/projects/*
// @match http*://scratch.mit.edu/projects/*/editor
// @icon https://cdn.jsdelivr.net/gh/griffpatch/Scratch3-Dev-Tools/bigIcon.png
// @updateURL https://cdn.jsdelivr.net/gh/griffpatch/Scratch3-Dev-Tools/inject.user.js
// @grant none
// @name Scratch 3 Developer Tools
// @namespace https://github.com/griffpatch/Scratch3-Dev-Tools
// @version 1.0.1
// @description ...to enhance your Scratch Editing Experience. Injects the code on the source code. Ported, based on the extension. (https://chrome.google.com/webstore/detail/scratch-3-developer-tools/phacniajokfchdcamjhonkbhlcipplno)
// @author griffpatch, ported by Hans5958
// @match http*://scratch.mit.edu/projects/editor
// @match http*://scratch.mit.edu/projects/*
// @match http*://scratch.mit.edu/projects/*/editor
// @updateURL https://cdn.jsdelivr.net/gh/griffpatch/Scratch3-Dev-Tools/inject.user.js
// @icon https://cdn.jsdelivr.net/gh/griffpatch/Scratch3-Dev-Tools/bigIcon.png
// @icon64 https://cdn.jsdelivr.net/gh/griffpatch/Scratch3-Dev-Tools/favicon.png
// @require https://cdn.jsdelivr.net/gh/griffpatch/Scratch3-Dev-Tools/inject3.js
// @resource css https://cdn.jsdelivr.net/gh/griffpatch/Scratch3-Dev-Tools/inject.css
// @grant GM_addStyle
// @grant GM_getResourceText
// ==/UserScript==

var js = document.createElement('script')
js.src = 'https://cdn.jsdelivr.net/gh/griffpatch/Scratch3-Dev-Tools/inject3.js'
GM_addStyle(GM_getResourceText("css"));

var css = document.createElement('link')
css.href = 'https://cdn.jsdelivr.net/gh/griffpatch/Scratch3-Dev-Tools/inject.css'
css.rel = 'stylesheet'
/*

var head = document.getElementsByTagName('head')[0]
head.appendChild(js)
head.appendChild(css)
Q: Where's the script?
A: It's on the @require. It takes the code directly on the repository. This is just an injection script.

*/