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

Accounting for new event type! #38

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Accounting for new event type! #38

wants to merge 18 commits into from

Conversation

drewcovi
Copy link

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.

needed to get this up and running in short order, from what I can tell,
re-adding experimental object seemed to solve the issue.  although also
did some quick updates to the options panel as well,  to sort out any
other possible causes.
switch added to accommodate both Canary and Chrome for the next 6 or so
weeks.
clearly.
needed to check for inspectedWindow support.
oops, without this we wipe everything out! all fixord.
@NV
Copy link
Owner

NV commented Mar 14, 2012

I don’t yet see what the problem is. How could onResourceContentCommitted fire with event.type font? Could you provide example page?

@drewcovi
Copy link
Author

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.

need to enable font in local storage otherwise the loop that checks
against these values fails and returns backend error (although its
actually based on options selected)
@drewcovi
Copy link
Author

hey Nikita, how can I provide an example page to you that you can set up? zip file?

@NV
Copy link
Owner

NV commented Mar 15, 2012

https://gist.github.com/ ?

@drewcovi
Copy link
Author

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.

@drewcovi
Copy link
Author

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.

@NV
Copy link
Owner

NV commented Mar 21, 2012

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

@drewcovi
Copy link
Author

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);

href value console.log

header truncated

@NV
Copy link
Owner

NV commented Mar 21, 2012

After 28dc2bd getLastStylesheetURL executes lazily on adding new CSS rule, so it should be fixed. Check out version from the repo.

@NV
Copy link
Owner

NV commented Jun 9, 2012

Is any of this still relevant?

@drewcovi
Copy link
Author

drewcovi commented Jun 9, 2012

I keep getting it sometimes. But admittedly less so as of late since I've been using the style sheet in the body technique.

@NV
Copy link
Owner

NV commented Jun 9, 2012

DevTools console is much more verbose now. Provide an output from it next time the problem happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants