[Script] WME Validator 1.1.20 / 03.11.2016

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

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.16 / 29.01.2016

Postby Glodenox » Sat Apr 23, 2016 8:31 am

I've found that the issue is located somewhere in the initialization of the script. It waits for a user login, even though there is already a user logged in. By executing the following bit of code I'm able to make Validator appear again on Firefox:
Code: Select all
Waze.loginManager.events.triggerEvent('login');

In the shape of a bookmarklet that gives:
Code: Select all
javascript:Waze.loginManager.events.triggerEvent('login');

So I'm guessing (as I can't read the source code) that the check for a logged in user is incorrect or that the state listener is added too late.

Personally I'm using this code to trigger when the user has logged in and this seems to work fine:
Code: Select all
    if (typeof Waze === 'undefined' ||
        typeof Waze.loginManager === 'undefined') {
      setTimeout(init, 100);
      return;
    }
    if (!Waze.loginManager.hasUser()) {
      Waze.loginManager.events.register("login", null, init);
      Waze.loginManager.events.register("loginStatus", null, init);
      if (!Waze.loginManager.hasUser()) {
        return;
      }
    }

EDIT: oh wait, it seems I also have another check before I can actually access the tabs (to add a tab or manage them):
Code: Select all
    var tabs = document.querySelector('#user-tabs .nav-tabs');
    if (!tabs) {
      setTimeout(init, 400);
      return;
    }
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

Re: [Script] WME Validator 1.1.16 / 29.01.2016

Postby Glodenox » Sun Apr 24, 2016 8:44 pm

In theory, that's not an error. ‰ stands for 'per mille' (per thousand). So 33‰ = 3.3%
But as this symbol isn't used that often, I also think it would be better to replace it with a percentage instead.
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

Re: [Script] WME Validator 1.1.17 / 01.06.2016

Postby Glodenox » Wed Jun 01, 2016 8:09 am

Firefox is giving the following error in the browser console:
Code: Select all
SecurityError: The operation is insecure.

This is usually caused by a Same Origin Policy issue.
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

Re: [Script] WME Validator 1.1.18 / 02.06.2016

Postby Glodenox » Fri Jun 03, 2016 9:28 am

Yay, Validator is working again on Firefox as well! Thanks!

In order to move the processing of segments to another thread: perhaps you could look into moving the processor to a Web Worker? Though it does seem to be a bit difficult to use in a userscript.
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

Re: [Script] WME Validator 1.1.19 / 04.06.2016

Postby Glodenox » Mon Sep 12, 2016 9:59 am

I think the internal structure for street names or cities changed a bit, causing the script to mark all road segments as 'missing country and state'. I haven't done a lot yet with that part of the data model, so I can't remember what it used to look like.
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

Re: [Script] WME Validator 1.1.19 / 04.06.2016

Postby Glodenox » Sun Oct 30, 2016 10:36 am

The past 4 pages in this thread already talk about this issue ;)
You can somewhat mitigate the issue by putting "!23" in the "Reported as" field in the search tab, though it will still slightly break the script.

We'll have to wait for the script author to fix this, I'm afraid.
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

Re: [Script] WME Validator 1.1.20 / 03.11.2016

Postby Glodenox » Thu Jan 05, 2017 7:57 am

The script is sort of encrypted, but as with anything you have to run, there are ways of looking at what is inside. That said, I don't think that's the way to go here.

Basically, the script should be made more robust to not fail completely whenever a certain validation fails. Do we have a full list of all checks the script performs somewhere? Including all regional differences would probably become troublesome though.
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

Re: [Script] WME Validator 1.1.20 / 03.11.2016

Postby Glodenox » Mon Feb 13, 2017 2:58 pm

So the addition of the ExtendedSVG renderer fixes the script already? I've just installed the userscript at https://dbcm.github.io/waze/valfix/valfix.js as a userscript on Firefox, but the validator still doesn't seem to work yet here (I've made it so that the fix gets executed before validator).

I'll look into it later if other people say this does seem to fix validator for them.
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

Re: [Script] WME Validator 1.1.20 / 03.11.2016

Postby Glodenox » Mon Feb 13, 2017 3:19 pm

It's just a regular userscript, so I can't see where there would be a difference between TamperMonkey and GreaseMonkey here. Unless there's another bug that is only present on Firefox that hasn't been fixed this way. But I'll look into it closer in a couple of hours.
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

Re: [Script] WME Validator 1.1.20 / 03.11.2016

Postby Glodenox » Mon Feb 13, 2017 6:45 pm

I've been able to get this to work consistently in Firefox after a couple of changes to the code of dbcm. The if statement around the proxy for require was unnecessary and I had to use window.require instead of just require to get it to work with GreaseMonkey. [EDIT: This has now been applied to dbcm's script] I've checked with TamperMonkey and this new version works there as well.
Last edited by Glodenox on Mon Feb 13, 2017 8:28 pm, edited 1 time in total.
Glodenox
Map Raider
Map Raider
 
Posts: 911
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 170 times
Been thanked: 572 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: Doctorblah, n4dog