Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Pages: 12Next
Current Page: 1 of 2
Take a screenshot of an entire webpage
Posted by: Kris_88
Date: November 28, 2020 12:36PM

Full document screenshot.
The latest version is here (screenshot@om-KM74-76_11.zip) v1.1.

This is restartless add-on.
You can manage it in about:addons page.

How to install: File -> Open -> All Files -> screenshot@om.xpi
Or just copy xpi file to the profile 'extensions' folder (for KM v74)

This add-on creates:
- submenu in the "&Tools" menu (KM74-76)
- button on the toolbar "Browser Con&figuration" (KM75,76 only)
(the same submenu is available when you right-click on the button.)
- custom command "ScreenshotOM", can be called from a macro (KM75,76 only)
to simulate a button press.

Button click - auto: selection/full document
Ctrl+click - capture visible area
Alt+click - capture full document
Shift - invert default for the image header (document title, url, date)



Edited 9 time(s). Last edit at 12/20/2020 10:49PM by Kris_88.

Attachments: scr_20201210_151317.png (94.4 KB)   screenshot@om-KM74-76_11.zip (13.6 KB)  
Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: November 29, 2020 02:03AM

The default button click action is to save the entire document, and the Ctrl + click action is to save the visible area.
You can swap actions on the settings screen (use right click on the button).

Attachments: screenshot@om2.zip (5.9 KB)  
Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: November 29, 2020 05:37AM

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.

Incredible - thank you!!
Even with menu, and an alternative CTRL+click possible on buttons!

Exactly this kind of addon-interaction with the current page, on demand, has been impossible since forever! And often missed by new users, especially for adblocker-addons to inspect page, and myself missing mostly this function here, long-page screenshots. Some five years ago our main dev Dorian slowly improved jsBridge between KM75 and KM76, what gave us fresh hope, but he was always busy with engine updates and no time for GUI. And later hardly any experts around anymore at all, and the scarce resources still reserved for engine stuff. And the very few xpi-addons I've seen posted were of a more general kind, so those page-on-demand improvements remained still unused and a complete mystery to the rest of us, non-devs sad smiley No one a clue how to even start trying when needing such power-functions. So it took 'only' five years now for a first working example!
It makes a huge difference to have a few tiny, simple example addons like yours, which non-expert users can then just modify for other purposes too smiling smiley

Regarding this great screenshot addon, personally I find the long-page function by far most important. Visible-area stuff much less, because that can be done with all sorts of other means and tools. Love FastStone Capture (last freeware was v5.3, still available from aplus), which has all sorts of useful options and even a great editor build-in, yet still tiny with 1MB, so it's just perfect for that purpose. The only huge prob are its frequent hickups when scrolling down, and oh so slowly on weak machines, scrolling line, by line, by line.... and oops - skipped a bit again...
IMHO this addon can be a great complementary tool, specializing on long pages. Just to create the screenshot itself, if possible add URL (or better urlbar-content) above it, save it on disk, and then -optionally- open it automatically in an image editor for further crops, edits and tweaks. (Grmpf, just tested, and my old FSC seems not able to open already existing files in editor-mode... Only by Drag&Drop, or using FSViewer, just 8x bigger, oh well)

Anyway, just to give a better idea of use cases, that's what I do all the time:
When needing a screenshot, am first trying to somehow get all desired content into single screen size (removing bloat and/or pics by macros if possible, killing styles, setting browser fullscreen etc). If fits, great. Checking urlbar if clean url, sometimes simplify it. Then hit a FSC-shortcut => xy crosslines appear at cursor => I mark a rectangle including urlbar => FSC opens new shot in its editor. I may add comment texts, arrows, textmarker, cut out unneeded areas etc. Hit SaveAs, pick folder, write a filename, done.
If a LONG page: open FSC, tell it to capture scrolling. It starts at current position. Mostly works, but often stutters and skips on this old compi with hardly any RAM etc. When finally arriving at bottom it automatically opens the new shot in editor again. Since it's the complete page, it's usually bloated with menus, nav-areas, sidebars, footers or huge whitespace etc. I mark a rectangle and hit crop. Then hit the Caption-button and paste the url, sometimes simplified, and FSC adds it above the top (extended canvas). Rest as above, marking text or arrows etc, SaveAs...

So on top of my wishlist are 2 more options, to pick a different target folder every time, and to open a chosen editor automatically every time (path stored in a pref) smiling smiley

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: November 30, 2020 02:52AM

OK.

Everything seems to be ready...

