Webview navigation filtering

30 views
Skip to first unread message

Blaze Amaze

unread,
Apr 16, 2024, 4:25:12 PMApr 16
to nw.js
Hello all,

I'm working on a kiosk app that uses webviews to show customer websites. We want to block all urls by default and only allow certain domains to load on the kiosk. For this purpose, we are using chrome.webRequest.onBeforeRequest event. We then compare the requested resource URL against our allowed list and this works but is quite cumbersome. We find that we have to allow all sorts of domains like CDNs and third-party APIs.  We spend many hours clicking through a customer's website in order to trigger every possible sub-resource that a website might load.

Is there a way to block only web navigation requests, and not page resources? I attempted to use chrome.webNavigation.onBeforeNavigate event, but this event doesn't show the actual URL it just shows "about:blank". Any help is appreciated. Thank you.

Alexander Sunvas

unread,
Apr 16, 2024, 9:32:35 PMApr 16
to nw.js
If you had provided a demo, it would be easier to help you.

вторник, 16 апреля 2024 г. в 23:25:12 UTC+3, Blaze Amaze:

russell....@gmail.com

unread,
May 1, 2024, 4:33:40 PMMay 1
to nw.js
I've not done anything like this myself, but checking originUrl is not enough?
Reply all
Reply to author
Forward
0 new messages