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

Page Overlay feature not working when Piwik is installed on a different domain #6122

Closed
tassoman opened this issue Sep 4, 2014 · 10 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.
Milestone

Comments

@tassoman
Copy link
Contributor

tassoman commented Sep 4, 2014

I'm going on here with my forum thread about this problem.

I've set a dummy website on a virtualmachine: vmdev.local/test/dummy/*.html then I've added Piwik's tracker linked to side id 1.

If Piwik's domain is the same of my website I could get the entire Overlay feature working. (es: vmdev.local/piwik Vs. vmdev.local/test/dummy/).
If Piwik is installed on a different domain (for example stats.vmdev.local/piwik) the Overlay feature doesn't works well. The left frame is stuck in "Loading..." state.

Using chrom* debugger (Iron browser) I got the following Uncaught securityError inside the console: "Blocked a frame with origin http : // vmdev.local from accessing a frame with origin http : // stats.vmdev.local. Protocols, domains and ports must match."

I got the same behavior on Firefox browser but without the lucky debugging exception.

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Sep 8, 2014
@mattab mattab added this to the Piwik 2.8.0 milestone Sep 8, 2014
@mattab
Copy link
Member

mattab commented Sep 8, 2014

Thanks for the report- could you try to configure CORS as explained in this How to configure cross origin resources sharing -> does it help remove such message?

@tassoman
Copy link
Contributor Author

tassoman commented Sep 8, 2014

Huh oh! I gave a read to the FAQ but I wasn't award about cors_domains[] configuration array.

I've set the * permissive value but didn't helped.

piwik-overlay

I supposed *.vmdev.local would work rather than explicitly nominate all the domains. Wouldn't be better a regex comparison? For example (\w+).vmdev.local

Doing this we could allow Superadmins adding all 3rd levels of each main domain without asking for sysop support editing config.ini file on server's file system.

You see we have more than an hundred websites, many of them are 3rd level being measured.

@mattab
Copy link
Member

mattab commented Sep 15, 2014

It should be enough to just put * as value for the cors domain.... strange it does not work.

Do you see an error in your browser console?

@tassoman
Copy link
Contributor Author

Still getting: Uncaught SecurityError: Blocked a frame with origin "http://vmdev.local" from accessing a frame with origin "http://stats.vmdev.local". Protocols, domains, and ports must match. error on Iron Browser (chrome fork). Firefox console doesn't log anything about it.

Using Firebug extension i got: "Error: Permission denied to access property 'Piwik_Overlay'
http://vmdev.local/piwik/index.php?module=Overlay&action=notifyParentIframe#http://vmdev.local/test/dummy/
Line 11"

In my config.inc.php theres cors_domains[] = * (piwik is latest master branch)

mattab added a commit that referenced this issue Sep 17, 2014
…y are meant to be loaded from other domains where the overlay takes place.
@mattab
Copy link
Member

mattab commented Sep 17, 2014

Can you please try apply the change in: b89cf6f - maybe it will solve the issue?

@tassoman
Copy link
Contributor Author

I've updated master branch to this latest commit but firebug stills logging the error in console.
The js code at line 11 is: piwikWindow.Piwik_Overlay.setCurrentUrl(window.location.hash.substring(1));

@mattab
Copy link
Member

mattab commented Sep 17, 2014

could you maybe email me access to the URL and piwik creds where I can see the issue? cheers

@tassoman
Copy link
Contributor Author

Unfortunately I'm testing on a local ubuntu LTS virtual machine hosted by my computer here in the office at work. I'll try in the next days to reproduce this problem in a different environment outsite in the interwebz to get deeper in the issue. Let's keep in touch and thank your very much for now. 🐛

@tsteur
Copy link
Member

tsteur commented Sep 24, 2014

I tried to reproduce this issue but couldn't. In my case it was apache.piwik and plugins.piwik which are both local domains as well. Tried it in Chrome and Apache.

Maybe have a look which headers are sent by your local website.

The content of the left sidebar should be loaded in the context of your Piwik domain from what I can see in the code so CORS should not be needed

@mattab mattab closed this as completed Oct 2, 2014
@mattab mattab added the worksforme The issue cannot be reproduced and things work as intended. label Oct 2, 2014
@mattab mattab modified the milestones: Piwik 2.8.0, Piwik 2.9.0 Oct 2, 2014
@tassoman
Copy link
Contributor Author

tassoman commented Oct 2, 2014

Well I've tested on different domains and it worksforme also. Sorry for wrong issue submission. 😲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

3 participants