George Clooney Posted July 19, 2019 Share Posted July 19, 2019 In Wars, when choosing Nuclear Attack option from the Select Action menu, nothing happens. Selecting another option immediately loads that page, then browsing back to the Wars menu and selecting Nuclear Attack again results in the appropriate page loading. It is a random thing in that it doesn't happen every time, but often enough that it is noticeable. Using Win 10 and version 68.0.1 of the Firefox browser if that helps troubleshooting. 1 Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted July 19, 2019 Administrators Share Posted July 19, 2019 Nuclear Attack should work exactly the same as the other options. My best guess is that it's some sort of issue on your end. If the other options are working, that suggests that JavaScript is enabled and working properly (which would be troubleshooting step #1.) Can you try another browser to see if that fixes the problem? If so, it's likely an issue on your end. My best guess as to what the issue would be is some sort of add-on or extension interfering with how the page is loading/operating. Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
George Clooney Posted July 19, 2019 Author Share Posted July 19, 2019 1 hour ago, Alex said: Nuclear Attack should work exactly the same as the other options. My best guess is that it's some sort of issue on your end. If the other options are working, that suggests that JavaScript is enabled and working properly (which would be troubleshooting step #1.) Can you try another browser to see if that fixes the problem? If so, it's likely an issue on your end. My best guess as to what the issue would be is some sort of add-on or extension interfering with how the page is loading/operating. I'll try Chrome and see if the issue pops up again and report back here if so. 1 Quote Link to comment Share on other sites More sharing options...
Roavin Posted August 28, 2019 Share Posted August 28, 2019 This isn't a problem on @George Clooney's side, this is a bug. This is something that happens sporadically with any option besides nuclear, and the reason is quite simple: <script type="21a01513a89b768abbb4d894-text/javascript"> $(function(){ // on change event to select $('.actionselector').on('change', function () { var url = $(this).val(); // get selected value if (url) { // require a URL window.location = url; // redirect } return false; }); }); </script> The above snippet is wrapped in $(), which means it's executed when the DOM is ready. However, analytics and all those other extra goodies just love taking forever sporadically (on any website, not just PnW), so even though the page looks loaded to the user, the DOM ready callbacks haven't fired yet. Usually things are placed at DOM ready so that whatever elements are being referenced are sure to be loaded, but ironically it's not even needed at this point, since the above <script> is placed after the actionselector <select> element is declared but before all of those wonderful extraneous goodies. So the solution is simple - take it out of $(), and it works. @Alex 5 Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted August 29, 2019 Administrators Share Posted August 29, 2019 17 hours ago, Roavin said: This isn't a problem on @George Clooney's side, this is a bug. This is something that happens sporadically with any option besides nuclear, and the reason is quite simple: <script type="21a01513a89b768abbb4d894-text/javascript"> $(function(){ // on change event to select $('.actionselector').on('change', function () { var url = $(this).val(); // get selected value if (url) { // require a URL window.location = url; // redirect } return false; }); }); </script> The above snippet is wrapped in $(), which means it's executed when the DOM is ready. However, analytics and all those other extra goodies just love taking forever sporadically (on any website, not just PnW), so even though the page looks loaded to the user, the DOM ready callbacks haven't fired yet. Usually things are placed at DOM ready so that whatever elements are being referenced are sure to be loaded, but ironically it's not even needed at this point, since the above <script> is placed after the actionselector <select> element is declared but before all of those wonderful extraneous goodies. So the solution is simple - take it out of $(), and it works. @Alex I learned something. When this was originally implemented some 6 years ago, I knew little/nothing about JavaScript, and it was a modification of someone else's snippet. Thanks for the help! 4 Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Codonian Posted August 29, 2019 Share Posted August 29, 2019 Presumably this will be/ is now fixed then? Also noticed this issue happen with me numerous times over the last few months but I just figured it was indeed a glitch on my end Quote Link to comment Share on other sites More sharing options...
Guest Frawley Posted August 30, 2019 Share Posted August 30, 2019 It was happening to me on Airstrikes all war, nearly tripped me up on a declare and air before ground once too. glad its been fixed. Quote Link to comment Share on other sites More sharing options...
Roavin Posted October 31, 2019 Share Posted October 31, 2019 @Alex - So, I see that while the code has now changed on the live site, the effect is still happening, especially when there's a very slow loading flag on the war page (like for me right now - Bamika's image takes 7 seconds to load, wtf). Given that I proposed the prospective fix and it's still not working right, I felt somewhat obligated to investigate further After dabbling around, I believe I've found the problem, though I'm not 100% certain on how best to fix it. I suspect the issue is Rocket Loader, which is injected by Cloudflare to asynchronously defer various blobs of Javascript for the purpose of making the page load faster. Apparently it works by replacing script type attributes with a prefixed version thereof (for example, prefix "bce348fb34a3edbcc529509b-"), then later going back and loading them on the side. Quite an insane piece of tech, honestly. If that is indeed the case, then why it's broken is clear - that piece of javascript to bind the drop down actions isn't executed immediately with the load, but rather much later whenever Rocket Loader feels like it. I can think of three potential ways of fixing it: Add data-cfasync="false" to the script tag, as described here. The problem here is that the snippet requires jQuery, so the script tag for loading jQuery in the head section needs that attribute as well. As above, except instead of also "synchronously" loading jQuery, replace that snippet with a vanilla js based version. Good ol' document.getElementsByClassName() should do the trick. Turn off Rocket Loader entirely in the CloudFlare settings. This may fix other potentially wonky places as well, though it may make the site "feel" slower (or faster, depending on how the browser rather than CloudFlare decides to schedule things like Bamika's insanely slow image. *phew*. While I'm here, a question: Would you mind if I rig up a piece of Greasemonkey code to replace that dropdown with individual buttons and/or keybinds? 2 Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted November 1, 2019 Administrators Share Posted November 1, 2019 2 hours ago, Roavin said: @Alex - So, I see that while the code has now changed on the live site, the effect is still happening, especially when there's a very slow loading flag on the war page (like for me right now - Bamika's image takes 7 seconds to load, wtf). Given that I proposed the prospective fix and it's still not working right, I felt somewhat obligated to investigate further After dabbling around, I believe I've found the problem, though I'm not 100% certain on how best to fix it. I suspect the issue is Rocket Loader, which is injected by Cloudflare to asynchronously defer various blobs of Javascript for the purpose of making the page load faster. Apparently it works by replacing script type attributes with a prefixed version thereof (for example, prefix "bce348fb34a3edbcc529509b-"), then later going back and loading them on the side. Quite an insane piece of tech, honestly. If that is indeed the case, then why it's broken is clear - that piece of javascript to bind the drop down actions isn't executed immediately with the load, but rather much later whenever Rocket Loader feels like it. I can think of three potential ways of fixing it: Add data-cfasync="false" to the script tag, as described here. The problem here is that the snippet requires jQuery, so the script tag for loading jQuery in the head section needs that attribute as well. As above, except instead of also "synchronously" loading jQuery, replace that snippet with a vanilla js based version. Good ol' document.getElementsByClassName() should do the trick. Turn off Rocket Loader entirely in the CloudFlare settings. This may fix other potentially wonky places as well, though it may make the site "feel" slower (or faster, depending on how the browser rather than CloudFlare decides to schedule things like Bamika's insanely slow image. *phew*. While I'm here, a question: Would you mind if I rig up a piece of Greasemonkey code to replace that dropdown with individual buttons and/or keybinds? Thanks for your insights. I am going to look further and see if I can find a better solution for everyone. No, I don't have any issue with you writing a greasemonkey script. If you can design a better UI that's great, and I'd be happy to adopt it for everyone in-game. To be honest, the existing functionality was adopted because that's how CN did it. 2 Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.