Attachments: screenshot@om3.zip (7.1 KB)   scr_20201130_044807.png (105.2 KB)  
Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 02, 2020 04:05PM

Universal version for KM v74-76.

especially for siria grinning smiley

Attachments: screenshot@om-KM74-76.zip (7.7 KB)  
Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 02, 2020 07:43PM

Quote
Kris_88
Universal version for KM v74-76.

Thank you!
YES!! Can hardly believe it, but this xpi ADDON works now even on KG74!

You're doing miracle addon-stuff here that no one did before!
- Calling full addon-functions for *current page* by MENU, not only event-related!
- And on KM75-76 even a fully functional toolbar button! (I may prefer manual buttons, but functions were too limited)
- And that button gets not only created by xpi, with a handy config-menu on right-click too, but it can even be clicked with additional keys! (CTRL+...) Such variations also used to be impossible for us (non-devs) until today!


First impressions after a quick test on KMG74 (not 76):
Font size:
very tiny here. Customizable size would be great...
Path:
Would prefer the target path stored in a pref. I see the addon remembers the previous one, but only until end of session. For crashy KMG74 on ancient systems that's a prob, it keeps forgetting it all the time... The normal pref for saved http-pages could be shared, what IMO makes sense too, I'm usually storing pages+screens in same folder anyway: "kmeleon.download.saveDir". That also makes manually opening stored pics easier.
Settings:
The filepicker doesn't work for me, probably due to old browser/system.
Not sure if my old version is culprit too, but after saving a screenshot and clicking on "Open", it opens a completely different pic? (The first one in parent-parent-parent-folder).
Couldn't check the "View" version yet, KG74 loves crashing too much, as usual, sigh. But if the pref above keeps the path, that's handy enough.

And I suspect it's only some chaos in my settings, but to get addons installed in KG74 I always must modify install.rdf manually, setting Firefox min-version back to 2.0 (KG74 claims towards addons it were FF2.2, old prob, although I dimly remember it's somehow settings-related)



Edited 1 time(s). Last edit at 12/02/2020 08:09PM by siria.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 03, 2020 04:38AM

Quote
siria
Font size:
very tiny here. Customizable size would be great...

Let's not turn this add-on into a monster with a bunch of customizations. )

Quote
siria
Path:
Would prefer the target path stored in a pref.

The add-on now remembers the path.

Quote
siria
The filepicker doesn't work for me, probably due to old browser/system.

Both are old.
The system does not understand the "/" in a file path.
Checkboxes in the prompt.prompt function do not work in KM74.
There is something wrong with the range.getBoundingClientRect function...

Why aren't you using KM75 ?
Does it even make sense to fight old bugs when there is a fixed version? ...

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
No modifications are required for this add-on.


Try this one.
Everything should work except the checkbox.
And you can customize the font at the beginning of the add-on.



Edited 1 time(s). Last edit at 12/03/2020 12:21PM by Kris_88.

Attachments: screenshot@om-KM74-76_3.zip (7.8 KB)  
Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 03, 2020 04:06PM

YES!!! again - thank you! Getting better and better grinning smiley

And know what? Finally discovered (can't believe how long this idea took me) that KMG74 can get a button too, although a bit limited! It can easily be created outside the addon, thanks to your creation of a SUBMENU in the xpi smiling smiley smiling smiley This menu called "Screenshot" works like any other KM menu too, it can be put on buttons manually in toolbars.cfg, or a button can be created by a little helper macro or called by keyboard shortcuts etc. if anyone wishes. The very minor catch is that KMG74-buttons can only popup the addon-menu, not call single actions directly, but hey, we can very, very well live with that.

Actually, for addons which will be used only occasionally, like this screenshots addon, most people will want no button at all, to save precious toolbar space. Menu is often enough.
But it's important to know that even in KM74 buttons are possible too and even easy, although limited to popping up the menu and then clicking the desired single function. As long as a menu is created inside the xpi of course.

(more later, in a hurry again)

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 03, 2020 08:40PM

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 ...



Edited 1 time(s). Last edit at 12/03/2020 08:45PM by Kris_88.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 03, 2020 11:50PM

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 ...

Still better and better... incredible! Just great, miracles still happen grinning smiley
I've actually wondered since awhile if addon-functions may be called like any other id-commands too, since taking a closer look at compat75.kmm and realizing it runs macro-"functions" this way. But lately had only time to test on 74 (last running version on my online pc), and didn't seem to work there yet. Pity.

But this:
jsb.id(null, 'macros(mymacro)');
I wouldn't have guessed! (or perhaps was shortly mentioned in past, can't memorize everything)
That would work in all KM74-76?
Amazing, how do you figure out all that stuff? In browser source...?

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));
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);

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.

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.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 04, 2020 12:17PM

