[Script] WME Validator 2020.04.12 (PLACES BETA)

Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Moderators: Unholy, bextein, Glodenox, JustinS83

Forum rules
Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

DO NOT START a new thread unless it is about a new idea. Keep discussion of existing tools within the main thread for that tool.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Re: [Script] WME Validator 1.1.14 / 17.11.2015

Postby Glodenox » Wed Nov 18, 2015 8:43 am

The issue of changing class names and such can be sort of solved by having a fallback scenario in case you can't find the container. The fallback could be positioning it as before or perhaps even with absolute values in the bottom left corner or so.

I've even got 3 lines of tabs and don't find it too bad. I've been thinking about a way to make the tab list more compact and intend to experiment with it a bit, but these tabs are more compact than each script taking up their own bit of space on the left.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

Re: [Script] WME Validator 1.1.15 / 13.12.2015

Postby Glodenox » Tue Dec 29, 2015 12:01 pm

As of the past couple of days, WME Validator has been refusing to load for me. The browser console gives this error:
Code: Select all
TypeError: invalid assignment to const `unsafeWindow'   WME_Validator.user.js   line 129 > eval:1:277

Browser: Firefox 44.0b2
Greasemonkey version: 3.6

I've had this happen to another script as well (WME LiveMap Closures) where I could just remove the whole section on unsafeWindow as the script didn't use it anywhere. For WME Validator I've had to do some more digging and converting, but the following segment seems to be the culprit:
Code: Select all
    try {
      'object' === typeof Components.interfaces.gmIGreasemonkeyService && (b = !0)
    } catch (a) {
    }
    void 0 != typeof unsafeWindow && b || (unsafeWindow = function () {
      var a = document.createElement('p');
      a.setAttribute('onclick', 'return window;');
      return a.onclick(null)
    }());

The whole setAttribute trick to get an unsafeWindow on Chrome no longer works and can therefore be removed. For the code that uses Components I receive the error in the browser console that it is no longer supported in Firefox and will be removed soon. Luckily, unsafeWindow is available and doesn't need to be overwritten. Sadly enough, Google Chrome then can't find unsafeWindow any more, so there'll be issues there.
Last edited by Glodenox on Sun Jan 03, 2016 5:04 pm, edited 2 times in total.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

Re: [Script] WME Validator 1.1.15 / 13.12.2015

Postby Glodenox » Sun Jan 03, 2016 3:54 pm

FYI: I've slightly updated my previous reply about WME Validator no longer working in the next version of Firefox.

While spitting through the code, I noticed that WME Validator adds its own tracker to Google Analytics. What's the purpose of this tracker?
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

Re: [Script] WME Validator 1.1.15 / 13.12.2015

Postby Glodenox » Wed Jan 27, 2016 8:26 am

I've warned about this and even PM'ed the author about this with the simple fix that is needed. The script is now failing on a bit of code that doesn't even work any more.

It is related to the removal of the Components object as of Firefox 44. This makes the logic so that the script tries to overwrite unsafeWindow (as it wrongly expects it's not running Firefox), which then results in an exception being thrown.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

Re: [Script] WME Validator 1.1.16 / 29.01.2016

Postby Glodenox » Fri Jan 29, 2016 9:58 am

Yup, seems to be working as intended again. Thanks!
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

Re: [Script] WME Validator 1.1.16 / 29.01.2016

Postby Glodenox » Wed Mar 16, 2016 10:46 am

Hmm, I've recently started having problems having WME Validator to load in Firefox 45.0 when I'm already logged in. This happens on two different computers.
The only message WME Validator gives in the browser console is "WME Validator v1.1.16: waiting for login...".
Only when I log out and log in, WME Validator loads fine for that session as the login gets triggered. So at least we know it isn't related to that. As this looks like a racing condition somewhere, I tried fixing it by putting the script to run before or after all other scripts, but neither action changed anything.

I personally use the following bit of code to check whether I still need to wait on a user login and that seems to work fine:
Code: Select all
// preceded by a check on whether the element with id user-info exists
if (!Waze.loginManager.hasUser()) {
  Waze.loginManager.events.register("login", null, exportFunction(init, unsafeWindow));
  Waze.loginManager.events.register("loginStatus", null, exportFunction(init, unsafeWindow));
  return;
}


To be absolutely safe that the event doesn't happen to be triggered between the check and registering the listener, you could also check hasUser again before actually returning, but in the time I've been using this bit of code I haven't had any issues yet.

EDIT: I've noticed that enabling the WME Toolbox makes Validator work again. Toolbox probably slows down Firefox enough for Validator to pick up that someone is already logged in. That's not really a solution though.
Last edited by Glodenox on Wed Mar 16, 2016 7:16 pm, edited 1 time in total.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

Re: [Script] WME Validator 1.1.16 / 29.01.2016

Postby Glodenox » Wed Mar 16, 2016 7:36 pm

Guys, isn't there some USA-specific thread about Validator in which such discussions can take place? Right now it's just cluttering this topic.

Another (easier) issue: would it be possible to fix the FontAwesome icons? This is what WME Validator looks like at the moment:
[ img ]

The problem is that the classes used to get FontAwesome icons were changed a month or two ago. You now need to apply the "fa" class and the icon-specific class. I've gone over the classes in Validator for you to make it easier:
icon-check -> fa fa-check-square-o (empty: fa fa-square-o)
icon-filter -> fa fa-filter
icon-search -> fa fa-search
icon-user -> fa fa-user
icon-wrench -> fa fa-wrench
icon-question-sign -> fa fa-question-circle
icon-list -> fa fa-list
icon-magic -> fa fa-magic

After these changes (I couldn't find any other occurrences of "icon-"), Validator looks like this again:
[ img ]
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

Re: [Script] WME Validator 1.1.16 / 29.01.2016

Postby Glodenox » Tue Mar 29, 2016 4:58 pm

Weird, for some reason it seems to still be working on Firefox...
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

Re: [Script] WME Validator 1.1.16 / 29.01.2016

Postby Glodenox » Wed Apr 06, 2016 12:56 pm

I've made a userscript that brings back the icons in the UI of WME Validator (or any other script that still uses the old FontAwesome 3.x-style icons): https://www.waze.com/forum/viewtopic.php?f=819&t=184439

This won't fix the issue in Google Chrome that you guys seem to be having though.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

Re: [Script] WME Validator 1.1.16 / 29.01.2016

Postby Glodenox » Fri Apr 15, 2016 6:57 am

Same issue here. And I've been unable to find any errors that seem to point to the script in the browser console. Except one error inside GreaseMonkey about a missing method modelFor, which doesn't appear when I disable WME Validator:
Code: Select all
TypeError: Type does not implements method: modelFor#fv89c0nqmvc core.js:116:1
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1174
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 643 times
Been thanked: 1325 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: Mapman44