Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create better navigation policy #19

Open
rainemak opened this issue Nov 4, 2016 · 0 comments
Open

Create better navigation policy #19

rainemak opened this issue Nov 4, 2016 · 0 comments

Comments

@rainemak
Copy link
Member

rainemak commented Nov 4, 2016

Currently all navigation is blocked within webview and navigation must be handled component user. Would be good to create a navigation policy where developers could state that I want to be able to navigate within this domain or based on some other rules.

Could you'd need to do it like this:

WebView {
    id: webView
    onLinkClicked: {
        if (url.indexOf("http://myfavoritesite.com") == 0) {
            webView.url = url
        }
    }
}

Above increases navigation history correctly so goBack, goForward, canGoBack, and canGoForward are updated correctly but it feels that this is upside down. By default we should allow navigation to everywhere and that could be limited by some rules.

Based on quick check it looks that network protocol handlers could be unregistered/registered during runtime. This would already be better approach.

See:
uriloader/exthandler/nsExternalHelperAppService.cpp

These are just ideas / food for thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant