Blazor browser-side opens print menu - printing

I am sending data from a .NET Core app to a Blazor client via a websocket , after which via the interop , the data gets in my component.
I do not understand why when i am trying Server-Side it works ok ,the app has the desired behaviour , while when changing the project to Browser i get a Print Menu pop-up like the one below. (I have some #define where i can choose at ease between Server-Hosted or Browser)
How can Blazor do this pop-up ?
When i press cancel on the print menu i get the following error in the browser:
blazor.webassembly.js:1 WASM: * Assertion at
/mnt/jenkins/workspace/test-mono-mainline-wasm/label/ubuntu-1804-amd64/mono/mini/wasm_m2n_invoke.g.h:547,
condition `0' not met
blazor.webassembly.js:1 Uncaught
(in promise) abort(). Build with -s ASSERTIONS=1 for more info.
How can blazor open a print menu ?

I do not understand why when i am trying Server-Side it works ok ,the
app has the desired behaviour , while when changing the project to
Browser i get a Print Menu pop-up like the one below.
Websockets are not supported on client-side Blazor. They are supported only on the server... Perhaps this is why your client-side Blazor misbehaves.

Related

Reading console.log of a page using chrome extension

I m not getting any idea in which direction I should search/investigate. I need to create a chrome extension which has a button. Clicking the button will show the console output of the devinspector window without opening the inspector.
I have seen some extension, which takes the screenshot and also log the console messages.
Which chrome API can provide this info?

Previewing rails server on AWS Cloud 9: VFS Connection does not exist [Firefox only]

Update: This is specific to Firefox. This does not occur using Chrome. I will leave the text below as is, but now the main question is, how and what in Firefox is causing this. It occurs regardless of cookie settings, such as allowing third-party cookies and trackers.
Preface: I've searched and read dozens of pages trying to resolve this issue I've gone through all the troubleshooting steps in the AWS documentation, eg,
https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html#app-preview-share
and this thread:
https://forums.aws.amazon.com/message.jspa?messageID=849200 as well as resources on stackoverflow
and the c9 forums
https://community.c9.io/t/what-is-vfs-connection-does-not-exist-on-aws-c9/22697/4)
I am trying to preview a running rails app from the Cloud 9 IDE. When I run the app using rails server, there are no error messages indicating anything wrong. The output shows Started GET '/' for [my home IP] ...... 200 Completed OK.
Console Output:
Trying to preview the running app only produces a "OOPS VFS connection does not exist" screen. The preview url is always https://[user_generated_sequence].vfs.cloud9.[region].amazonaws.com/ All TCP traffic is allowed as per the rules set up by following the troubleshooting guides.
OOPS error message page:
The same issue occurs whether using puma or WEBrick. With WEBrick, a popup for the preview link appears, but leads to the same error message page. With puma, the running app is listening on tcp://[localhost/0.0.0.0]:[8080 or 3000]. With WEBrick, it listens instead on http://localhost:8080.
I have followed the instructions exactly in the rails tutorial to set up a simple app. Everything in the code itself should be fine. How can I get this to work correctly? I'm very confused and about to give up on rails.
I recently had the same issues after updating Firefox because cross-site cookies are required to preview a running rails application. If, like me, you have disabled that in Firefox as part of strict Enhanced Tracking Protection, they will need to be enabled at least for this specific site.
Make sure you are accessing the preview from the same browser:
This URL works only when the IDE for the environment is open and the
application is running in the same web browser
https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html#app-preview-preview-app
Something that worked for me, do the following:
run:
rails s
the in the AWS EDE click on 'Preview' and 'Select Running Application'
Once it will open click on the button/link and it should open in another window with the running application.
Note: Doing this manually by copying the URL link and pasting in another tab did not work for me.
Try disable Ad Blockers and privacy Extention. It worked for me.
Basically you need to allow third party cookies
in chrome it's
Settings >> Security >> Cookies and web data >> Choose second option(block cookies only in incognito)
That works for me
On cloud9, click the shield logo in the address bar and switch "Enhanced Tracking Protection" to be off. Then refresh the page and the preview.
I was struggling with this as well. Finally, I changed the cookie setting from all third-party cookies to cookies from unvisited sites (See image)
Cookie Settings for Firefox

Double message on ios when get geolocation

I have created an ios app (Xcode) with a single WebKit View component that loads an external website. This website tries to get the current geolocation with this Javascript: navigator.geolocation.
This all works fine, but the problem is, I get 2 messages:
First a message for the app: 'Allow "NameApp" to access your location while you are using the app?'
Second a message for the webview: 'https://mywebsite.com would like to use your current location'.
I have seen similar questions about this issue, but they all went about a native/offline Cordova app. I have an online app in my Webview.
How can I prevent this double message? Or a workaround for this problem?
I used the WebViewGold for iOS app template for it & it worked out of the box without second / repeated dialog. Maybe helps other developers/no-code guys.

Communication between rails application and chrome app

Currently working on a rails application , i want to send and receive data to this chrome application https://github.com/GoogleChrome/chrome-nfc.
I added chrome.runtime.sendMessage() function inside app.js file to send a simple "hello world" to my browser and
chrome.runtime.onMessage.addListener(function(response,sender,sendResponse){alert(response);});
to show it but I get nothing.
Is it the right way to communicate between them ?
Are you using near field (NFC)? If not, you may want to do something much more simple to pass info between your Chrome App and Rails on server, use an XHR request:
https://developer.chrome.com/apps/app_external#external

Not able to print from an asp.net web application when accessing it through mobile or tab

I am accessing a web application through tab, but printing options are not working, when I am clicking the print button the print dialog box is not opening.
I want it to print the page using the default printer in the network.

Resources