Any way to edit the Options menu options and/or the topic's context menu options?

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
barbs
Propeller Head
Posts: 49
Joined: Thu Oct 15, 2015 3:46 pm

Any way to edit the Options menu options and/or the topic's context menu options?

Post by barbs »

I've been requested to update our CHM help to remove certain menu options as follows.
CHM_ContextMenu.jpg
CHM_OptionsMenu.jpg
I've spent the last couple of hours searching MadCap Help and the forums and haven't found anything that addresses being able to edit these options. For the Options menu, I have considered removing it entirely, but then I am left with no way to turn Search Highlight Off.

Any help would be appreciated. Thanks!
You do not have the required permissions to view the files attached to this post.
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Any way to edit the Options menu options and/or the topic's context menu options?

Post by NorthEast »

I'm not sure if you can edit that Options menu. Looking at Microsoft HTML Help Workshop, you just get the same settings in the Window definitions as you see in Flare - so you can hide the Options button, but can't seem to change what's in the menu.

Mind, I would ask why you've been asked to remove these items, as it seems a bit pointless.
If someone really does want to print or view source, then they will find a way - e.g. take a screenshot, decompile the CHM in Help Workshop.
barbs
Propeller Head
Posts: 49
Joined: Thu Oct 15, 2015 3:46 pm

Re: Any way to edit the Options menu options and/or the topic's context menu options?

Post by barbs »

Thanks for your input.

Regarding "it seems a bit pointless," I completely agree. But folks higher up the food chain are making the request. This CHM is being embedded in a streaming version of one of our products, that is opened from our cloud product. I don't really think it's because they don't want folks printing the help, just that the process is a little annoying. When I attempt to print, the printer list is stubbed, and I "think" they're just trying to avoid customers trying to print and then complaining that it's not possible to print to their printers. Of course, they could always print to PDF or screenshot.

PrintDialog.jpg

At this time, they are satisfied with just removing the Options button from the toolbar, so that's what we did.
Thanks again for taking a look and taking the time to confirm the lack of configuration available for these menus.

Barb
You do not have the required permissions to view the files attached to this post.
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Any way to edit the Options menu options and/or the topic's context menu options?

Post by NorthEast »

You might have to choose between removing everything, or living with it.

As mentioned, you can easily remove the 'Options' menu altogether.

As for the context menu, I'm not sure how to customise the options, but I'm fairly sure you should be able to hide the menu, as you can do that on web pages displayed by a browser. Try something like this on your template page - it works for me:

Code: Select all

<body oncontextmenu="return false;">
If you must get rid of print altogether, you might also consider disabling Ctrl+P too. You should be able to find JavaScript examples on sites like stack overflow.
barbs
Propeller Head
Posts: 49
Joined: Thu Oct 15, 2015 3:46 pm

Re: Any way to edit the Options menu options and/or the topic's context menu options?

Post by barbs »

Thank you for the suggestion. Currently, this project doesn't even use a template page, but I plan to play with that and see if I can get it to work. If I hear more grumbling about it being there, it might be a solution we can use.

Barb
barbs
Propeller Head
Posts: 49
Joined: Thu Oct 15, 2015 3:46 pm

Re: Any way to edit the Options menu options and/or the topic's context menu options?

Post by barbs »

Hello Northeast! (and anyone else who might be following along)
Just following up on this little task I'm working on.
By creating a template page, I was able to successfully disable both CTR-P and the context menu from the topic frame of the CHM.

Adding this to the template page worked.
oncontextmenu.jpg

I also found that adding this script to the body of the template page, rather than the above in the body tag, also worked. While I don't understand a fraction of it, it worked.
JavaScript_Disable_contextmenu.jpg

The reason that I started looking at the JavaScript to remove the context menu is because I was looking for a solution that would also remove the context menu from right-clicking on the toolbars. Neither of the above solutions work for that.

I am running into the same problem with removing the CTR-P function. On the template page, I was able to add this JavaScript, which prevents CTR-P when focus is on the topic in the CHM.
JavaScript_Disable_CTR_P.jpg

But, I can still CTR-P from both of the toolbars.
Toolbars.jpg
You do not have the required permissions to view the files attached to this post.
trent the thief
Propellus Maximus
Posts: 613
Joined: Wed Feb 01, 2006 6:21 am
Location: Off in the dark....

Re: Any way to edit the Options menu options and/or the topic's context menu options?

Post by trent the thief »

Perhaps mentioning to those Highers that anyone can print anything from a browser no matter what you add to the code. Once that html leaves your control, there is virtually nothing you can do to prevent the user from doing what they will with the text. Efforts to that end from our side are nothing more than busywork that accomplishes nothing.

Any user can turn off JavaScript to get at the hardcopy and there are numerous browser addons that toggle JavaScript with a button click.

The only reasonably sure method requires their system admins to use OS policies to disable printing from the browser.
Trent.

Certifiable.

Image

umm...
I meant MAD Certified.

Official Propeller Beanie Owner :-)

:flare: Are you on Flare's Slack channels? PM me for an invitation! :flare:
barbs
Propeller Head
Posts: 49
Joined: Thu Oct 15, 2015 3:46 pm

Re: Any way to edit the Options menu options and/or the topic's context menu options?

Post by barbs »

So, I was able to get some more information. The problem is absolutely not with letting users print our content. We've always allowed this. In this particular case, the product that opens this CHM file is a streaming version of our on-premise product that users can access from within our cloud product. Because the CHM is opening on a cloud product, the Print dialog needs to be shut down as it allows access to the file system by way of "Find Printer." This is what they are trying to prevent. Hope that clears it up a bit.

Barb
Post Reply