I experienced this problem:

1. basically Splashify works, on every page, redirecting to another page
2. it works if I type the URL to my site in the browser (no referrer)
3. it works if I link to my site from another site (referrer = external)
4. it DOESN'T work if I follow a link to my site through Google !!!

After some debugging I found the reason: the URL that Google generates (which splashify sees as the referrer) roughly has the form of:
http://www.google.com/?[blahblah-google-querystring]&url=http%3A%2F%2Fww...

So the problem is that the function function "i.search(s)", which tests if the referrer contains the site-URL, returns true.
For now I have solved this by trimming the referrer. I have added this bit of code right after the referrer is put in a variable (i):

i = i.substr(0,i.indexOf("?"));

This cuts off anything after (and including) the question mark, which marks the beginning of the querystring.

Comments

Vidioterie’s picture

Oops, code above breaks functionality by showing splash-page on every click within the site itself, because there's no check if there's actually a "?" in the code, so if not, it doesn't recognize the referrer at all, because de substr(0,-1) doesn't return anything.
Here's the corrected code (in sites/all/modules/splashify/js/splashify_init_min.js):

(right after: var i=document.referrer+"";)

if(i.indexOf("?")!=-1) { i = i.substr(0,i.indexOf("?")) }

chrisroane’s picture

Status: Active » Needs review

Good catch! I took your code and modified it to work with the JS, and I think this should be fixed.

Do you have a way of testing this from your end? This updated code is in the 7.x-1.x dev branch. I'm pretty sure this should now be fixed, but it would be great if you could test this from your end.

Sorry for the late response. I'm just getting caught up with the issue queue.

chrisroane’s picture

Status: Needs review » Closed (fixed)

I pushed this changes into the next release of the module: 7.x-1.1. It should show up on the download page soon.

chrisroane’s picture

Issue summary: View changes

added code-tag around little code bit

dpearcefl’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Issue summary: View changes
Status: Closed (fixed) » Active

I'm using the dev code and this issue still happens for me. If I am coming from google, I get html but it renders to a blank white page. If I copy the url into a new browser, it works correctly.

dpearcefl’s picture

Is there any news about getting this fixed?

chrisroane’s picture

From my testing, it looked like it was working. But I don't have a real case to test with.

I haven't been able to look into this again yet, and the next few weeks look pretty busy for me. There is a chance I may have some time next week to look into it. I'll try to fit it in then.

If you know PHP/JS code, you are sure welcome to take a look. Especially if you have a site where you can replicate this problem.

rwinikates’s picture

I am having a hard time reproducing in Chrome on either Mac or Windows, but Firefox (win/mac) and Safari (mac) can reproduce it. Console error shows the following:
ReferenceError: i is not defined @/sites/all/modules/splashify/js/splashify_init_min.js

rwinikates’s picture

Furthermore it seems to only affect redirects, not modal windows through colorbox.

chrisroane’s picture

Ah, that might explain why it worked fine for me in Chrome.

paulkittredge’s picture

I can replicate this problem in Safari on OSX. Here's what I did:

  1. Put Safari in Private Browsing mode (Safari >> Private Browsing)
  2. Visit https://www.google.com
  3. Search for "Moving MD Forward"
  4. Click on the first result that pops up - that should bring you to www.movingmdforward.net. Notice that you get the home page without a splash redirect.
  5. In a new tab, visit http://www.movingmdforward.net. Notice that you now get the splash page redirect.

For what it's worth, this is using Splashify version 7.x-1.0 - one version ago. I'm comfortable sharing this URL, since it's degrading somewhat gracefully (showing the home page instead of the splash page, but giving a white screen). I do have another site where I can replicate the issue the original poster mentioned, where the site is on 7.x-1.1 - but I'm not comfortable publicly sharing the URL. Please let me know if you'd like me to pass that along to you, so you can replicate it there.

I mention this in case it's helpful comparing 1.0 to 1.1 and seeing how the changes from 1.0 to 1.1 created the white screen.

Nicolas Bouteille’s picture

I suspect this could come from Google itself. I have enabled the module on a website that has been live for less than a month and suddenly I get the white screen. I have been forced to disable the splash page for now.

Read this https://drupal.org/node/2104817

What do you guys think ?

chrisroane’s picture

Priority: Normal » Critical
Status: Active » Needs review

Thanks everyone for the help in tracking this down!

So I took another look at it and did more testing and found the JS error that was happening. It was actually triggering the JS error in all browsers because there was a bug in the JS. That should now be fixed in the latest code in the dev branch.

Before I push this to 1.2, can someone test the dev branch to see if this problem is resolved? One way that I tested it was manually change the referrer JS variable to use what Vidioterie included above, which will trigger the code we are firing when the link comes from Google.

Nicolas Bouteille: I haven't confirmed if Google is also preventing this from working as well because I don't have a real world example. But the fact that the page is loading a blank page infers that this problem was caused by the JS error that I fixed above. So I'm fairly confident this should fix this issue.

Nicolas Bouteille’s picture

Updated to last dev and the white page problem when coming from Google is solved ! Awesome.
Thanks a lot !

Nick

chrisroane’s picture

Thanks Nicolas for testing this so quickly!

I pushed this to 7.x-1.2. So we should now be set!

chrisroane’s picture

Status: Needs review » Closed (fixed)