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

Example doesn't work #9

Closed
IAlexanderI opened this issue Mar 4, 2015 · 11 comments
Closed

Example doesn't work #9

IAlexanderI opened this issue Mar 4, 2015 · 11 comments

Comments

@IAlexanderI
Copy link

Example doesn't work - please check it. Browser Chrome - errorText - crosstab not supported - without explain. FF - ok

@tejacques
Copy link
Owner

What kind of device are you viewing this on? Could you also give the full error text? crosstab does some UA Sniffing to see if you are on mobile, as any browser environment that freezes tabs not displayed is unsupported. If crosstab detects that something is unsupported, it saves that setting in localStorage and will continue to be unsupported even if you switch emulation modes in chrome.

You need to click "Clear Local Storage Setup Keys" in the demo and refresh the page on standard desktop chrome to have the example work.

@tejacques
Copy link
Owner

I took a fresh clone of the repo and run grunt then loaded the demo on Chrome, and it works for me. However looking through the code again, I realized it won't print that a frozen tab environment was detected if it was set in localStorage, so I will update that to report the error correctly.

I strongly suspect this is what happened in your case, but let me know when you get a chance to try it out again.

Thanks for reporting this!

@IAlexanderI
Copy link
Author

Hello. Problem still present.
error in https://github.com/tejacques/crosstab/blob/master/src/crosstab.js#L447
code took data from util.keys.SUPPORTED_KEY - it returns object with some data. object have key "data", if chrome, it return always "false". that means crosstab.supported == false. After that crosstab always says not supported.

Desktop Ubuntu 14.10. Chrome 39.0.2171.95 (64-bit) - latest

@tejacques
Copy link
Owner

@IAlexanderI -- could you also give the following information?

  • The error message you receive
  • The user-agent in chrome
  • The steps to reproduce the issue. E.G.:

Thanks

@IAlexanderI
Copy link
Author

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36

Error message: Error: crosstab not supported: frozen tab environment detected
before was: Error message: Error: crosstab not supported

Error happens when i try send message.
Desktop Ubuntu 14.10. Chrome 39.0.2171.95 (64-bit) - latest
Tested on your sample

@tejacques
Copy link
Owner

Were the steps I outlined pretty much exactly what you did? The error you are getting indicates that pinging the master tab timed out, which is how the "frozen tab environment" gets set.

I'll grab an Ubuntu vagrantfile and test later today. For now I would suggest clearing localStorage and reloading to see if the issue goes away.

You can also try bumping up the timeout here: https://github.com/tejacques/crosstab/blob/master/src/crosstab.js#L468-L469 from 100ms to something like 1000ms.

@IAlexanderI
Copy link
Author

Hmm.. I clear localStorage - then all works fine. Thank you.

@tejacques
Copy link
Owner

No problem. My best guess for now is that on your initial pageload there was a little bit of lag which caused the ping to time out. I'll keep this issue open for now while I investigate how often this occurs across a variety of different machines and script configurations. It's possible that this is a random event that didn't just affect you.

@IAlexanderI
Copy link
Author

Another question. How can i use library, without angular.

@tejacques
Copy link
Owner

You don't need to use angular, the example page just uses it since that was an easy way to whip up a test page.

You can look here for a quick overview: https://github.com/tejacques/crosstab#api

Here's a very quick example:

crosstab.on('testEvent', function(message) {
    console.log('tab: ' + message.origin + ', message: ' + message.data);
});

crosstab.broadcast('testEvent', 'testMessage');

output

tab: 14255739976781973682913, message: testMessage

@tejacques
Copy link
Owner

The timeout doesn't seem to be an issue in further testing, so for now I'm closing this.

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

No branches or pull requests

2 participants