Quote
siria
jsb.id(null, 'macros(mymacro)');
That would work in all KM74-76?
Yes, tested with KM74,75,76.

Quote
siria
Amazing, how do you figure out all that stuff? In browser source...?
From source, mostly.
But even the source doesn't help much.
A very intricate implementation.
This is probably due to backward compatibility requirement.

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));

Yes, it works surprisingly.
Thank you!

jsb.id( null, 'macros(mymacro(123))' );

mymacro{
alert($ARG);
}


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);

From the KM76 sources:

Value id(FunctionData* data)
{
checkArgs(__FUNCTION__, data, 1);
HWND current = kPlugin.kFuncs->GetCurrent(data->c.hWnd);
bool r = kPlugin.kFuncs->RunCommand(data->c.hWnd, data->getstr(1));
if (current == data->c.hWnd) // Allow cmd like ID_TAB_NEXT to change context
data->setWin(kPlugin.kFuncs->GetCurrent(data->c.hWnd));
return r;
}

Value plugin(FunctionData* data)
{
checkArgs(__FUNCTION__, data, 2);
MString plugin = data->getstr(1);
MString param = data->getstr(2);
plugin = plugin + "(" + param + ")";
return kPlugin.kFuncs->RunCommand(data->c.hWnd, plugin);
}

So, plugin(A,cool smiley should run the same (except for some context manipulation) as id(A(cool smiley),

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.

I agree.

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.


NS_IMETHODIMP CJSBridge::AddToolbar(const char * name, uint32_t w, uint32_t h)
{
bool r = kPlugin.kFuncs->AddToolbar(name, w, h);
return r ? NS_OK : NS_ERROR_FAILURE;
}

bool AddToolbar(const char* name, UINT w, UINT h)
{
USES_CONVERSION;
return theApp.toolbars.CreateToolbar(A2CT(name), w, h) ? true : false;
}

KmToolbar* CreateToolbar(LPCTSTR name, UINT width = 0, UINT height = 0) {
KmToolbar* toolbar = new KmToolbar(width, height);
mToolbars[name] = toolbar;
return toolbar;
}

KmToolbar(UINT w, UINT h):mWidth(w),mHeight(h) {

};

It looks like the duplicate name is not checked when creating a new toolbar. The new toolbar replaces the old one with the same name.
But whether it will be displayed correctly - I don't know.
However, there is a toolbar plugin and maybe it somehow changes the processing.
I don't know, I'm too lazy to track. )

I experimented a bit and could not reliably create the toolbar from add-on.
It sometimes appears in the panel but does not appear in View->Toolbars. Sometimes it also appears in the list.
This needs to be investigated ...

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 04, 2020 04:46PM

Such source stuff is miles high above my head, very glad if occasionally people like you with dev-skills drop by :-)

Just a bit basic info about macros (Howto):

The only one at least partly updated wiki is the english version of this:
http://kmeleonbrowser.org/wiki/macrolanguage2
All other language-variations are long since obsolete (from KM0.X or so, at best KM1.x)
Also important and partly outdated:
http://kmeleonbrowser.org/wiki/PluginCommands

For debugging this pref helps, but must be created manually:
kmeleon.plugins.macros.debug = true
Then the error console shows more details for KMM errors, e.g. line numbers (if KMM-button switched on too)
OTOH, due to a Bug this will disable "compat75.kmm" in turn, sigh.
That compat is mainly needed for some older user macros.

Alert / Confirm / Prompt:
What I discovered only 1-2 years ago, js-alerts and macro-alerts are completely different things! Same for prompt+confirm. In macros, they are modal Windows. They can have (and want) a second parameter for window title, and "confirm"s want a third parameter for the icon (warning/info etc). If title missing, they may still work too, but console shows an error.
JS-versions have no titles.
Attention, those modal windows can kill the focus on the website!
Unlike macro-prompts, the js-version can show more than 1 tiny short info line!
Greatly missed forever before finally noticing this (side-note: and then also noticing I can use js-prompts as trick for a copyable output of 32kB or even unlimited (OS-dependent), working around injectJS-return length-restrictions of nothing or max4kB in old KM-versions)

Toolbars/Buttons by macros:
Can be a science in KM...
They shall be created $OnSetup acc wiki. Have noticed menu probs too if created earlier/later in special circumstances (old OS, parallel sessions etc)
Since KM75 button creation is much simplified and possible without plugin:
http://kmeleonbrowser.org/wiki/macrolanguage2#toolbars
But the old toolbars-plugin still works in newer KM-too, luckily for backwards compat.
But plugin-syntax is much more complicated and confusing:
http://kmeleonbrowser.org/wiki/PluginCommands (note the shared quotes around parameters 3-x)
Contrary to the creation-restriction in wiki, it doesn't seem to matter how a toolbar was created, in toolbars.cfg or otherwise. Adding buttons to it by macro seems to work always anyway.
The whole toolbars/buttons creation by macro is still a science, at least when trying to remember the fundamental differences for icon-setting by the various methods.

Toolbars are also auto-creating prefs:
kmeleon.toolband.xxxx
Have wondered if that may help checking existence, but am afraid those prefs survive even if macro disabled later? Not quite sure, but distrust reliability.

Which reminds me of another killer prob in macrolang:
No chance at all to check (by kmm) if a pref exists at all, or if it's just "false" or empty! Wasted endless time cursing and struggling with that prob already, sigh. In the end gave up and now using odd strings for most of my own macro prefs, if existence matters.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: JohnHell
Date: December 08, 2020 03:18AM



I haven't had a look to it yet, but if it works, thank you so much.

I'll read tomorrow with more time, but wouldn't the shortcuts create a conflict with users accels?

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: JohnHell
Date: December 08, 2020 07:49PM

Obviously couldn't work in a personalized install as mine, starting because I don't have a "Browser Configuration" toolbar tongue sticking out smiley

Ok, that could be fixed, but... the menu... I see your point, create it only if it is X version of K-meleon, but I'm one of those that prefer a menu. More when I don't have space for more icons on the toolbars XD and a new row is too much (pages are already eating a lot of vertical space with those nagging boxes/float elements).

So, I don't know, maybe could be better a menu always. Anyway, I set it for me (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).


Beyond that, thank you so much



Edited 1 time(s). Last edit at 12/08/2020 07:56PM by JohnHell.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 10, 2020 05:28AM

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).
Well, of course, the programmer immediately starts editing the code. grinning smiley
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
JohnHell
Beyond that, thank you so much
You are welcome... )

BTW, I fixed an annoying error that appeared during the last changes. Shift+button didn't work as expected.
But I can’t do anything with the checkbox in KM74 and will probably leave it that way.

Attachments: screenshot@om-KM74-76_4.zip (7.8 KB)  
Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 10, 2020 07:16AM

