Version 3.1.4 has been released, with minor changes now that Steam opens same-domain pages again. See important notes here.
Other important note: There is a known issue with the Steam Client beta (with the new chat interface) where opening new popup windows does not work on any game. No known fix at the moment.
There is also currently no known solution for displaying MOTD panels on CS:GO post-Panorama.
Description:
Fixes various issues with plugins that create MOTD (web) panels.
Previously, the behavior of Steam's webview was problematic. Calling
ShowMOTDPanel (or variants) will show a previously viewed page if the last page viewed was on the same first-level domain. Those changes have caused issues with plugins like
backpack.tf Price Check.
This plugin hooks the
VGUIMenu usermessage and manipulates it in one of two ways to attempt to force displaying the correct page:
- The "delayed load": Another URL is opened, then the original URL is sent after a short delay.
- The "proxy" page: The URL is rewritten so the user navigates to a static page; the desired page is then either loaded into an iframe element or opened in a new panel with window.open(). The information is communicated through the URL hash; no information is leaked to the web server and clients can cache the page.
This hook method means no plugins need to be recompiled with various natives / dedicated function stock workarounds, and uninstallation is quick.
As Steam currently does not have any issues with same-domain pages, those particular workarounds are currently unnecessary. The ability to hook these usermessages remain useful, however.
The plugin also handles CS:GO-specific quirks in opening web pages; plugin authors can now use SourceMod's
ShowMOTDPanel function to make pages that are visible to the user as a popup window in CS:GO.
Other games can also attempt to use popups by sending a VGUI message with certain values configured while this plugin is present.
This plugin should work in games that support
ShowVGUIPanel /
ShowMOTDPanel and don't have other unique quirks. CS:GO (protobufs) are also supported.
ConVars:
- vgui_workaround_delay_time: Amount of time that the "delayed load" takes. If you're having issues with loading pages, you may need to raise this value.
- vgui_workaround_proxy_page: The URL to the static proxy page. You can host a copy yourself; it's available in the repository.
Other configuration:
You can configure which URL prefixes use which method. See the
configs/vgui_cache_buster_urls.cfg file for more details.
Dependencies:
If the "proxy" method is used (whether by iframe or popup), this plugin is dependent on one static page made accessible via web hosting. The plugin ships with a default URL pointed to my personally hosted copy of the page (which you can modify as mentioned in the ConVars section above).
No other plugin / extension dependencies.
Things the plugin will clobber:
VGUIMenu usermessages, obviously. Any plugins that use
ShowMOTDPanel or
ShowVGUIPanel with the
info panel with a URL will be caught by this plugin and "fixed". Any plugins that run their own fixes may conflict with this plugin.
Pages with restrictive
X-Frame-Options headers will refuse to load with the "proxy" iframe method. This includes YouTube (non-embed), Google, and Steam Community pages. Any iframe-proxied pages that link to one of those pages will also fail.
Hosting the proxy page over HTTPS will prevent connections through HTTP, even if the HTTP connection redirects.
The default URL configuration is set up to use the delayed load for almost every page. However, if you have an internal site or pages that listen to hash changes (like a custom web audio setup), the iframe method will be faster and doesn't destroy and recreate a page.
In CS:GO, MOTDs will automatically be enabled. Use a plugin such as
MOTD Disable to hide the panel that displays on join if you'd like.
There is a limitation of 255 bytes in a user message (for bitbuffers, at least).
Because the proxy method URL encodes parameters, you may reach this limit for long URLs that previously didn't.
Installation:
- Download the package.zip file from the releases page and copy the files into your SourceMod directory.
- Load the plugin. This will generate the configuration file located at cfg/sourcemod/plugin.vgui_cache_buster.cfg.
- Perform any desired configuration changes in the above file, as well as the URL configuration file.
- Optionally: Upload the www/motd_proxy.html page to web hosting. You can set the vgui_workaround_proxy_page ConVar to your own hosted copy.
- You're done. Test any plugins that open up web panels to make sure that they work.
For plugin developers:
Just use
ShowMOTDPanel as you would in every other game. If you use
ShowVGUIPanel directly, there are additional
KeyValues entries that you can pass in to modify the behavior of the MOTD display (see
the stock file for details).
Releases /
Source Code
__________________