Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
670 views
in Technique[技术] by (71.8m points)

google chrome - Angular Thermal Print not working with HTTP instead of HTTPS

I am using an angular package called ng-thermal-print to take print using a thermal printer from a browser. It was working fine with HTTPS. Due to the time delay added by SSL, we are forced to remove the SSL, there for HTTPS to HTTP. After this transition, this package is not working.

The following code is used for requesting the printer.

requestUsb() {
this.usbPrintDriver.requestUsb().subscribe(
    (result) => {
      this.printService.setDriver(this.usbPrintDriver);
      this.status=true;
    },
    (error) => {
      console.log(error);
    }
);}

Error it shows :

TypeError: Cannot read property 'requestDevice' of undefined
    at t._subscribe (29.9ec6f4575860c6b8cf91.js:1)
    at t._trySubscribe (main.6c8ec2ba6b274c6dff1d.js:1)
    at t.subscribe (main.6c8ec2ba6b274c6dff1d.js:1)
    at l.requestUsb (29.9ec6f4575860c6b8cf91.js:1)
    at Object.handleEvent (29.9ec6f4575860c6b8cf91.js:1)
    at Object.handleEvent (main.6c8ec2ba6b274c6dff1d.js:1)
    at Object.handleEvent (main.6c8ec2ba6b274c6dff1d.js:1)
    at ni (main.6c8ec2ba6b274c6dff1d.js:1)
    at main.6c8ec2ba6b274c6dff1d.js:1
    at HTMLButtonElement.<anonymous> (main.6c8ec2ba6b274c6dff1d.js:1)
question from:https://stackoverflow.com/questions/65948922/angular-thermal-print-not-working-with-http-instead-of-https

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...