What's the proper way to call VBScript from Firefox? - firefox

I'd like to be able to call a vbscript from Firefox that resides on network share. Thus it is visible to all my team members at work. Using:
<a href='file://///server/path/to/file.vbs'>run me</a>
What this script does is it grabs server side information through Samba from the client-side, and uses that information to bring up a MS Outlook new e-mail window with the HTML formatted server side (a Linux system) information filled in. I do not send the e-mail yet because I want to allow the teammate to make sure what they are about to send is correct. And we have to use Outlook. Unfortunately mailto: does not appear to allow any kind of HTML formatting, which is why I've turned to VBScript.
Seems to work in IE, although you get prompted before it allows you to run it. I guess that's OK for now. It's a little annoying having to make sure you're in IE to run it, especially for those of us who prefer not to use IE.
Right now all Firefox does is display the code contents in the browser.
I'm not even sure if I'm going about all this the right way, but from where I stand, I guess I'd like to be able to run it from Firefox. If not, I'll survive. Thanks

I don't think this is possible. Even if it is, it's probably a security risk.
To launch the script, you'll have to run "wscript.exe file.vbs", but that's not allowed otherwise Viruses can exploit this easily.
Therefore, unless you want to use some browser exploit, this will not be possible.

Related

Write image to clipboard in Firefox

