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

How to get the current URL and whether it is possible to save the page for offline reading #465

Open
BrunoRocha01 opened this issue Jan 2, 2024 · 4 comments
Assignees
Labels
question Issue type : Question WebView Service : WebView

Comments

@BrunoRocha01
Copy link

Goodnight,

Is there any way to get the url of the current page that the webview is on?

Is there any way to save the page in cache for off-file reading?

@BrunoRocha01 BrunoRocha01 added the question Issue type : Question label Jan 2, 2024
@taehyeon-nhn taehyeon-nhn self-assigned this Jan 2, 2024
@taehyeon-nhn taehyeon-nhn added the WebView Service : WebView label Jan 2, 2024
@taehyeon-nhn
Copy link
Contributor

Hello. @BrunoRocha01.

Whenever the page changes, the GpmWebViewCallback.CallbackType.PageStarted,
GpmWebViewCallback.CallbackType.PageLoad are passed the url of the web page.
It does not provide a way to save the page.

Thank you.

@SICPRO
Copy link

SICPRO commented Jan 9, 2024

@taehyeon-nhn Hello, please give an example of how to find out the current url of a loaded page, for example, output its domain string in Debug.Log(Host);

@taehyeon-nhn
Copy link
Contributor

Hello. @SICPRO.

GpmWebView.ShowUrl(URL, configuration, OnWebViewCallback, schemeList);
...
private void OnWebViewCallback(GpmWebViewCallback.CallbackType callbackType, string data, GpmWebViewError error)
{
    switch (callbackType)
    {
        case GpmWebViewCallback.CallbackType.PageStarted:
            if (string.IsNullOrEmpty(data) == false)
            {
                Debug.LogFormat("PageStarted Url : {0}", data);
            }
            break;
    }
}

Please refer "Assets/GPM/WebView/Sample/Sample.scene".

Thank you.

@BrunoRocha01
Copy link
Author

Goodnight,

Is there any way to get the url title of the current page that the webview is on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issue type : Question WebView Service : WebView
Projects
None yet
Development

No branches or pull requests

3 participants