Chrome DevTools Protocol - Network Events after page load - chrome-devtools-protocol

I'm trying to use the chrome-remote-interface package to register URL's requested by a page, through the Chrome DevTools Protocol.
It works fine until the page loads. After the page loads, I can't get the requests. For example: Ajax, Google Analytics Requests, ...
Is it possible to have the requested URLs after page load with Chrome DevTools Protocol?

Some of the requests are not done with classic HTTP requests (which are the ones handled by the Network domain. However, youtube's Ajax "navigation" for example, could be tracked by the Page.frameRequestedNavigation event, so it might also work for Google Analytics.

Related

run web flutter don't see network image

When I use flutter run -d chrome --web-renderer=canvaskit in flutter web I do not see image (network image)
flutter run -d chrome --web-renderer=canvaskit
This is what i see: Error Message
Read
https://docs.flutter.dev/development/platform-integration/web/renderers
and
https://docs.flutter.dev/development/platform-integration/web/web-images
Cross-Origin Resource Sharing (CORS)
CORS is a mechanism that browsers use to control how one site accesses the resources of another site. It is designed such that, by default, one web-site is not allowed to make HTTP requests to another site using XHR or fetch. This prevents scripts on another site from acting on behalf of the user and from gaining access to another site’s resources without permission.
When using , , or , the browser automatically blocks access to pixels when it knows that an image is coming from another site and the CORS policy disallows access to data.
WebGL requires access to the image data in order to be able to render the image. Therefore, images to be rendered using WebGL must only come from servers that have a CORS policy configured to work with the domain that serves your application.
So if you want to still use canvaskit import them to assets folder and use it as a local asset

View App Check Token in Chrome (Flutter web)

Is it possible, to view the app check token used by my flutter web app?
When I check the inspect page of chrome, there is no X-Firebase-AppCheck header.
I thought there was supposed to be one, or am I looking at the wrong place?
You can find it in Developer Tools -> Network
You will need to pick one of the requests that needs that token (for example a call to firestore)
Once you pick one look in the Headers of the request

Can chrome app pass a message/communicate with an embedded page?

As far as I know, only chrome extensions can communicate to an embedded page using content scripts. But is there a way to communicate with an chrome app from a specific page?.
The docs explicitly say:
Similar to cross-extension messaging, your app or extension can receive and respond to messages from regular web pages.
So the "externally_connectable" approach should work, as described in the docs. Note that an event listener for onExternalMessage registered in a background page for an app will fire even if app is not open.

How to change Wicket behaviour on Page Expired

We have a wicket application for our main website. Lately we have implemented a mobile version of the site. The mobile version is special in that it is deployed inside a native app wrapper to some mobile devices and not connected to the rest of the page through links because it is not supposed to be normally visible to web users.
The mobile page makes use of ajax and is therefore prone to receive "Page expired" errors for example when we restart the application on the server.
Since that page is not connected to the rest of the application through links I do not want our standard "Page expired" behaviour. Is it possible to override or intercept this behaviour for the pages belonging to the mobile part of the site? For example I could like to be able to configure the pages to simply reload on a "Page expired" error.
Yes,
getApplicationSettings().setPageExpiredErrorPage(YourPage.class)
YourPage.class can then for instance be your HomePage or another Page that depending on it being a request from a mobile device does something else.
If you would like to reload the Page the user was one then it becomes a bit less trivial. Reloading the Page is not possible since you are not on the page anymore. You could have a look at IRequestCycleListener and overriding onException and handle PageExpiredException yourself but it is a dangerous road you travel if you simply reload your Page. Navigating to the home (or other) page seems more logical. I assume you are not restarting your server 100 times per day...

how to track traffic source for a Facebook iframe application

I have a facebook iframe application - let's call it apps.facebook.com/my-app.
We currently use Google Analytics for our tracking, and I correctly have Google Analytics installed on my application (that is included via iframe to the FB app) & it is tracking any use of the application mentioned above.
However, I would like to find out what the traffic source is to my-app PRIOR to facebook; ie, if a user goes to domain1.com, and follows a link from there to apps.facebook.com/my-app, it appears that the "traffic source" gets tracked as "apps.facebook.com" rather than "domain1.com", b/c the GA is installed within my code of the page included via the iframe, so its http referer is apps.facebook.com
Is there any way to retrieve "domain1.com" as my traffic source, in this case? Or any suggestions to try? (whether using Google Analytics, or another source? I see that the facebook insights does give some information on referrers, but it's not very extensive at all; no date ranges, etc)
Thanks so much!
- ali
Just using Google Analytics in Facebook, there isn't much you can do here. However, what we've done in the past (to general success) is to create a redirect link outside of Facebook with the analytics on it, and push all traffic there first.
In other words, create a page at www.myapp.com/redirect, and put the google tracker there (or, alternately, just append the referrer url to the query string manually). Then, redirect with javascript out to the Facebook canvas app URL. That way, the user ends up in the right place, and you get your referrer info as well.