chrome-devtools-autosave
chrome-devtools-autosave copied to clipboard
Accounting for new event type!
I finally found the issue!
Turns out in some cases, the event type is "font" but needs to be handled exactly how document is currently handled.
In the process, I added an option and removed it (as i dont see it as necessary to opt into font changes) however this did cause an error in the mapping of options.js. So I also built in a fallback in the case that an input is not discovered and returns undefined.
I don’t yet see what the problem is. How could onResourceContentCommitted fire with event.type font? Could you provide example page?
I can give it a shot. Can't honestly say what environment variable came into play, but console logging the event type in devtools.html showed "font". Typically after refreshes and only on newly created styles. I would assume this only applies to newly created inline element styles.
hey Nikita, how can I provide an example page to you that you can set up? zip file?
https://gist.github.com/ ?
ill do that. also on a related note, ive found that if you have a stylesheet before and after an external script include, the document.head.querySelectorAll("link[rel=stylesheet][href]") tends to only return those that fall before.... could be more to this but ill make up a test case.
on further thought this makes perfect sense, since js is going to block and that event doesnt wait for domready. guess thats all the more reason to push your js to the bottom of the page. im just working in an older environment that can't be easily updated to that end.
ive found that if you have a stylesheet before and after an external script include, the document.head.querySelectorAll("link[rel=stylesheet][href]") tends to only return those that fall before...
No, it’s not. http://elv1s.ru/x/script-between-stylesheets.html
give it a go with some heavier script includes...
http://dev.drew.co.vi/x/script-between-stylesheets.html
for these screenshots I changed these lines (starting at 57 in devtools):
chrome.experimental.devtools.inspectedWindow.eval('(function() {\n\
var links = document.head.querySelectorAll("link[rel=stylesheet][href]");\n\
var last = links[links.length - 1];\n\
console.log(document.head.innerHTML);\n\
return last && last.href})()', function(href, fail) {
if (fail) return;
console.log(href);
After 28dc2bd3dda7d69f3c991af1456b747af40d957b getLastStylesheetURL executes lazily on adding new CSS rule, so it should be fixed. Check out version from the repo.
Is any of this still relevant?
I keep getting it sometimes. But admittedly less so as of late since I've been using the style sheet in the body technique.
DevTools console is much more verbose now. Provide an output from it next time the problem happens.