How can i disable "save as" option from any browser File option menu?
I need to protect my content. I have disable right click , ctrl-a, ctrl-c and print screen.
Still have the save as option.
Is it possible?
What you are asking is impossible. No browser supports it, but even without a browser, you can download files over HTTP.
Try this command line (works well with Unix and Windows):
telnet www.google.com 80
GET /
See? No browser needed.
You can of course make it difficult for end users to download the contents of the pages by hiding it with an HTML Obfuscator, like so: http://htmlobfuscator.com.
Related
I'm using Selenium with VBA and Microsoft Edge to collect information, and download some files from a webpage. Everything works great except for the downloading part.
On this example site: https://file-examples.com/index.php/sample-documents-download/sample-doc-download/, Code like
oWebDriver.FindElementByXPath("//a[#href=""https://file-examples-com.github.io/uploads/2017/02/file-sample_100kB.doc""]").Click
will result in a popup like this:
Unfortunately, it is not possible to simply change the browser's preferences in my case, because the macro will be running on a machine with limited authorization and the following setting can not be changed:
The last option can be translated to: "Ask for the storage location with every download" and it is locked.
It seems that the "Save As" popup in the first screenshot can't be accessed, neither with Selenium nor with SendKeys.
So the only option seems to be using the Windows API with VBA to somehow automate this step, however, even so, it seems to be impossible to get a handle on this pesky popup. I tried finding the window with Spy++ and it doesn't seem to show up as a separate window:
The only solution I can now think of is getting the window size of the parent Edge browser window, navigating the mouse to the approximate position of the "Save As" button, and clicking it there using VBA and the Windows API. Obviously, This is not a great solution, as it would be quite frail and can easily break with the smallest misalignment.
Is there any other way to automate this step that doesn't require moving the mouse and automating the "manual" clicking, using only VBA with Selenium?
Selenium only works for browser web page automation. The pop-up is not a part of the wab page so Selenium will not be able to recognize it.
And I think any setting in Selenium including "download.prompt_for_download" won't have effect. The pop-up is controlled by the browser setting, and the browser setting is controlled by your group policy, you can't override it with Selenium settings.
I think the only way is to use some 3rd party UI automation library to click that option along with Selenium, just like what you said in the question.
I want to open a terminal window from browser. The web application displays an ssh command and ssh password for logging into some server.
I want this command to be pasted into a terminal window with a button click in the webpage. Anyone has any idea about how we can do this?
For security reasons you cannot open arbitrary applications from a webpage.
So, you are left with few options:
Ask them to open a terminal window, copy the text by a button click to their clipboard and ask them to paste it at required place. See here https://stackoverflow.com/a/30810322/2328165
If users are novice and all machines are under your control (newbies at training institute, where being proficient in opening a terminal is not required), you can write a custom protocol handler with a command and a validating parameter for something like term:uri-encoded-command&secret=some-hash and install them. Be careful though, might be a risk.
Use websocket based VNC/SSH such as https://github.com/aluzzardi/wssh
Coming late to this thread.
Safari and OSX support:
ssh://username#10.0.0.1
style URIs so that you can create links that launch terminal. These are simple and clean.
At the moment this seems to work for IPv4 addresses, names that resolve to IPv4 or IPv6 addresses, but there doesn't seem to be support for naked IPv6 addresses. If anyone knows the magic runes for the IPv6 It'd be great to know.
I have a Chrome extension that opens a number of tabs, which it keeps open and uses to display data. I want those tabs to close when the extension is disabled or reloaded. My initial thought was that background.html would be unloaded when I restarted the plugin, but I can't seem to get anything that involves this to work. Any suggestions?
Chrome automatically closes pages with chrome-extension://<your_extension_id>/local.html urls (pages from the extension directory) when an extension is disabled. So if you can display your data using those pages - they will get closed. If it is some external site you are displaying - maybe you can make a local stub page with iframe and load your external site there.
Otherwise I can't think about any other way (besides having another extension watching this one).
i dont' know so much about chrome extensions, but, I think you are openning new windows by something like var w = window.open(params), so, you can close the window with w.close().
if not, ignore my answer :P
I'm new to Dreamweaver CS4 and making my first website. I've watched a lot of tutorials and they all just click the Preview in Browser button and they can see what their page looks like in Firefox/IE/etc.
But when I click Preview in Browser a new Firefox window opens up and it goes to my homepage and that's it.
What do I need to setup in order be able to preview in firefox?
THANKS!
I don't use Dreamweaver, although I have it as part of CS4. But I just now opened up the app, created a test HTML page, saved it, and hit F12 (Preview in Browser). And there was my test page. I honestly don't know what you could be doing wrong. I thought it might be that you didn't save your file, but you get a warning dialog if you try to preview without doing that.
After some playing around I fixed the problem myself.
First I had to go to manage site and edit the basic preferences on my website.
I had to make sure the 'URL to browse to the root of your site" is valid.
In my case it I had to add:
file:///C:/Documents%20and%20Settings/Linda/My%20Documents/website1/
Right now I open archives in my browser (localhost) with the follow line: :! start "http://localhost" file:///"%:p""<CR>.
It is possible to tell Vim: Open Firefox and hit refresh? (I don't want to refresh the current document I'm editing in Vim because if I open, for instance, the current CSS, the results won't show up in the browser.
PS: I'm using Windows XP (Unfortunately)
What about using the https://addons.mozilla.org/en-US/firefox/addon/115 extension for automatic page reloads?