Start Microsoft Edge in silent printing (kiosk printing) mode from command prompt - printing

I'm developing a web app for a kiosk. I want to print the bill without print preview or any interaction with user. In chrome we ca do this by passing --kiosk-printing argument from command prompt.
Is there a similar method available for Microsoft Edge? The reason I'm switching from Chrome to Edge is Chrome always show the print preview for a short time (less than one sec in my case) even in the kiosk printing mode.

Just fixed it, we can use --kiosk-printing argument as same as we use on chrome to enable silent printing on edge, but it doesn't solve the flash of print screen since both browsers are based on chromium.
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --kiosk www.contoso.com --edge-kiosk-type=fullscreen --no-first-run --kiosk-printing

You can simply use --kiosk-printing argument in the same way we use it on chrome.
msedge.exe --kiosk-printing

Related

Electron JS kiosk mode with touch screen

We are working on a customer facing electron app which should run in kiosk mode. The application runs on a touch enabled device with windows 10.
Even when the app is in kiosk mode, users can easily get into the OS by using the swipe gestures (Swipe left and Swipe right) of the OS.
What is the ideal way to lock down the app and prevent users from interacting with the OS?
There doesn't appear to be a way to disable touch screen gestures in Windows 10.
If you don't need the full node integration offered in electron, ie. your app could run entirely in Chrome you can run it from a cheap Android dongle and lock it down much more easily. I've done this a few times and there are apps which let you add a password, etc.
Alternatively, you could listen for the blur event on your BrowserWindow which is fired when your app loses focus. At that point you may be able to set it into the foreground again:
const mainWindow = require('electron').remote.getCurrentWindow();
mainWindow.on('blur', () => {
mainWindow.restore();
mainWindow.focus();
mainWindow.setKiosk(true);
});
I was able to disable touchscreen gestures for edge of screen by editing a group policy value:
RUN gpedit.msc from the Run box
Computer Configuration > Administrative Templates > Windows Components > EdgeUI > Allow Swipe: DISABLE
A method I've used since Windows 8, is to kill the explorer.exe process shortly after login. Achieved with a scheduled task, set to run 20-30 seconds after login, with a command like this:
taskkill /F /IM explorer.exe
If you need to work on the system, remote in or connect a keyboard and send CTRL + ALT + Del to bring up Task Manager. Go to File > Run new task. In the Create new task dialogue, enter explorer and hit Enter.
When done, reboot the system and all is back to normal.
What I've done to disable the swipe functionality of Windows is to launch our kiosk application instead of explorer.exe.
So, we often deal with multiple displays and many of our apps are written for chrome browser. That means an automated kiosk will have to run a script that launches full screen incognito/kiosk browser instances on two or more displays. We use AutoHotkey to automate the placement and fullscreening of displays, as well as running a watchdog script that monitors for possible browser crashes and popups.
Unintended defocusing by the OS is the last thing we want.
Anyway, to replace the explorer with your app, I've found this regedit to work:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Shell"="D:\\path\\to\\your\\appFile.bat"
Copy that into a .txt file, rename the extension to .reg and run it.
To revert:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Shell"="explorer.exe"
Since windows cannot run an .ahk file, we just run a .bat file that runs .ahk file, that in turn runs all the browsers and does all the other initialization magic.
For remote work, we do the same as user Bink mentioned: bring up run dialog and run explorer.exe. When done, reboot.
If you have windows Home and you don't have gpedit.msc
(even if you can install using https://www.itechtics.com/enable-gpedit-windows-10-home/)
I found this working solution:
https://www.tenforums.com/tutorials/48507-enable-disable-edge-swipe-screen-windows-10-a.html

Run silent print via Chrome App in Kiosk mode

Does anyone know a way to silent print via a Chrome App?
I'm developing a chrome app for a KIOSK system which runs Chromium OS. I need to print a receipt via a Chrome App, which I already did. The problem is that print dialog box appears once print process is started.
Is there any way around this?
This is IMPORTANT INFORMATION about kiosk mode Chrome app
Kiosk parameters can not be useful when you install app in developer mode (1) ( Parameters = "kiosk_enabled":true and "kiosk_only":true located in manifest.json )
But the parameters work after install the app from Chrome Store. Therefore be careful about this trick.
Now my kiosk app can run full screen and silent print (without preview).
1) http://lifehacker.com/install-chrome-extensions-from-outside-the-store-with-d-1596918011?disableinsets=off&utm_expid=66866090-49.VYy4WCNHSyuP6EmjnM93MQ.1&utm_referrer=https%3A%2F%2Fwww.google.com.sa%2F
I found a temporary (maybe not temporary :) ) solution for this subject:
SOLUTION FOR CHROME APP
Install your App to chrome
Create shortcut from this app to desktop.
Right click > Properties > Edit Target Textbox like the below (you will add "--kiosk-printing" parameter )
Before Edit: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 2" --app-id=eoaefbbbpgcbhgeilphgobiicboopknp
After Edit: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk-printing --profile-directory="Profile 2" --app-id=eoaefbbbpgcbhgeilphgobiicboopknp
Absolutely restart chrome for effect (close every tabs and windows on chrome)
Try to print
If you want to remove default header and footer (page address and date) : Open normal chrome print something > on printer preview > More Settings > uncheck "Header and Footer". Chrome ll remember this settings always.
(In fact chrome must provide this property on manifest.json too, but i couldnt find yet)
If you're specifically targeting Kiosk mode apps, you just need to set a flag.
Specifically, --kiosk-printing
I'm not 100% sure how to do that on a Chrome OS device in Kiosk mode. Maybe you need to set it at chrome://flags before switching to Kiosk mode.
Sorry man, it's not possible.
But you could evaluate some workaround: install a web server, make an httpRequest, and then print using a server side language.
In my case, I used php to receive the http request from the chrome app, and then, from php, I launched a java app for the print. I used java because with php (php_printer.dll) is not possible to print images (it's possible to print bmp, but the process to convert a png to an bmp is too long).
I know, it's a little tricky, but it works.

iOS6 - removed console log for IPad - how to use web inspector on windows?

So iOS6 is out, horrah. Now, it appears as though Apple have removed the 'Developer Console' that used to exist in Safari. Great, I hear a lot of people say - it was limited.
But, it works on the device - now apparently you have to connect the device to a Mac to get web inspector?
Is this the only way of debugging with console? Is there a way of debugging with windows, safari? Please note, I don't mean just changing user-agent, which you can do on Safari Windows - that doesn't register touch events - just click.
If you don't have Mac OSX you can use this script as console replacement:
https://github.com/robotnic/waterbug
It shows error message, it's possible to log all kind of variables, you have to turn your iPhone or iPad 90° to the right to open the console.
A poor mans debugging console:
try {
var test = document.do.something();
}
catch (exc) {
alert(exc);
}
One can debug on the device by using bookmarklets (especially within Mobile Safari).
Debugging on the device can be very important if an error only appears live on the device but nowhere else. There is a variety of bookmarklets for developer, so choose the tool of your choice (e.g. Firebug Lite), add it to your bookmarks and use it right where you need it.
This may not be the Developer Console, but it is a method to debug much more accurate and job-oriented.
I wrote a blogpost on how to use bookmarklets on my weblog (there is also a list of other common testing tools and further bookmarklets):
http://hofmannsven.com/2013/laboratory/ios-bookmarklets/
UPDATE: Chrome released its Mobile DevTools which will make debugging (within Google Chome Mobile, Android Devices only) much easier. This will not fix the missing DevTools issue within Safari, but it might help to locate errors on a device:
https://developer.chrome.com/devtools/docs/remote-debugging
http://www.html5rocks.com/en/tutorials/developertools/mobile/
UPDATE2: Mozilla released a Firefox add-on to enable web development across browsers and devices: http://youtu.be/kEFbQwB81RE?t=1m58s
Have a look for weinre. It allows you to inspect a page running in Safari from another computer using a Chrome-like web inspector
You can use window.onerror to debug errors without a console. Simply add this code to your HTML document in its own <script> tag before any other Javascript code:
<script type="text/javascript">
window.onerror = function(e){
alert(e);
};
</script>
This will do so that whenever there is an error, the error message will be shown in an alert dialog box, which is visible in iOS Safari. It's important that the above code runs before the error you're trying to debug, and if you're debugging a syntax error, it's also important that it's in a separate <script> tag.
Instead of Safari on Windows you could use an app by Telerik called AppBuilder. I've found the instructions on this blog. You'll need to get an account to use the Telerik Platform though.
This will give you dev tools like the ones in Safari. I've used it on Win7 64 bit with regular web apps and Phonegap apps running on an iPad with iOS 7.1.
Like neno suggested, Telerik AppBuilder is a great applications. I am actually running Windows XP in a virtual machine on Linux only for the purpose of debugging my iPhone. Windows XP because in my case Windows 7 does regognize the iPhone, but iTunes and Telerik AppBuilder don't.
Looks like the built in console is gone. I tried plugging into a Windows 7 and opened Safari and could not locate the developer console. Then I read this article which confirmed it.
If you need to be able to test your site in both orientations then waterbug is not a good option, because it uses up the landscape orientation for its console view.
One decent option is to use Adobe Edge Inspect. You open your site on Chrome and open the app on your device and your device will mirror whatever page you have open on your desktop. Then you can use the Chrome dev tools to debug your content.

how can I emulate iPad browser on Windows

How can I emulate iPad browser under windows? I know user agent string and I know browser width/height, screen width/height
I believe if you emulate the User Agent of the iPad and set your windows size appropriately, you can use Safari (windows download from apple.com) and works pretty cool.
Also i haven't tested this, but http://code.google.com/p/ibbdemo2/ looks like a great iPad emulator.
For anybody else still looking, follow these steps for Safari 4+ : Mobile Safari Settings on Desktop Safari
It can be done via Browser Stack
So do you guys know there is one more option and that is google
chrome. Yes google chrome provides developer toolbar where you can
inspect your element or debug your js files or you can see what are
the requests your site is hitting and receiving in the network panel.
It also having "Console" where you can emulate your site to different devices view.
Follow the steps below:
Open your site in latest google chrome.
Now right click and select "inspect element" or (F12) to get the devloper toolbar where you will find "Elements,Network,Sources....Console".
Click on console.
Now in the developer toolbar if you see at extreme top right you will find few options like "close the developer toolbar with cross (X) mark" but you click on "show drawer having this symbol (>-) kinda".
Now within the toolbar it will populate console,Search,emulation,Rendering.
Click on emulation option.
Just enable the emulation.
Now happily select whatever device you want and plus it will also tells you what is the resolution.
Please let me know if this is what you want and also ping me if you have any issue. You can read more here.
I am enable to add image since my rating is less by "1". if I get that rating I will attach image and then it will be clear to all. The previous link has images if you want to check it out thought.
http://transmog.net/ try this site.
I use for testing on linux.

Tool to get BlackBerry log

For the iPhone there is a console tool for printing Nslog. For Android there is logcat. For Palm there is putty.
Is there any tool like this to print the log for BlackBerry?
The "javaloader.exe" command line tool, which comes with the developer tools (I think) can be used to extract data from the device's event logger. You can also press the Alt-lglg key sequence on the device (or simulator) home screen to see log entries locally (and copy them).
If you're trying to actually send data to the event log, look up the JavaDocs for the EventLogger class.
In addition to the methods octo explained, you can also just use "System.out.println" and as long as the simulator or device is connected to a debugger (JDE or Eclipose in debug mode), you will see the output in the debug window.
I am working on a Linux System and converting an Android App to Blackberry. I am using the Toolset available here:
https://developer.blackberry.com/android/
d.) Start ADB Proxy to connect a device or VMWare simulator through ADB to an Android development environment of your choice
>bin\blackberry-adbproxy [<device IP address>] [-detect] [-gui] [-password <device password>]
or
>bin\blackberry-adbproxy -gui
This tool allows me to get Logging Info from my Blackberry like I would get from an Android Device.

Resources