Quote
Kris_88
Full document screenshot.
Use right click menu (right click on add-on button) to set directory for screenshots.
This is restartless add-on.
File -> Open -> All Files -> screenshot@om.xpi
You can manage it in about:addons page.
This add-on creates the button on the toolbar
Default toolbar: "Browser Con&figuration"
Create "extensions.screenshot@om.toolbar" string preference (in about:config page)
to override default.
Quote
Kris_88
Universal version for KM v74-76.
Quote
siria
Font size:
very tiny here. Customizable size would be great...
Quote
siria
Path:
Would prefer the target path stored in a pref.
Quote
siria
The filepicker doesn't work for me, probably due to old browser/system.
No modifications are required for this add-on.Quote
siria
And I suspect it's only some chaos in my settings, but to get addons installed in KG74 I always must modify install.rdf
Quote
Kris_88
Moreover, in KM75-76 this add-on creates the command "Screenshot10".
You can call this command from a macro to simulate the button click:
id("Screenshot10");
Actually, the button itself is not even needed for this.
And even in KM74, add-on can call a macro.
For examle:
jsb.id(null, 'macros(mymacro)');
But there is no convenient method for passing parameters.
This is possible through preferences, files or through the clipboard ...
Yes, tested with KM74,75,76.Quote
siria
jsb.id(null, 'macros(mymacro)');
That would work in all KM74-76?
From source, mostly.Quote
siria
Amazing, how do you figure out all that stuff? In browser source...?
Quote
siria
Regarding parameters, macros can use 1 (?), and it must be a string (?) not some object, which can inside be accessed as $ARG:
macros(mymacro(sometext));
Quote
siria
In special cases, when needing a different $ARG-parameter for a submacro, have been using this:
plugin(macros, "mymacro(sometext)");
and not quite sure without verifying again, but guess this worked too:
plugin(macros, mymacro, sometext);
Quote
siria
But if those addon-functions are global, that also means risk of conflicts with duplicate names by different addons? So function names should better be unique. Perhaps by adding a prefix or suffix "OM" for your addon functions... but just a thought.
Quote
siria
By the way is it possible for addons to check if a specific toolbar-name exists already? Supposing there may be probs if creating an existing one again, and again? Would be handy to collect several Addon-buttons in their own toolbar, which can be toggled on/off separately. E.g. all "Addons by OM", or just "Addon Bar 1", or whatever FF may use. But users can also create their own toolbars of course, by macro or in toolbars.cfg, just most don't know how.
Well, of course, the programmer immediately starts editing the code.Quote
JohnHell
(I removed the else, that, in the other hand, if the toolbar doesn't exists, as in my installation, I don't know why set it to true :-? but I don't understand XUL and the prefbranch and those things).
You are welcome... )Quote
JohnHell
Beyond that, thank you so much
let fdat = dat.toLocaleFormat('%Y%m%d_%H%M%S'); let sdat = dat.toLocaleFormat('%Y-%m-%d %H:%M');
Quote
siria
Of non pref-related stuff, most is far above my head, here's just a little suggestion for easier customizable dates (IMO)
let fdat = dat.toLocaleFormat('%Y%m%d_%H%M%S'); let sdat = dat.toLocaleFormat('%Y-%m-%d %H:%M');
Quotation marks don't help?Quote
siria
And accidentally found a weird bug in my KG74 when using the save-picker:
If the chosen filename contains a blank, the image gets stored with %20 on disk.
That works for storing, but can't be opened any more, no chance.
I have updated the first post.Quote
siria
PS: the newest version is usually expected in first post. Would add a hint there that updates are found further down here
Quote
Kris_88
But the description says: Alternatively, you can use the menu instead of the toolbar by setting "extensions.screenshot@om.menu" to the appropriate menu name.
Quote
Kris_88
Shift+button didn't work as expected.
Quote
siria
@JH: Could it be that default smileys don't work anymore? Don't even show up as text, just nothing at all. Noticed it a few days ago, but thought it's just a temporary glitch.
Quote
JohnHell
Ouch!, bypassed that
Quote
Kris_88
In add-ons the addbutton function does not return 0 but throw an exception (use try-catch).
Quote
siria
Oh and I'd like a button tooltip, the only chance for novice-users to even realize there's a menu too...
jsb.AddButton(HostToolbar, Cmd1Name, Popup1Name, "Make screenshot of whole page. Right-click for more options (menu 'Screenshot')");
To be able of using jsbridge functions you need to call it inside your javascript code, which can be done by : Directly calling the interface: var KMeleon = Components.classes["@kmeleon/jsbridge;1"] .getService(Components.interfaces["nsIJSBridge"]); or Import KMeleon module: Components.utils.import("resource:///modules/KMeleon.jsm");
Quote
anonymous
AddButton was added Dec 2014, updated with 'menu' input and in Feb 2015 with 'tooltip' input.
Quote
JohnHell
But what I'd prefer (personal preference) is to not use shift, as it is what I'd do doing a screenshot. After all the date is already in the filename and, for me (personal preference), is the most important, even though you can change it, easier than the image itself, but for me would be enough. Maybe changing the src_ prefix to hostname_date.png.
Quote
JohnHell
Anyway, still amazes me how easily could you made this, I mean, in few code lines. The other add-on for Firefox/Seamonkey with this functionality is ScreenGrab, and, hell, it was absolutely impossible to understand it. Loads and loads of code.
Quote
siria
You're very helpful, testing newer macro possibilities too :-)
If addbutton has a return function too, great! Should be added to wiki.
Just wondering a bit - could you verify if perhaps the minus creates the separator? Because that's used in toolbars.cfg for it, and a result of 1 indicates success, so not quite sure.
Quote
siria
Would it be very complicated to add another menuline, for "Quick Settings" which opens
about:config?filter=screenshot@om
in a new tab?
Am aware your addon creates by default only the path pref (and even overwrites manual pref change until end of session?), but my tinkerings will create all prefs with default values, to make config easier for users. And the plan is to have it also read all prefs again during session.
Please open a tab, not Window, and also use tabs for "View"?
jsb.OPEN_NEWTAB
Oh and I'd like a button tooltip, the only chance for novice-users to even realize there's a menu too...
jsb.AddButton(HostToolbar, Cmd1Name, Popup1Name, "Make screenshot of whole page. Right-click for more options (menu 'Screenshot')");
Quote
siria
But that sounds perfect to use an independant toolbar for Addons without probs - if addtoolbar is available too?
- addbutton to "&ADDONS"
- and if it fails, in the catch run "addtoolbar", then "addbutton" again?
Quote
siria
Oh and I'd like a button tooltip, the only chance for novice-users to even realize there's a menu too...
Quote
Kris_88
Quote
JohnHell
But what I'd prefer (personal preference) is to not use shift, as it is what I'd do doing a screenshot. After all the date is already in the filename and, for me (personal preference), is the most important, even though you can change it, easier than the image itself, but for me would be enough. Maybe changing the src_ prefix to hostname_date.png.
I'm sorry, I did not understand.
Should a simple click on the button create a screenshot with a header? Or without it?
Quote
JohnHell
about:black, or about:config, and when no hostname, that is what happens with about:blank/config, it should be, maybe, just only the date, without "()_" at the beginning or something, I don't know :_D