mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
KaiOS: be more cautious about determining whether KaiAds is present
Just checking for the getKaiAd() function by doing "if (!getKaiAd ..." throws a ReferenceError if it's not defined, and now my error box catches that. Using "if (getKaiAd === undefined ..." seems to be acceptable, though.
This commit is contained in:
@ -11,7 +11,7 @@
|
|||||||
(function() {
|
(function() {
|
||||||
// To run, we need to be on KaiOS with the KaiAds SDK and the
|
// To run, we need to be on KaiOS with the KaiAds SDK and the
|
||||||
// Open Web Apps API.
|
// Open Web Apps API.
|
||||||
if (!getKaiAd || !navigator.mozApps ||
|
if (getKaiAd === undefined || navigator.mozApps === undefined ||
|
||||||
navigator.userAgent.toLowerCase().indexOf('kaios') == -1) return;
|
navigator.userAgent.toLowerCase().indexOf('kaios') == -1) return;
|
||||||
// If those prerequisites are satisfied, install the button.
|
// If those prerequisites are satisfied, install the button.
|
||||||
var advertbutton = document.createElement("button");
|
var advertbutton = document.createElement("button");
|
||||||
|
Reference in New Issue
Block a user