I'm currently trying to write an image blob data to the clipboard in Firefox (104.0 Linux).
I seeked information about Permissions, and Clipboard.
As for the permissions, I found contradictory things, some that say you should request for some clipboard write permission (https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API or https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard), some that say that the permission is temporary granted on user interaction. The later seems to work because I'm able to use navigator.clipboard.writeText("blah") to write successfuly to the clipboard.
Problem is when trying to write data. Mozilla documentation states about 2 versions :
Clipboard.write() (https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/write)
Seems obsolete or something, because the method simply doesn't exist, I only have writeText()
setImageData() (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/clipboard/setImageData). This one makes absolutely no sense as browser doesn't exist, as well as setImageData() in the navigator.clipboard instance
Any help would be grealty appreciated here !
EDIT : in fact to actually gt a definition for write() method, user has to manually define a bool true value for flag dom.events.asyncClipboard.clipboardItem in about:config
So, pretty much unusable in production environment, if you don't expect power users only...
So now, I have a new issue, even with that bool set to true, firefox goes "lack of user activation" half of the time, even though the tab is focused. It seems I have to actually do something on the page in order to get it to work ; IE. move the mouse, click here and there...
I even tried to add a prompt, as my clipboard.write() occurs deep in await/async stuff under the button click handle (I'm actually in a NodeJS/Nuxt environment), and writing to the clipboard from the prompt, and even there, I get that error...

How to run Google Keep as an App in Windows

How does one run Google Keep or other websites like an app or kiosk on a Windows PC.
Since I figured this out and nobody seems to of had a response, I made my own question and answered it. Credit to OurCodeWorld for helping figure out some of the fine tuning. He had a --chrome-frame flag, but I believe that is depreciated, so I am looking into it. But it seems to work fine without it
TLDR: Create a shortcut to chrome and add --app= this to the end of it. like this --app=https://keep.google.com/u/0/.
Now if you want it to have a specific size window? Well, you will have to add --window-size=WIDTH,LENGTH. But... Chrome saves the size of the last window closed, which If you use Chrome as a browser, this will change frequently. To solve this, we create a separate user-data directory --user-data-dir="C:\ExampleDir". This folder is around 50mb of who knows what...
So the whole thing put together, like this.
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir="%localappdata%\GoogleKeep\User Data" --window-size=950,1000 --app=https://keep.google.com/u/0/

Writing a c# or c++ application which can detect if browser is going to download a file

I am going to write an application which runs in the background on windows platform. If user is working on any browser (IE, Firefox, Chrome, etc) and any of the user action results in downloading activity, the background program should take control. The background program pop-ups a window asking user, if they want to download. If user proceeds with OK, then background program sends signal to browser to stop its download process and the background program will do download. If user rejects download by the background program, then default download of browser can go on.
For this please suggest if any working model is there in c#/VB.NET/C++ or how to achieve this activity.
Will very much appreciate your kind help.
Thanking you very much in advance.
I don't think you understand the whole notion of downloading. Any resource you get from the Internet is downloaded. Hence, anything would trigger your application. You can, however, try to "parse" URL to see the extension but this does not have to mean nothing, since you can give any file an arbitrary extension (well not exactly arbitrary, but you know.. ). Another option is detecting FTP downloads ( i assume this might be of more interest ). This way you'd "only" have to check for a specific protocol. The reason i quoted only in the last sentence is that none of these tasks is a simple one.
You basically want to write a Proxy, or use an existing one.
You might wanna take a look at WinPcap
Finally, none of this options really give you the infromation whether user is going to download a file. But if you write a proxy, you could stop the endpoint application of obtaining that file once you download it.

Can an app use the clipboard for its own purposes? (read: who owns the clipboard?)

In PowerBuilder's IDE, the code autocomplete feature uses the clipboard to communicate the completed text to the code window. By doing so, it overrides whatever was stored on the clipboard before. So, if you had the winning numbers of the next lottary stored on your clipboard, and you used the autocomplete to turn m_goodfor into m_goodfornothing, you've just lost your only chance of ever getting rich, and you're left with nothing on your clipboard.
Features like that are the reason I hate software. It looks like it was implemented by some intern that noone was looking after. However, there's also a chance I got all worked up for nothing, and making such use of the clipboard is absolutely legit. So, can an app use the clipboard for its own purposes? Who is considered the owner of the clipboard?
(Bonus votes to whoever puts himself in place of the feature's programmer, and provides some reasoning for this being done on purpose, assuming the users would actually benefite from it)
You are probably right on the intern reasoning. There is absolutely no reason why an application would use the clipboard to communicate information other than pure laziness. Even between processes, there are other, better ways of communicating information.
Other then letting the user paste information in another application, there is no reason to use the clipboard.
The programmer did it because it was easy, and put his needs above those of the end user. There are many programs that do this, particularly add-ins to outlook, VB, etc., which copy/paste their buttons onto the toolbar. Any user that runs a clipboard extender (like my own ClipMate) will absolutely hate this behavior (and you'll be "busted" right away).
Here is my favorite quote on the subject:
“Programs should not transfer data into our out of the clipboard without an explicit instruction from the user.”
— Charles Petzold, Programming Windows 3.1, Microsoft Press, 1992
An app should never change anything on the clipboard without the user initiating that action. My .02 anyway.
Bonus votes to whoever puts himself in place of the feature's programmer, and provides some reasoning for this being done on purpose
Using clipboard for application communication
They are always a better way to do it. The programmer might have done it this way because it was faster to implement OR because he really wanted to have this value in the clipboard after the action. At least, if he didn't wanted to have it in the clipboard he could have get the value from the clipboard, store its value then replace the old content of the clipboard inside the clipboard and everything would have be more "transparent" ans less frustrating for the end-user.
I have built a piece of functionality into an App that uses the clipboard. Business was requesting a way for users to seamlessly capture a screen shot and upload it.
I worked with the business to develop it and what we came up with was a user simply hit the print screen key and clicked "upload" in my app.
The Java Applet running in the background pulled the image off the clipboard and displayed a formatted preview to the user, The user then added in a file name and description and clicked save.
Using the clipboard this way saved the user the time of having to capture the screen shot save it somewhere then find it through an upload interface. Even if we did go that route by the user hitting print screen to capture the image in the first place they are already overwriting whatever was on the clipboard in the first place.
Using the clipboard isn't all bad but I certainly agree using it in an IDE is a def no no.

Is there a simple way to change the text of the 'Open' button on the windows file dialog to 'Select'?

We're using the file picker dialog to allow users to add documents into our application. The word 'Open' doesn't make a lot of sense in this case.
Thanks.
I would browse the code found here, which shows how someone extended the OpenFileDialog. Admittedly, this is overkill for you. But I think there is code within to change the button label.
Not really no.
Given the standardization of this dialog it's extremely likely that your users will have used it many times in the past to "add" files to applications. The chances are they will be quite familiar with the implications of the word, changing it may be more confusing to them.
The standardness of the dialog is why it's called a "Common File Dialog". If you want to change it for your app, you'll have to write your own dialog.
Having said that, there are apps out there that can pull a form out of a DLL, modify it, and stick it back in. However, this is a per-machine hack and downright bad form.

Resources