Violentmonkey, userscripts support for Opera (Presto).
Violentmonkey for Chromium-based browsers: https://github.com/violentmonkey/violentmonkey
For more information, click here.
$ npm i
$ npm run dev
# Then load the extension from 'dist/'.
Violentmonkey, userscripts support for Opera (Presto).
License: GNU General Public License v3.0
Violentmonkey, userscripts support for Opera (Presto).
Violentmonkey for Chromium-based browsers: https://github.com/violentmonkey/violentmonkey
For more information, click here.
$ npm i
$ npm run dev
# Then load the extension from 'dist/'.
Violentmonkey: v1.2-fancy
Opera: v12.12
Steps to re-produce:
Expected result
Violentmonkey should not ask to install script.
Actual result
Violentmonkey asks (prompt) user to install script.
The newest developer version of this addon (and stable 1.5.0.1, 1.5.0.2 and 1.5.0.3 versions) has a bug with updating scripts manually (ex. changing manually homepage or version in the scripts). The 1.4 version doesn't have this bug. I'm using newest version of old Opera (12.16). Can you fix this bug?
We currently have the option to always show VM button or never.
As the main (sole) purpose of this button is to activate/deactivate scripts when available, it would be very nice to have a third option to display the VM button when 1+ user script has matching @include
or @match
(whether those scripts are activated by user or not).
right ?
Hi!
When working on the Opera Mobile Labs (based on Opera Mobile v12.00) and your latest Violent Monkey extension v1.5.1.1, I have encountered in these problems so far:
When working with the android emulator+dragonfly I get this error:
else Object.defineProperty(t,i,{
get:function(){return wrapWindow(window[i]);},
set:function(v){window[i]=v;},
});
}
--> Unhandled Error: Object.defineProperty: invalid modification of non-configurable property
--> I think this is why those global functions do not work.
Very strange problem.
When editing big script (5-8 screens), after some large mouse selection was made and cancelled, any further mouse selections cause serious flickering (editor turns white for a moment). Very often it even causes the mouse to not leave "button pressed" state when real button is released. It's actually almost unusable for me when it's like this.
I have a copy of 1.6.8 and I've compared both versions - there is absolutely no such bug in 1.6.8. Also the editor feels much more responsive there.
I've tried to swap updated files with their old versions from 1.6.8 but ultimately failed to find which one exactly is causing this condition.
I'm not using hardware acceleration in Opera.
From time to time, ViolentMonkey decides to eat up 90% of cpu usage. I tried shutting down tabs one by one to see, if some of them is running a script in a cycle, but I closed them all and still nothing. I seem to be unable to do some resource management as to what userscript might cause it, but since the problems stays even with all tabs closed, I'm going to assume it's VM's bug. The only way to solve is to manualy disable VM extension and then re-enable it.
screenshot: http://i.imgur.com/gE0YQF9.png
Hello, :)
I’ve just noticed that all of my user scripts that didn’t have the metadata block on topmost 1st line of script wouldn’t trigger Violentmonkey’s install popup.
My metadata is no second line in more and more scripts of mine (example).
The de facto specs say that it’s OK to put the metadata block anywhere near top of file as long as it is in code root :
The metadata block appears in JavaScript line comments and may appear anywhere in the top level Greasemonkey code scope of the script, but is usually near the top of the file.
The downloadURL specification says that if it is not set in the user script’s metadata block then it should be filled in with the actual downloaded file URL.
updateURL doesn’t say clearly but greasyfork and openuserjs are also filling it afaik.
Could you add that, please ? :)
I can provide online examples if needed.
Wehn they don’t say, they remain empty in VM’s metadata.
Would be nice if we could have VM for Opera Next as well.
It is not priority issue at all (as I work around by copy/paste back and forth from my EmEditor, now).
I think the integrated editor used to respect my code style by inserting tabulations (as the rest of my script) when pressing ENTER to append a new empty row.
Now it has been inserting new rows with heading spaces instead of tabulations, creating some inconsistencies that I have to remember to fix before committing my changes to my user scripts git repository.
I don’t know if it used to guess what to insert (spaces or tabulations) or if it used to always insert tabulations. Or if I was dreaming. Maybe it always has inserted spaces and I work arounded that all the time, I don’t know.
I added @icon
in my scripts as a data URI and it doesn’t work.
Do you think it would be easy to make it work ?
You can test with any of my scripts in my repository, they all have an animated gif as data URI @icon
by now.
Some generator
STR:
Failure!
, but should Success!
.I’m a new user but I presume it did work before.
I’m on a page that should trigger a script but nothing happens and no script is shown when i click the monkey icon.
Opera 12.17.1863 on Windows 7.
Hi,
I've updated Polish translation of your extension. You can download it here:
http://www.mediafire.com/download/51ue7w37wzoufzn/messages+%281%29.json
I did a rollback from firefox 57 beta to firefox 56 release with a fresh new install but keeping the profile folder and when I did that on firefox 56 the scripts in violentmonkey appear as loading... in the control panel and they do not function but in firefox 57 they work properly.
I saw on the faq it says that there is an option to export scripts but I was not able to find that only the import button so i was not able to test that workaround.
One drive and dropbox sincronization both fail also.
When editing script, it would be nice to see the current script name near the title (Script editor probably in English).
It doesn’t need to be dynamically updated when we change the @name
in the metadata block, just like the metadata editor’s placeholder
is not dynamically updated either.
I want to suggest the use of tags to mark each version you upload to Opera. Right now it is hard to tell what has changed.
Do you think it’s because of Violentmonkey or what ?
Some of my user scripts (mass merge, collection highlighter, spot duplicates, etc.) are not detected as a strict mode script.
"use strict";
if (pipo = 1) { alert(pipo); } // displays 1 instead of crashing
Some other scripts (pending edits, super turbo, etc.) are detected as strict mode scripts with the same test above :
"use strict";
if (pipo = 1) { alert(pipo); } // « ReferenceError: Assignment to unresolved reference in strict mode code: pipo » console error message
@gera2ld
So I've been reverifying all the browsers in my arsenal and it appears that Presto with VM is calling on .user.js twice:
GET /install/Marti/RFC_2606%C2%A73_-_Hello,_World!.user.js 200 136.160 ms - -
GET /install/Marti/RFC_2606%C2%A73_-_Hello,_World!.user.js 429 3.932 ms - -
... this is from a click on the Install button on OUJS. e.g. VM on Presto causes our attack prevention to kick in. We don't currently plan on allowing any "free retries" so I was hoping that you could do something about this perhaps in the extension itself. e.g. cache what was first requested and then load that into the script editor.
TIA
OUJS Admin
P.S. Not present in Blink based VM. (at least with 2.2.6... just found out I was behind and needed a manual remove with reinstall... so this part could be inaccurate)
Recently I found that localStorage or widget.preferences are designed to keep small amount of data, since they read everything into memory. Scripts can be large and there is no need to keep them all in memory, so perhaps they should be stored in Web SQL Database instead.
This issue is a little trickier to explain.
With these animated screen captures please watch the VM icon in the upper right hand corner:
Expected counts per frame:
n/a 1 2 1 1 1 1
Actual counts per frame:
n/a 0 2 1 1 1 0
This may not be the exact reproduced sequence anyone else gets but it gives the general idea of the issue.
Clicking the VM icon usually makes the accurate counts appear. Both scripts are injected and running just not shown with the badge.
Using presumed f512b4e with https://github.com/violentmonkey/violentmonkey-oex/releases/tag/v1.7.0 in Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16
Refs:
Thanks for the look.
Hello,
I have spotted a (minor issue) with fast-cancel-edits.user.js:
U+201C
and U+201D
) are OK.U+FFFD
REPLACEMENT CHARACTER) once loaded in the installation editor/confirm.If it’s difficult to solve, just never mind for the moment, as I have scripts with many more characters that load OK. So maybe this script is only using two special characters and that’s why.
Add option to override userscript's @include
header.
Hello.
I'm wondering if there's an option to delete the data that scripts place in local storage?
In Firefox that could be accomplished either through Greasemonkey menu, during script removal, or via the "about:config" dialog, by looking for the script name.
I though vacuum data option may do it, but that wasn't what I expected. Also, reinstalling the script doesn't help either.
I have updated a library called SUPER.js.
This new version was then automatically made available at greasyfork.org (auto‐update).
There, its version went from 61168 to 66008.
Then, in a single later commit, a script, called mb_PENDING-EDITS.user.js, was added the @require …SUPER.js?version=66008
line and another script, called mb_SUPER-MIND-CONTROL-II-X-TURBO.user.js, got its already existing @require …SUPER.js…
line, updated version.
Then I have clicked the buttonUpdateAll and all my scripts went OK.
Except those two scripts (the only scripts that are using a lib), that are now stuck on msgCheckingForUpdate and their individual buttonUpdate is still disabled.
This is a suggestion, maybe it would be nice to have a info box (smae kind as the no grant warning box) that would briefly show up when the daily update check has found some updated scripts. It would present the list of updated scripts.
It would be great to support either (or both =)) of GM_info
or GM_getMetadata
. Without them even getting script version is a great problem...
I know that Opera 12.18 is not really supported but just in case if you want to see if it crashes on you as well.
When I click the Raw button of a userscript page (any one) in github, it crashes Opera.
Even clicking the raw link above from this very page here, is crashing Opera.
Even copying the URL and pasting it (go) in a new tab, crashes Opera.
It seems that there is no problem with install buttons from GreasyFork or from OpenUserJS sites.
I don’t know if you can do much about it because the same Opera does also crash with some duckduckgo searches (but less systematically)…
If I try the Install from URL work‐around in Violentmonkey with that same Raw URL, I then see an Opera internal error page, saying:
Could not open file
You tried to access the address widget://wuid-f4788697-bf9e-f444-8bca-4df3bc39c84f/[object%20Object], which is currently unavailable. Please make sure that the web address (URL) is correctly spelled and punctuated, then try reloading the page.
Opera: 12.16 Build 1860
Platform: Debian sid x86_64, 3.2.0-4-amd64
ViolentMonkey: 1.5.0.4
The following userscript pops up ''Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16" rather than "Mozilla/4.0 (compatible) Greasemonkey" on http://whatsmyuseragent.com/.
// ==UserScript==
// @name Set User-agent
// @include http://whatsmyuseragent.com/
// @grant GM_xmlhttpRequest
// ==/UserScript==
GM_xmlhttpRequest({
method: 'GET',
url: location.href,
headers: {
'User-Agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': '/'
},
onload: function(data) {
var t = data.responseText;
alert(t.substring(t.indexOf('Your User Agent String is:'), t.indexOf('Your IP Address:')));
}
});
Using Violent monkey 1.6.9.2.
It seems that something like once a day (probably after auto update check), all my scripts that are using a (specific version?) library are either loosing the library or the library is being corrupt… ?
I had it after holidays (jesus2099/konami-command#140) and found that I just had to reinstall one of the scripts so the library would be loaded OK again but today it happens again (no scripts should have been updated in the meantime).
The three impacted scripts are all using the same library version (unlike my other scripts), and I don’t see anything special with this specific version.
@require https://greasyfork.org/scripts/10888-super/code/SUPER.js?version=70394&v=2015.8.27
Once you go to a page in which they are supposed to run OK, it says, for each script :
Error running script: mb. SCRIPT NAME HERE
ReferenceError: Undefined variable: getParent
getParent
being one of the functions from the linked SUPER.js library.
I really need those scripts so I applied my work‐around — which consists in reinstalling only one of the three scripts — this raw button, actually — and they are now working back again, all three.
But it seems I might get this problem back with each auto update check ?
It’s the first time I notice this kind of problem, in 2015 and before I hadn’t seen this.
@gera2ld, do you think my extension storage is full or something like that ?
I think it’s impossible to access file system from Opera 12 extension but just in case I’m creating this ticket.
It would be ultra awesome to be able to edit scripts through external editor.
I can’t use my beloved EmEditor* from VM for instant edit and test. That’s the only reason I keep using Opera 12’s integrated userjs instead. But I am really missing VM’s autoupdate. :/
(*) sorry linking, some support for this underrated editor is never bad. ;)
Hello @gera2ld.
I’m sorry but it seems there is a regression on the // @match
behaviour regarding the *
wildcard on subdomain (was fixed in #10 but is broken again now).
// @match *://*.toto.fr/*
… means that pages like //titi.toto.fr/papa.html
and //toto.fr/papa.html
should match.
But now, only first one matches, not second one (no sub‐domain).
An icon in the listing to notify if an auto-update fails because the update URL is no longer valid.
Hello, it seems that it does not understand the // @match
metadata syntax (as some violent monkey user told me my match userjs don’t work while my include userjs do)
ref.
http://wiki.greasespot.net/Metadata_Block#.40match
http://code.google.com/chrome/extensions/match_patterns.html
oujs - Meta View doesn't appear to work in the latest VM-oex.
location
is undefined... I could work around that by prefixing with window.
and temporarily did... however really shouldn't need to e.g. reverted.XMLHttpRequest
is undefined ... that is a DOM global used here.These do (and this script does) work with VM-oex 1.6.9.2 from the Opera store.
TIA
Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16
violentmonkey-oex 1.7.0
At the moment VM is parsing header and matching LAST @author
it finds.
Would be nice if it would be consistent with GreaseMonkey/Scriptish/TamperMonkey
to match the first one if there are multiple @author
's
Thanks in advance.
GM_info
(thanks for fast response) in ViolentMonkey is a method, while it should be an object.
As far as I understand, it should implement getters (to extract metadata just in right time).
I am not 100% sure I obey ViolentMonkey project coding style, so I don't want to create pull request.
For me, following change (using __defineGetter__
, as other parts of code use it) succeeded:
addProperty('GM_info',(function(){
var m=c.code.match(/\/\/\s+==UserScript==\s+([\s\S]*?)\/\/\s+==\/UserScript==\s/);
m=m?m[1]:'';
var result = {
version : widget.version
};
result.__defineGetter__('script', function(){
return {
description:c.meta.description||'',
excludes:c.meta.exclude,
includes:c.meta.include,
matches:c.meta.match,
name:c.meta.name||'',
namespace:c.meta.namespace||'',
resources:c.meta.resources,
'run-at':c.meta['run-at']||'document-end',
unwrap:false,
version:c.meta.version||'',
};
});
result.__defineGetter__('scriptMetaStr' ,function(){
return m;
});
result.__defineGetter__('scriptWillUpdate' ,function(){
return c.update;
});
return result;
})()
);
But AFAIK, __defineGetter__
is deprecated, so I suggest (also seems to work ok):
addProperty('GM_info',(function(){
var m=c.code.match(/\/\/\s+==UserScript==\s+([\s\S]*?)\/\/\s+==\/UserScript==\s/);
m=m?m[1]:'';
var result = {
version : widget.version
};
Object.defineProperty(result, 'script', { get: function(){
return {
description:c.meta.description||'',
excludes:c.meta.exclude,
includes:c.meta.include,
matches:c.meta.match,
name:c.meta.name||'',
namespace:c.meta.namespace||'',
resources:c.meta.resources,
'run-at':c.meta['run-at']||'document-end',
unwrap:false,
version:c.meta.version||'',
};
}});
Object.defineProperty(result, 'scriptMetaStr', { get: function(){
return m;
}});
Object.defineProperty(result, 'scriptWillUpdate', { get: function(){
return c.update;
}});
return result;
})()
);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.