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

"This web page was reloaded because a problem occurred." #491

Open
specter78 opened this issue May 19, 2023 · 3 comments
Open

"This web page was reloaded because a problem occurred." #491

specter78 opened this issue May 19, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@specter78
Copy link

I am using the following userscript

// ==UserScript==
// @name        Redirect DDG
// @match       https://*.duckduckgo.com/*
// @run-at      request
// ==/UserScript==

{
    "id": 1,
    "priority": 1,
    "action": { 
        "type": "redirect",
        "redirect": {
            "transform": { "scheme": "https", "host": "search.brave.com", "path": "search" }
        }
    },
    "condition": { "urlFilter": "||duckduckgo.com/?", "resourceTypes": ["main_frame"] }
}

Whenever the redirection occurs, safari gives the above error.

macOS 13.4
Safari 16.5

@quoid
Copy link
Owner

quoid commented May 20, 2023

I tested, it see the reload message. Weird.

Can you check this one and see if the message still appears when getting redirected from ddg to example.com?

// ==UserScript==
// @name        Redirect example
// @run-at      request
// ==/UserScript==

{
    "id": 1736,
    "priority": 1,
    "action": { 
        "type": "redirect",
        "redirect": {
            "transform": { "scheme": "https", "host": "example.com", "path": "/" }
        }
    },
    "condition": { "urlFilter": "||duckduckgo.com/?", "resourceTypes": ["main_frame"] }
}

@specter78
Copy link
Author

Hi @quoid,

I tried your code. For the first time, it gave me the error, but after that it has been redirecting without any issue.

Have you figured out the cause?

@quoid
Copy link
Owner

quoid commented May 20, 2023

Nope, I don't know why this is happening. I sent you the updated file because I wanted to see if it only affected some websites, like it does for me. Thanks for clarifying that.

I could not find any errors getting thrown by anything related to the extension. I disabled all functionality on a local build except for the logic around setting the declarative net requests, that means no script injection, no content script, nothing in background.js running except the code related to DNRs and the error still occurred.

As you can see from the implementation here, all we do on the extension side is leverage the updateSessionRules method. That does not get run on page visits and as mentioned during testing all other 'page visit code' was disabled.

As you can probably tell, I have no idea why this is happening. Perhaps it's a bug with the new version of Safari and how they handle DNRs? It's odd that it only happens on some websites... 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants