Comments (17)
The output is the same as your image and putting RefSelectorElement
on the content script says it's not available, as I expected since content scripts can't access the page variables as it runs on a separate layer.
The same problem is happening on Firefox 78.
from github-defreshed.
Well, it seems that whenDefined isn't supported by your browser. Wait a moment, please, will fix it in a minute
from github-defreshed.
I hope v4.3.2 is okay :)
from github-defreshed.
Note: in fact, custom elements are supported by the browser, but access to this functionality from content scripts is limited (as far as I can say by this issue)
from github-defreshed.
Still broken. But now there's no error on console, the loading just keeps spinning forever.
Checking the HTML it's normal crappy GitHub.
from github-defreshed.
Hm. It's really strange. I'm very sorry for the inconvenience, tomorrow I'll try to find a solution to this problem
from github-defreshed.
Hi! Didn't issue magically resolve itself while I was asleep? :D
Cannot reproduce the issue with Ungoogled Chromium 90.0.4430.212
from github-defreshed.
If the problem persists, could you run this snippet on the repository page while it refuses to load, please?
const refSelector = document.querySelector("#branch-select-menu ref-selector");
console.log(refSelector.constructor);
await refSelector.index.fetchData();
console.log(refSelector.index.currentSearchResult);
If that snippet did work, could you check if content scripts in your browser have access to RefSelectorElement
? This may help you:
// ==UserScript==
// @name RefSelectorElement test
// @namespace GitHub
// @version 0.1
// @match https://github.com/*
// @run-at document-idle
// @grant none
// ==/UserScript==
(function() {
"use strict";
alert(window.RefSelectorElement ? "RefSelectorElement is accessible" : "RefSelectorElement is not accessible");
})();
from github-defreshed.
Content scripts can access and modify the page's DOM, just like normal page scripts can. They can also see any changes that were made to the DOM by page scripts.
However, content scripts get a "clean" view of the DOM. This means:
- Content scripts cannot see JavaScript variables defined by page scripts.
- If a page script redefines a built-in DOM property, the content script sees the original version of the property, not the redefined version.
Oh. Now I see. But I can't understand 2 things:
- Why is this even a thing? "Clean view of the DOM". Benefits of this are highly questionable
- Why it doesn't work for me (-> GitHub-Defreshed doesn't fail)? :D
from github-defreshed.
Why is this even a thing? "Clean view of the DOM". Benefits of this are highly questionable
Yes, not "write" to it seems reasonable so you don't need to worry about your variables breaking the page, but reading is pretty dumb.
Why it doesn't work for me (-> GitHub-Defreshed doesn't fail)? :D
At first I thought it could be you using Firefox, but it fails on mine and you have tested on Chromium.
But maybe it's how we have installed it. Are you using your XPI for Firefox? Or GreaseMonkey?
from github-defreshed.
Yes, not "write" to it seems reasonable so you don't need to worry about your variables breaking the page, but reading is pretty dumb
Completely agree! "This means that content scripts can rely on DOM properties behaving predictably, without worrying about its variables clashing with variables from the page script." Guys, "DOM properties behave predictably" when and only when they work same way they do when I'm browsing the website I made the script for...
But maybe it's how we have installed it. Are you using your XPI for Firefox? Or GreaseMonkey?
Ahaha, I forgot about GreaseMonkey :D I use TamperMonkey (yep, I know it's closed-source and so on, but I'm just used to it) and it seems it doesn't use Content Script API :D
from github-defreshed.
Well, I hope I've fixed the issue (+1 api call due to Content Script API restrictions -_-). Could you please check if this fix works for you, so I won't release broken version again? :D
You can grab build artifacts here
from github-defreshed.
Ahaha, I forgot about GreaseMonkey :D I use TamperMonkey (yep, I know it's closed-source and so on, but I'm just used to it) and it seems it doesn't use Content Script API :D
I don't use GreaseMonkey either, I used to use ViolentMonkey, but now I just create a pseudo-extension with a manifest and load from disk. For Firefox I use your XPI.
Well, I hope I've fixed the issue (+1 api call due to Content Script API restrictions --)_. Could you please check if this fix works for you, so I won't release broken version again? :D
It works now. 👍
from github-defreshed.
I don't use GreaseMonkey either, I used to use ViolentMonkey, but now I just create a pseudo-extension with a manifest and load from disk. For Firefox I use your XPI
Isn't it a little bit tedious to do all of these manually? Why did you stop using ViolentMonkey?
It works now. 👍
Finally, haha :) I'll make few more changes (aka fixes, e.g., busy status is broken again) and then will release new version
Thank you so much for helping out with this one! I'm always too lazy to check that everything works outside of my usage scope (Firefox + userscript), so Chrome/Web Extension bugs are unnoticeable for me :D
from github-defreshed.
v4.3.3 (which fixes the issue) was published :)
from github-defreshed.
Isn't it a little bit tedious to do all of these manually?
I just need to create the manifest once and then I just download the .user.js
over the old one whenever you update it. GitHub alerts me when a release is made.
Why did you stop using ViolentMonkey?
It runs over every page even though my userscripts only run over some pages, Chromium will handle that faster and more secure for me. And the only userscript I use that I have not created is yours so I don't care about manually updating it.
from github-defreshed.
Oh, I see, that's reasonable :)
from github-defreshed.
Related Issues (20)
- they do something again? HOT 10
- Request: Non-minified userscript HOT 9
- Broken link for contributors on forks HOT 5
- First reaction still has wrong border-radius HOT 1
- What should we do next? HOT 2
- script errors normal?? HOT 1
- Add the version number to the summary bar HOT 8
- Add an option to have the languages information always open by default
- Top bar buttons displayed vertically when used together with Refined GitHub extension HOT 11
- Slimmer toolbars on repository page HOT 6
- [BUG] Terrible performance on own profile page (Firefox only) HOT 17
- "Any browser" installation instructions broken in readme HOT 1
- some pages still display incorrectly HOT 3
- Can't open repository page (Firefox) HOT 4
- Remove Public/Private badge after repo name HOT 1
- Extension is broken after latest github design updates HOT 13
- Wrong URL when there's only one contributor HOT 1
- Is the padding right? Feels cramped... HOT 5
- Github broke the UI again HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from github-defreshed.