Sealed Kiosk - disable cross-origin security checks and print dialog box how?
I'm going to open with "I am building a sealed box kiosk and do not need your opinions on what is or is not advised from a security perspective".
Glad I got that out of the way.
Problem 0: I'm serving the page from the file system so adding a Access-Control-Allow-Origin 'origin-list' header doesn't make a lot of sense when my origin is file://my/file/system/index.html
One might hope that adding <meta http-equiv...> might provide the solution. It does not.
Problem 1: I am trying to interface with a credit card reader via the reader vendor's local server software running at https://localhost:oddport/path/to/handler and I am finding my attempts to post instructions to that are clobbered with log message Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource https://localhost:oddport/path/to/handler (Reason: CORS request did not succeed).
I am able to hit this service via postman once I disable https cert validation. So the service is running fine.
Problem 2: I need to kick off a print of a hidden iframe to print out a custom ticket on a custom usb ticket printer that is set up as the machine's default printer without a print dialog via js. Not really finding a clean way to do this.
I would like to not have to incur the overhead of setting up a server on the local box just to get this code built. I'm solidly in developer mode and I feel like I should be able to disable all the securities until I get it working.
Any solutions would be more than welcome. Blown a half day on this nonsense and I have a deadline coming fast.
All Replies (3)
For problem #2, you could look at creating this preference:
(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.
(2) In the search box in the page, type or paste print.always_print_silent and pause while the list is filtered
If this preference was already created and shows a value of true or false, skip to step (4).
(3) On the bar with the preference name, keep the selection next to Boolean and click the + button to add the preference. Then Firefox should display the new value.
(4) If the value is true, you're done; if it's false, double-click to toggle the value to true.
More info on about:config: Configuration Editor for Firefox.
Thanks, that looks like the ticket.
Still stuck on cors from a file.
The CORS part might be more of a StackOverflow kind of question than a support question.