I have been currently working on user scripts for Chrome that can function without the use of Tampermonkey. Today I added a third party extension (a userscript js) to the Chrome extensions:
// ==UserScript==
// @name "job changer"
// @namespace Marshmellows
// @version 0.1
// @description Change 'Jobs' in stackoverflow to Hello!
// @match /*
// @grant none
// @run-at document-start
// ==/UserScript==
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('nav-jobs').innerHTML = 'Hello!';
}, false);
I added this to the Chrome extensions by simply dragging the file inside (it worked fine).
I restarted Chrome and discovered that it had pletely blocked my js file extension.
I can't seem to find a solution for this problem. I went on Chrome's forum and tried to find ways to create a .crx
file. But because I am quite new to web development and the DOM, I feel like I need some guidance. Can anything be done?
I have been currently working on user scripts for Chrome that can function without the use of Tampermonkey. Today I added a third party extension (a userscript js) to the Chrome extensions:
// ==UserScript==
// @name "job changer"
// @namespace Marshmellows
// @version 0.1
// @description Change 'Jobs' in stackoverflow to Hello!
// @match http://stackoverflow./*
// @grant none
// @run-at document-start
// ==/UserScript==
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('nav-jobs').innerHTML = 'Hello!';
}, false);
I added this to the Chrome extensions by simply dragging the file inside (it worked fine).
I restarted Chrome and discovered that it had pletely blocked my js file extension.
I can't seem to find a solution for this problem. I went on Chrome's forum and tried to find ways to create a .crx
file. But because I am quite new to web development and the DOM, I feel like I need some guidance. Can anything be done?
- You might want to check the suggested solutions in this SO post and see what works for you. – Teyam Commented Nov 25, 2016 at 17:43
- @Teyam, pretty sure those answers stopped working after, about, August 2014. Irregardless, it doesn't stop the script from getting auto-disabled; I just verified that. – Brock Adams Commented Nov 28, 2016 at 5:37
1 Answer
Reset to default 6As you discovered, although you can still install a plain userscript by dragging it to the chrome://extensions/
page, it will be automatically disabled when Chrome restarts. Google claims that this is to "protect" users from malicious extensions.
To keep your userscript from being auto disabled, you must pack it into an extension manually. See the steps at the "Controlling the Script and name" section of this answer.
Extensions installed this way will not be auto-disabled, but they will trigger a popup warning on every single start of Chrome!
Google refuses to provide developers any recourse to that popup. To avoid it, you must register your new extension in the Google Pay Store.
Unless you plan to graduate to extension development, or you just love needless hassle, it would be foolish to do this for a userscript. Just install Tampermonkey and enjoy how easy and powerful userscript development can be.