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

Add Gmail Image Proxy to email apps #561

Closed
wants to merge 2 commits into from

Conversation

summercms
Copy link
Contributor

@summercms summercms commented Oct 10, 2020

I feel kind and thought I'd write this pr for someone else's github issue.

See their github issue here: #127

More info: https://www.scientiamobile.com/what-is-google-image-proxy/

@coveralls
Copy link

coveralls commented Oct 10, 2020

Coverage Status

Coverage increased (+0.02%) to 99.97% when pulling 3232464 on ayumi-cloud:Gmail-Image-Proxy into 880b9fa on WhichBrowser:master.

@NielsLeenheer
Copy link
Member

There is something to say for adding Google Image Proxy as an application named "Gmail". But in that case we should not use the application list, but do the detection in PHP, because we do need to reset the operating system.

Even though the user agent string says Windows XP, the actual bot does not run on Windows XP. And neither does the user of Gmail run Windows XP on their own machine.

@summercms
Copy link
Contributor Author

Therefore Application.php

        /* Gmail Image Proxy */

        if (preg_match('/GoogleImageProxy/u', $ua, $match)) {
            $this->data->browser->reset();
            $this->data->browser->name = 'Gmail Image Proxy';
            $this->data->browser->version = null;
            $this->data->browser->type = Constants\BrowserType::APP_EMAIL;
            $this->data->os->reset();
            $this->data->engine->reset();
            $this->data->device->reset();
        }

Results:

    headers: 'User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)'
    readable: 'Gmail Image Proxy'
    result:  { browser: { name: 'Gmail Image Proxy', type: 'app:email' }, engine: { name: Gecko, version: '11.0' } }

@summercms
Copy link
Contributor Author

summercms commented Jun 21, 2021

@summercms summercms closed this Apr 20, 2022
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

Successfully merging this pull request may close these issues.

3 participants