Couldn't resist either, and already spent far too much time again tinkering
Or rather struggling, as usual, tweaking GUI, as usual (JH you'll hate it, lol)
And Kris you'll find it "too much" very likely too, but never mind, I'm also hoping to recycle some of those pref-juggling parts in further addons some day. It just bugs me that I can't seem to get my additions as handy as I want, perhaps never, and that eats so endless time I don't have, arrgh. Oh well, at least it was worth exploring new possibilities. When (if ever?) in a bearable state, plan to post it as suggestion, perhaps some bits may be useful for others too.
Never mind that settings box in KM74 if it's too complicated, am using other ways anyway.

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');

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.
Only when renaming the file on disk back to a normal blank, or when changing %20 to %2520 in the urlbar.
But when a foldername contains a blank, it can't even be stored.
On the other hand, when storing silently in fix folder with a blank in filename, that works fine, it remains a blank.
So far only tested with KG74, maybe just an old-engine bug?

PS: the newest version is usually expected in first post. Would add a hint there that updates are found further down here



Edited 1 time(s). Last edit at 12/10/2020 07:32AM by siria.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 10, 2020 01:58PM

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');

Yes it should work.
Firefox only, deprecated function.
I have used a dumb method.

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.
Quotation marks don't help?
del "abc%20def.png"

Quote
siria
PS: the newest version is usually expected in first post. Would add a hint there that updates are found further down here
I have updated the first post.


Regarding toolbars.

In KM75,76 macros
the addbutton function return 1 if toolbar exist, 0 otherwise.
For example,

alert(addbutton("&Main Bar", "-" )); shows 1,
alert(addbutton("&123bar", "-" )); shows 0

"-" - simple unknown command, therefore the button is not added anyway.

By the way, addbutton("&Main Bar", "" ); adds a separator line.

In add-ons the addbutton function does not return 0 but throw an exception (use try-catch).

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 10, 2020 05:35PM

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.

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')");

@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.



Edited 3 time(s). Last edit at 12/10/2020 06:03PM by siria.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: JohnHell
Date: December 10, 2020 07:56PM

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.

Ouch!, bypassed that


Quote
Kris_88
Shift+button didn't work as expected.


:-? Didn't notice.

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.


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
@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.

The server barely works these days, that is the reason. SF fault.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 10, 2020 08:04PM

Quote
JohnHell
Ouch!, bypassed that

:cool: :cool: :cool: (biting tongue... lol!)

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 11, 2020 02:21PM

Quote
Kris_88
In add-ons the addbutton function does not return 0 but throw an exception (use try-catch).

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...
jsb.AddButton(HostToolbar, Cmd1Name, Popup1Name, "Make screenshot of whole page. Right-click for more options (menu 'Screenshot')");

Oops... adding tooltips may not be possible by jsbridge?
Had assumed it because macrocommand addbutton has this option:
http://kmeleonbrowser.org/wiki/macrolanguage2
But now have read here:
http://kmeleonbrowser.org/wiki/JsbridgePlugin

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");

After checking file "KM/browser/modules/KMeleon.jsm"
this seems to contain all available JSBRIDGE commands and parameters
But no tooltip-option for addbutton...

PS: please consider renaming Screenshot10 to more intuitive ScreenshotOM?



Edited 3 time(s). Last edit at 12/11/2020 05:24PM by siria.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: anonymous
Date: December 11, 2020 10:50PM

AddButton was added Dec 2014, updated with 'menu' input and in Feb 2015 with 'tooltip' input.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 12, 2020 12:06AM

Quote
anonymous
AddButton was added Dec 2014, updated with 'menu' input and in Feb 2015 with 'tooltip' input.

I'm wondering if there may be a way for users to backport more functions ourselves, by copying over some younger files? Have experimented a bit in KMG74 with copied KMeleon.jsm from KM75 and two jsbridge files, but no luck. Then replaced the complete "browser" folder, butcrashed at start already... (as expected, but hope dies last ;-)

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 12, 2020 05:38PM

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
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.

Now the interface takes up more space than the main function. )

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 12, 2020 05:49PM

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.

Yes, I confirm.
1) The return value depends only on the existence of the toolbar.
2) If the command is empty, a separator is created
3) If the command is not empty but not known, nothing is created

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')");

Ok, it's done.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 12, 2020 06:00PM

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?

No, addtoolbar doesn't work.
Probably because it needs to be called before the jsbridge is loaded. And maybe even earlier than add-ons are loaded at all.


Quote
siria
Oh and I'd like a button tooltip, the only chance for novice-users to even realize there's a menu too...

Everything is fine with the tooltip.
However "Right-click for more options" is added to my string automatically.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: Kris_88
Date: December 12, 2020 06:07PM

The update is ready, check the first post.
It seems that everything is as you wanted.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: JohnHell
Date: December 12, 2020 06:29PM

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?

I meant that, as a personal preference, I'd use Shift key as an "opt-in" to add the header.

Instead press shift to remove it, press shift to add.

But because, for me, I prefer the information of the site and date in the file name than added to the image.

For example (this is my imagination, and I don't know how easy it is), a check that instruct to always add the header or never add it, and if the shift key is pressed, then the opposite of the check will happen. If the check is no header, with shift, yes header. If it is yes header, with shift, no header.


Sorry, all this speech to just say that for me the header is redundant inside the image winking smiley

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: JohnHell
Date: December 12, 2020 06:48PM

Ok, I posted the above before download this... so a couple of things (I'm abusing):

- the hostname shouldn't be between brackets "()"
- and I was trying, as it is my home page, 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



Edited 1 time(s). Last edit at 12/12/2020 07:02PM by JohnHell.

Options: ReplyQuote
Re: Take a screenshot of an entire webpage
Posted by: siria
Date: December 12, 2020 07:46PM

Thank you Kris! Your fulfilling our wishes, and even fast, I'm delighted grinning smiley

Okay, there are users who hate the header block and others who love it, so it could be a pref too.
And Shift to inverse, yep fine. Just no clue how to best turn this switch into gui, but you sure know better.

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

What I'm doing in a macro: it checks if $URL=$URLBAR or not. If not, the urlbar gets taken, as a handy way to "rename" or add notes already before proceeding.
Now of course for saving FILES the complete URL is too long, domain much better. Would just crop www from beginning of hostnames. And if no hostname, take the urlbar text, auto-cropped after a max length, just in case.

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


K-Meleon forum is powered by Phorum.