-
Notifications
You must be signed in to change notification settings - Fork 221
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
Can't access Browser Page via popup's Open Extension Page
button
#614
Comments
I am wondering if you would see an error in the background page if the You could try to open the browser dev tools for the popup by right clicking anywhere in the popup and selecting I don't have a Safari browser that old running on my machine. Also, what OS version are you on? |
This is strange because the code for the userscripts/src/shared/utils.js Lines 180 to 192 in 4de92f7
You can try to evaluate the code line by line in the But I think that's not the issue where is. I think it's more likely that there's a issue with some other part of the One trick is that after you open the Then as @quoid said, use userscripts/src/popup/App.svelte Line 587 in 4de92f7
At the end, if you'd like, send us a screen recording of your operation process. This will help us check for any details you might not have noticed. |
Thanks for the quick replies.
Good thought. Result:
Agreed. I've tried that too and you're right. The entire dev tools window closes.
Result: I also selected Result:
macOS (Sorry for leaving that out before.)
Agreed.
I do. I'm also familiar with Svelte. But I can't seem to get any type of readout because the dev tools closes too soon. I've tried to set breakpoints, but again, it closes before I can inspect anything.
Ahh. I didn't know about that. Result:
I can do that eventually. But so far, there's nothing to report other than the button not working. I was able to enable the It stopped in a few places but it was a little tricky to see what was going on because the The best I was able to generate was the following
|
The problem is very strange if evaluating the original browser.runtime.getURL("/dist/entry-page.html"); The above code should print out the URL of the |
I'm not sure what role losing focus is playing. I've tried opening the Inspector and clicking around with other Extensions, and they too lose focus pretty easily. But in in the case of Ghostery, I'm able to click a button to its Settings page, which spawns a new tab in the main window. Which is what I expect (and use to work) with Userscripts.
Yes! Very helpful. This worked. I was able to manually get to the Extension Page via the URL that it returns. If I run the following from within the Popup's Inspector window, the url is opened... in the actual toolbar popover. Ha! But that's expected.
I did some more testing and was able to enable the Then I used The debugger went to a spot in The first part of the specifically highlighted code was:
I searched the repo for I think this (Line 583) is the unminified/non-compiled equivalent, given the back-to-back function calls: userscripts/src/ext/action-popup/App.svelte Lines 579 to 591 in d5f95bc
(Although I can't say that with certainty because of the Svelte compile process.) The above code looks exactly right (go to the Extension Page and then |
What I mean is when the This is a Safari issue and it does make debugging extension popups more difficult, but there's nothing we can do about it. All we can do is understand its quirks and possibly work around those inconveniences. So when I suggest that you evaluate that code line by line, I expect that you should debug the return value of each line of code, not just evaluate them all. So I still look forward to your debugging to see if there are other possibilities, such as the inability to query the corresponding tab through As for the issue of code minimization, maybe we should study
I've actually given in the comment above where the code for this version is, it's obvious. Note that you should never use the latest code in the |
I had a feeling that's what you meant. I just wasn't looking forward to it :-) In a relatively short amount of time, I was able to get the "Extension Page" to open as if it was triggered via the "Open Extension Page" button. But I think I'm going to need your help tracking down the precise reason. Steps:
Result:
I have to repeat the steps above and copy the code that's highlighted just before the result. This is it: , vt = () => t(6, f = !1), Ct = () => t(18, U = !1), yt = () => t(18, U = !1), It = () => { t(21, M = !1), ne() };
return r.$$.update = () => { r.$$.dirty[0] & 1 && t(24, l = i.sort((g, O) => g.name.localeCompare(O.name))), r.$$.dirty[0] & 2 && C && document.body.classList.add(C) }, [i, C, n, s, o, c, f, m, u, w, v, A, S, L, K, Z, q, z, U, y, W, M, le, te, l, b, $, ke, a, T, we, ne, ve, me, se, ut, at, _t, dt, mt, pt, bt, gt, ht, kt, wt, vt, Ct, yt, It]
}
class Ll extends ae { constructor(e) { super(), _e(this, e, Pl, Nl, de, {}, null, [-1, -1]) } } new Ll({ target: document.getElementById("app") }); I don't know why setting that breakpoint, and then stepping over (or into) the functions that followed, allowed the "Extension Page" to open. I'm not sure how to track it down beyond this. I hope this helps.
Running But I'm probably doing that wrong.
👍🏻 |
Yes, you reminded me of that, and I think that's the root cause of the issue. We should: {
await openExtensionPage();
window.close();
} Otherwise, window closing may interrupt the previous
Yes, I am just referencing the API, it is not the code that can be run directly. You need to refer to the original code line to fill in the parameters. Anyway, thanks for helping us find the issue, I'll fix it in the next version. |
@ar-rm Please try the latest beta version to see if your issue is resolved: Please note that in the beta version the |
Great idea.
It tripped me up because saw how But as I found, don't work as I expected (and what you wrote).
Cool. Thank you!
✅ Confirmed working.
Good idea. I was thinking that too. Also, thanks for enabling Source Maps: So much nicer to debug :-) It would be handy if they could be user-enabled in production builds (Maybe: In "Settings"?) because of exactly cases like this. But I can also understand why that might be a bad idea and maybe not even possible. Thank you again for looking into this and for the very useful (and well made) extension. |
I may have spoke a moment too soon. The original bug is fixed. But I'm noticing that one of my scripts isn't working as it did just before installing v4.5.0-beta.5: Open-Source Alternative Redirector It's definitely injecting and working/redirecting for some domains, but not YouTube. I think there might be a conflict between the addition of the If this is a necessary consequence of a beta build + sourcemaps, that's ok. I can just downgrade until the next normal release. |
I don't understand what you are saying.
We would like to do this, but considering that the usage of this feature is not high, and it will greatly increase the size of the installation package, bringing it to all general users is unnecessary, which will cause a waste of traffic and space.
Can't reproduce, it works as expected on me. And I don't think there will be a conflict between them. |
Understood.
Yeah. I was thinking of the cases where a bug in the most recent version is found but there isn't yet a beta version of it to test. Or is there always an available corresponding TestFlight equivalent of the currently released version?
Hum. Ok.
I'll reinstall the Userscripts beta and try to debug the script.
Oh, that's cool. Maybe I'll rewrite the relevant portions of the script using that. Will this make the redirects faster (iow: happen earlier in the injection) or is it just more robust? (or both) Thanks. |
I just did some experimenting with this. Yes much faster! But I did run into this issues as well: #491 I need to do more testing. |
I think I explained it clearly enough above, this is an browser extension API and you need to fill in the parameters. Just like the error text tells you.
We don't care about peer versions or historical versions. Because we can always only fix bugs in the latest version.
Yes, it's earlier, could before the request is sent. Please read the API documentation for more information. |
You did. I was just clarifying.
Ok.
Understood. Thank you for the time and expense. |
@ar-rm Thank you also for taking the time to report and debug this issue, and thank you for your contribution to the project. |
Overview:
I've been unable to access the Browser Page for a few months.
Userscripts:
4.4.5 (82)
Safari:
16.5
Steps:
Open Extension Page
Result:
Other info:
Inspect Element
via the toolbar Popup menu. But it dismisses as soon as I try to interact with the Userscript popup.Develop > Web Extension Background Content > Userscripts
. But again, no errors.I've been treating this mostly as an inconvenience, since I can edited my user scripts directly via their
.js
files in~/Library/Containers/Userscripts/Data/Documents/scripts
But it does mean that I can't get to the Settings modal.
Questions:
Thanks!
The text was updated successfully, but these errors were encountered: