The DnD Sanctuary

Pings => Otter Browser Forum => Topic started by: Quetzal on 2018-11-23, 19:35:28

Title: [solved] extension exemple ??
Post by: Quetzal on 2018-11-23, 19:35:28
hi all, hope your well...

1 month more in happyness with dragon-fly otter

but, i try stuff, and get a look to otter's extension... no exemple, nothing to download... then

i do suppose it's kind of chrome extension... but i do find anything...

same way than chrome extension, or there's somewhere an exemple'file that i do not have found yet...

thanks a lot

Title: Re: extension exemple ??
Post by: szyk on 2018-12-01, 09:41:15
Currently Otter Browser supports only user scripts as extensions.
Title: Re: extension exemple ??
Post by: Quetzal on 2018-12-01, 15:53:21
well, it's waht i seen... but pragmaticaly speaking, how to used them...

it's a javscript file, but when i try to used, or modified an html document, nothing happend

i surely miss something important, but what ???
Title: Re: extension exemple ??
Post by: ersi on 2018-12-01, 18:54:04
Currently Otter Browser supports only user scripts as extensions.
Are there any example files so users could understand how they are written? Are they exactly the same user scripts as used in Greasemonkey (or whatever the script extension there was called) or somehow different? Do old-time Opera user scripts work? Where to put the files?

Title: Re: extension exemple ??
Post by: Quetzal on 2018-12-01, 20:04:37
hi Ersi, it's so obvious when you know it

in fact i never did it in opera or in any other browser... then, i was a few loosy

thanks a lot for the anwser...

i'm gonna have a look
Title: Re: extension exemple ??
Post by: vbr on 2018-12-01, 21:49:35
there is a dedicated menu for registering "addons" - i.e. currently userscripts:
Menu: Addons
or Tools: Addons   (in the full menu)
On right mouse button click in in the addons page a context menu appears: Add addon
where the respective js file can be located and its name is then stored in the addon list.

right-mouse context menu over the addons in this lists shows other options.

I think, there is no definitive documentation of the supported features, but there are some remarks in the issue tracker: an

Elementary usage can be checked with simple (useless) script like:
self.document.title = "TEST: " + self.document.title;
(saved e.g. as myscript.js)
If you register this file via the above steps, the window title of all loaded websites should be modified accordingly.

General page manipulations available for Greasemonkey or other implementations should work, but there might be some incompatibilities.

Title: Re: extension exemple ??
Post by: Quetzal on 2019-02-06, 21:43:42
as I was saying when you how to do it it's really more simple than it seem (comparatively from chrome manifest)

then the way:
create file in Otter extension with the extension .user.js
re-opened Otter ... otter/extension otter must have do a new directory with the same extension and a copy of you file

opened the file in your favorite editor:
first test : as say mark pilgrim in "dive into greasemonkey": alert("HelloWorld") <= hahahaha
nothing else...
reload otter, go in tools/extension/check your extension
right click onto/reload extension

normaly with it, an alert pop-up "HelloWorld" will be load for any new page or tab opened in Otter
to stop it uncheck the extension and reload Otterbro

second: how to catch a webpage :
rename your extension helloworld.user.js for the website you want to catch (for exemple) with user.js ever
var aaa=document.URL
if (aaa.indexOf("")>-1) { alert("done !"; /*here you're code*/; }

reload Otter, reload extension if it needs, go on the website, and it should open a popun "done!"
not that complex after if you know a few about javascript...

Otter bro rules da web  :rolleyes: