Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Adriano Faria Posted January 20, 2020 Posted January 20, 2020 Althought it's in the template: <span class="ipsDataItem_generic"> {{if \in_array( $userAgent->browser, array( 'Android Browser', 'AppleWebKit', 'Camino', 'Chrome', 'Edge', 'Firefox', 'IEMobile', 'Midori', 'MSIE', 'Opera', 'Puffin', 'Safari', 'SamsungBrowser', 'Silk', 'UCBrowser', 'Vivaldi' ) )}} {{$browser = str_replace( ' ', '', $userAgent->browser );}} <img src="{resource="logos/browsers/{$browser}.png" location="interface"}" width="24"> {{endif}} {$userAgent->browser} {$userAgent->browserVersion} </span> it doesn't show: The image exists is in the right folder: applications/core/interface/logos/browsers
Mark Round Posted January 20, 2020 Posted January 20, 2020 can you see whats happening with the inspector in browser (image path) is it pointing correctly to the image,does the image exist? *edit I see now the image isnt being called at all,this looks like a bug.
Adriano Faria Posted January 20, 2020 Author Posted January 20, 2020 5 minutes ago, Mark Round said: can you see whats happening with the inspector in browser (image path) is it pointing correctly to the image,does the image exist? No image is shown; it's replaced by the browser and version. <span class="ipsDataItem_generic"> Opera Next 66.0.3515.36 </span> Using a plugin I have, I see it searchs for an image called Opera Next. In applications/core/interface/logos/browsers it's like Opera only.
Mark Round Posted January 20, 2020 Posted January 20, 2020 <img src="//yoursite.com/applications/core/interface/logos/browsers/OperaNext.png" width="24"> it looks like its because the browser is calling itself Opera Next instead of Opera when you change the template field to 'Opera Next' it looks for an image.A workaround would be to add an image in that filepath but it isnt solving the problem. <img src="//yoursite.com/applications/core/interface/logos/browsers/OperaNext.png" width="24">
Adriano Faria Posted January 20, 2020 Author Posted January 20, 2020 If I change the template or the image name will work, of course but as this is a core thing, IPS should handle this.
Mark Round Posted January 20, 2020 Posted January 20, 2020 {{if \in_array( $device->userAgent()->browser, array( 'Opera Next' ) )}} <img src="{resource="logos/browsers/Opera.png" location="interface"}" width="24"> {{endif}} 13 minutes ago, Adriano Faria said: If I change the template or the image name will work, of course but as this is a core thing, IPS should handle this. Agreed thats why i said this is a bug,above code fixes it for now
Adriano Faria Posted February 10, 2020 Author Posted February 10, 2020 On 1/20/2020 at 10:10 AM, Daniel F said: Thanks, I have reported this internally. Same is happening with Android Browser: The image iname is AndroidBrowser.png and it is detecting Android Browser.png.
bfarber Posted February 10, 2020 Posted February 10, 2020 In the very template you originally quoted in your first post we have this: {{$browser = str_replace( ' ', '', $userAgent->browser );}} I'm failing to see how we'd end up looking for "Android Browser.png". Are you sure that's not just in your customization, which needs the same code added to the template? If you're positive, please tell me where in the Suite this is showing up/how I can reproduce so we can take a closer look.
Adriano Faria Posted February 10, 2020 Author Posted February 10, 2020 Just now, bfarber said: In the very template you originally quoted in your first post we have this: {{$browser = str_replace( ' ', '', $userAgent->browser );}} I'm failing to see how we'd end up looking for "Android Browser.png". Are you sure that's not just in your customization, which needs the same code added to the template? If you're positive, please tell me where in the Suite this is showing up/how I can reproduce so we can take a closer look. It isn’t showing in Account Settings-> Devices too. And the script in first post is a core template in 4.4.9.
bfarber Posted February 11, 2020 Posted February 11, 2020 I just tested using both Chrome and the Samsung Browser on a Galaxy S9, and Chrome on a Google Pixel 4, and none report as "Android Browser" so I'm having difficulty testing. Which browser specifically are you using and on which device?
newbie LAC Posted February 11, 2020 Posted February 11, 2020 6 hours ago, Adriano Faria said: It isn’t showing in Account Settings-> Devices too. And the script in first post is a core template in 4.4.9. {{if \in_array( $userAgent->browser, array( 'Android Browser', 'AppleWebKit', 'Camino', 'Chrome', 'Edge', 'Firefox', 'IEMobile', 'Midori', 'MSIE', 'Opera', 'Puffin', 'Safari', 'SamsungBrowser', 'Silk', 'UCBrowser', 'Vivaldi' ) )}} {{$browser = str_replace( ' ', '', $userAgent->browser );}} <img src="{resource="logos/browsers/{$browser}.png" location="interface"}" width="24"> {{endif}} Do you see Opera Next in the array? I don't. So the image doesn't display on Account settings page Regarding Android Browser
bfarber Posted February 11, 2020 Posted February 11, 2020 Detection of "Opera Next" was flawed because Opera recently changed their default user-agent string. The third party library we use to parse user agent headers released an update and that concern is resolved. My questions were regarding Android Browser, but thank you @newbie LAC for confirming it is showing for you. I couldn't find a device that would actually be identified as "Android Browser" without more specifics (I did confirm SamsungBrowser was properly picked up, and other devices simply reflected as "Chrome").
Adriano Faria Posted February 11, 2020 Author Posted February 11, 2020 8 minutes ago, bfarber said: Detection of "Opera Next" was flawed because Opera recently changed their default user-agent string. Yes, that is fixed in 4.4.10. Tks. 9 minutes ago, bfarber said: My questions were regarding Android Browser, ... I couldn't find a device that would actually be identified as "Android Browser" without more specifics (I did confirm SamsungBrowser was properly picked up, and other devices simply reflected as "Chrome"). That was a misinformation about a report from a user in one of my resources. As I don't have any Android device to test it, I supposed it was the same issue from Opera but it wasn't. It was really missing the str_replace in my plugin to remove the space to meet the image name properly. Tks.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.