how to disable "save as" and "print" option of browser - browser

Can any one tell me how to disable "save as" and "print" option of browser menu bar?
if I go through File->Save As or Print, the document gets printed and saved.
I want to prevent this.
Can any one help me out in this issue?
Thanks in advance

<style type="text/css">
#media print{
body {display:none;}
}
</style>
The above code can be used to disable the user from printing the webpage.I have tested this code, its working fine for me in IE8, Chrome and Firefox.

Related

Chrome extension change border-radius and position

How can I add border-radius on chrome extension popup?
Also, can I add something like margin-top to the popup?
I got the answer from chromium developer:
Alas, that's not something you can control. Your popup content is
basically an iframe inside a window - you can't control the host
window
Chrome simply doesn't allow that.
Alternatives are, instead of the popup, opening a new window or injecting a content script in the active tab to display a modal.

Is it possible to change behaviour on new tab event in any browser?

When you click on the "new tab" button in a browser, let's say Chrome, new tab appears in the end of the existing tab chain.
I wonder if it is any chance to make a broswer put the tab in the head of the chain?
Maybe plugin? Have to dive in firefox codebase?
Any ideas appreciated!
I did it with Chrome Extention
https://chrome.google.com/webstore/detail/tabtohead/iipdefkdfmbhnelbhlbdamplokbnpkhe

How to download .svg file from this page?

I need to download the "Municipalities in Bosnia and Herzegovina.svg" (map) file from this page, but I have no idea how to download it, i.e. to find a link to the image on the page. I found sodipodi:docname="Municipalities in Bosnia and Herzegovina.svg" in the source code, but that still doesn't help me. Could someone link to the svg file and perhaps explain how they deduced where the file is stored?
Assuming you have the rights to use the map. Make sure you do.
The SVG is embedded into the code of the page. You need to cut and paste it from the page source.
The following instructions are for Chrome. Other browsers will be similar.
Mouse over the light grey area of the map.
Right-click, then select "Inspect" from the menu
The browser web tools pane should open with the <svg> element selected.
Ctrl-C to copy
Paste into your favourite text editor.
"Save Page As"
Chrome(right click)
Firefox (menu/Alt or Ctrl + S), then choose the "just SVG" option in the dropdown menu.
Internet Explorer (get Firefox or Chrome, its about time!)
An easy way to download the SVG is using a browser extension. For example, on the Chrome browser there is the SVG Export extension which allows you to view & download the SVGs on a given page. Of course, always make sure that you have the rights/permissions to download the SVGs.

How can I make an iframe security error occur in IE?

A user of one of my websites is reporting an alarming-looking frame content error on a page that embeds Google Maps. I have played with the security settings in IE9, IE10 and IE11 but have only been able to either display the embed without issue or display nothing (blank space where iframe should be.) What do I need to do in which version of IE to see this error?
Here is the embed in question (need to redact specific map.)
<iframe id="googlemap" width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps/ms?t=m&msa=0&msid=1234.1234&source=embed&ie=UTF8&ll=37.996163,-96.855469&spn=33.053774,56.25&z=4&output=embed"></iframe>
Here is a screenshot of the error the user is receiving.
Open a new browser window, and pull down the "Tools" menu.
Select "Internet Options".
Click the "Security" tab, select the "Internet" icon, and click the "Custom Level" button.
Scroll down to the "Miscellaneous" section, find the "Launching programs and files in an Iframe" entry and select "Prompt".
Close all open Dialogs by clicking the OK buttons.

IceFaces: panelPopup autoCentre problem with IE

I'm having some problems with panelPopup and IE8. When I set autoCentre="true" and positionOnLoadOnly="true", I expect the popup to appear in the center of the view port and stay put there. This works fine in Safari, Chrome and Firefox, but in IE the popup "follows the scroll", if you see what I mean. I.e if the page where the popup is displayed is longer than the popup the popup is re-centered when I scroll the page. Also, and this is a bigger issue - if the popup is longer than the page I can only scroll part of the way down it, then it's re-centered. This means I can never see the information at the bottom of the popup...
This is the code used to generate the popup:
<ice:panelPopup
id="popup"
positionOnLoadOnly="true"
autoCentre="true"
style="z-index:999; background: #FFFFFF;"
resizable="false"
draggable="false"
modal="true"
clientOnly="true"
visible="#{SomeBean.popupRendered}" >
Any ideas?
Thanks!
According to the documentation, the autoCentre option is supposed to keep it centered through scrolling and window resizing but dragging should disable it. Turning draggable to true might give you reasonable results because the user can drag it to a position they can see the entire popup.

Resources