File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
resources/views/docs/desktop/1/the-basics Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -394,6 +394,29 @@ Window::open()
394394
395395This is particularly useful for always-on-top utility windows or menubar applications that should not be visible in Mission Control.
396396
397+ ### Restrict navigation within a window
398+
399+ When opening windows that display content outside your control that is not under your control (such as external
400+ websites), you may want to restrict the user's navigation options. NativePHP provides two handy methods for this on the
401+ ` Window ` facade:
402+
403+ ``` php
404+ Window::open()
405+ ->url('https://nativephp.com/')
406+ ->preventLeaveDomain();
407+
408+ Window::open()
409+ ->url('https://laravel-news.com/bifrost')
410+ ->preventLeavePage();
411+ ```
412+
413+ The ` preventLeaveDomain() ` method allows navigation within the same domain but blocks any attempt to navigate away to a
414+ different domain, scheme or port.
415+
416+ With ` preventLeavePage() ` you can strictly confine the user to the initially rendered page. Any attempt to navigate to a
417+ different path (even within the same domain) will be blocked. However, in-page navigation via anchors (e.g. "#section")
418+ and updates to the query string remain permitted.
419+
397420## Window Title Styles
398421
399422### Default Title Style
You can’t perform that action at this time.
0 commit comments