• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
[Google Chrome] Notifications

[Google Chrome] Notifications

JordanH

Well-known member
#41
Is there a way to turn certain sites off from notifications?
Theres some sites that I can give two sh*ts about xD

Annoying when I have to go to them just to get that notification from keeping to pop up.
 

Gazhyde

Well-known member
#43
Any thoughts on why I might be getting two alerts with different images for my site? Don't duplicates on the other XF sites it checks.

upload_2014-2-12_18-17-37.png
 

Daniel Hood

Well-known member
#44
I have no idea why that would happen and I find it odd that you have two different images for it too. I'm probably going to register for your site in a little bit.
 

Gazhyde

Well-known member
#47
I only get the double alert for my own site (which I'm logged in as an admin all the time). Don't get it for here, Adminextra.com or any other XF site.
 

Gazhyde

Well-known member
#50
Is there any pattern to when this happens? Like after you leave your computer asleep for hours, when you first turn it on, etc...
It's been on since 9am this morning after being fully shutdown last night (not suspended). To be honest it's difficult to notice a pattern as I have two screens so I'm not always looking when it pops up.

This last instance at least showed the same correct image on each notification though!

upload_2014-2-13_12-56-57.png
 

Daniel Hood

Well-known member
#52
The important part you need is the ajax request.

Code:
                            var xhr = new XMLHttpRequest();
                            xhr.open("GET", url + '?_xfResponseType=json', true);
                            xhr.setRequestHeader('X_REQUESTED_WITH', 'XMLHttpRequest');
                            xhr.onreadystatechange = function()
                            {

                            }
                           xhr.send();
The part of your forum that should tell it not to update the session table if that header is sent can be found here (looking at v1.2.4).
/library/XenForo/Controller.php

PHP:
   public function canUpdateSessionActivity($controllerName, $action, &$newState)
    {
        // don't update session activity for an AJAX request
        if ($this->_request->isXmlHttpRequest())
        {
            return false;
        }

        return true;
    }
My theory is that some people have a server setting that rejects headers sent from an external referrer.
 

Liam W

Well-known member
#54
I think I found the issue, and it lies with Apache 2.4 :)

From Apache 2.4, 'unsafe' headers were ignored and not passed to the environment variables. These include headers with underscores, like the header that xenforo checks for and that is being passed in.
 

Liam W

Well-known member
#56
It can be fixed server side by adding this to your htaccess file :)

Code:
SetEnvIfNoCase ^X.REQUESTED.WITH$ ^(.*)$ fix_accept_encoding=$1
RequestHeader set X-REQUESTED-WITH %{fix_accept_encoding}e env=fix_accept_encoding
 

Daniel Hood

Well-known member
#58
Good trouble shooting. I figured it had something to do with that because internal Ajax requests that set the same header and don't update the session activity don't have any issue.
 

Liam W

Well-known member
#60
Just a little update on my workaround, I haven't had Matthew appear all day, so either he uninstalled the extension, hasn't been using Chrome, or the workaround works :)

Liam