Script authors: don't use *.waze.com or waze.com/*

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.

Script authors: don't use *.waze.com or waze.com/*

Postby AlanOfTheBerg » Wed Apr 13, 2016 4:46 pm

Hi all,

There are many pages used at Waze outside of editor. I think some scripts and extensions are causing issues by constantly trying to execute in other spaces, such as the editor dashboard (waze.com/user/editor/).

Please make sure the execution space for your scripts are tightly controlled down to just the actual editor URLs.

Thanks
-Alan
Wiki Resources: Map Editing Manual | alanoftheberg@gmail.com
Oregon-based US Country Manager | iPhone6 - VZ
AlanOfTheBerg
EmeritusChamps
EmeritusChamps
 
Posts: 23624
Joined: Sat Aug 28, 2010 8:48 pm
Location: US Country Manager - Oregon, USA
Has thanked: 1112 times
Been thanked: 4866 times

Re: Script authors: don't use *.waze.com or waze.com/*

Postby AlanOfTheBerg » Thu Jul 14, 2016 8:07 pm

Glodenox wrote:This slightly modified regex should do proper matching now that the beta version of the editor has moved:
Code: Select all
// @include /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?editor\/.*$/

Is this the most current and recommended @include for WME-specific scripts? I'm going to update my OP to actually include the recommendation, instead of only saying "don't do this." (I fell to my own pet peeve of URs which complain about a wrong location but have no guidance as to the correct location... :roll: )
Wiki Resources: Map Editing Manual | alanoftheberg@gmail.com
Oregon-based US Country Manager | iPhone6 - VZ
AlanOfTheBerg
EmeritusChamps
EmeritusChamps
 
Posts: 23624
Joined: Sat Aug 28, 2010 8:48 pm
Location: US Country Manager - Oregon, USA
Has thanked: 1112 times
Been thanked: 4866 times

Re: Script authors: don't use *.waze.com or waze.com/*

Postby bgodette » Mon Apr 18, 2016 9:48 pm

For native Chrome extensions (CWS extensions) this is what needs to be in your manifest.json:
Code: Select all
   "content_scripts": [ {
      ...
      "matches": [ "https://*.waze.com/*editor/*" ],
      "exclude_matches": [ "https://www.waze.com/*user/editor/*" ]
   } ],
It's not perfect as new excludes will need to be added anytime Waze adds a new URL that matches /*editor/
bgodette
Waze Global Champs
Waze Global Champs
 
Posts: 3441
Joined: Wed Jul 06, 2011 8:19 pm
Location: Denver, CO
Has thanked: 122 times
Been thanked: 542 times

Re: Script authors: don't use *.waze.com or waze.com/*

Postby ekrw » Wed Nov 09, 2016 4:14 pm

Yesterday I discovered that browsing to https://editor-beta.waze.com/editor which will be translated into
https://beta.waze.com/editor/

A number of scripts seems to miss this in their "@includes" ...., correct?
Country Manager, The Netherlands
[ img ][ img ][ img ]
Xiaomi Mi9 Lite (Android 10) - Waze v.4.63.0.1
ekrw
State Manager
State Manager
 
Posts: 609
Joined: Thu Jul 12, 2012 5:14 am
Location: Schiedam, The Netherlands
Has thanked: 116 times
Been thanked: 85 times

Re: Script authors: don't use *.waze.com or waze.com/*

Postby Glodenox » Wed Apr 13, 2016 7:40 pm

What would be the best combination of includes and excludes for a script running just in the editor?
I'm currently thinking of going with these 3 rules:
Code: Select all
// @include     https://www.waze.com/*editor/*
// @include     https://editor-beta.waze.com/*
// @exclude     https://www.waze.com/*user/editor/*

EDIT: combined one rule.
EDIT2: fixed exclusion rule as detailed below
Last edited by Glodenox on Thu Apr 14, 2016 9:24 am, edited 1 time in total.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1211
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 690 times
Been thanked: 1356 times

Re: Script authors: don't use *.waze.com or waze.com/*

Postby Glodenox » Thu Apr 14, 2016 9:26 am

Oh right, I don't know why that went wrong. I've done this correctly in the script I had already modified... Either way: I've adjusted it in my previous post.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1211
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 690 times
Been thanked: 1356 times

Re: Script authors: don't use *.waze.com or waze.com/*

Postby Glodenox » Tue Jun 07, 2016 8:18 am

I've just tested the regex above and it should work fine for all editor pages. I've only tested the regex though, not whether GreaseMonkey and TamperMonkey handle that correctly.
Surprisingly, that's the second time so far that I've seen a good use case for a negative lookback within regex. And the first one was just a couple of days ago. Weird :P

EDIT: one downside I should mention to using this regex is that the pop-up that users get will be a lot less readable for non-technical people. A list of URLs with some asterisks can be understood. Regex on the other hand...
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1211
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 690 times
Been thanked: 1356 times

Re: Script authors: don't use *.waze.com or waze.com/*

Postby Glodenox » Tue Jun 07, 2016 11:13 am

I guess that is of lesser importance here indeed.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1211
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 690 times
Been thanked: 1356 times

Re: Script authors: don't use *.waze.com or waze.com/*

Postby Glodenox » Wed Jul 13, 2016 9:45 am

This slightly modified regex should do proper matching now that the beta version of the editor has moved:
Code: Select all
// @include /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?editor\/.*$/
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1211
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 690 times
Been thanked: 1356 times

Re: Script authors: don't use *.waze.com or waze.com/*

Postby Glodenox » Thu Jul 14, 2016 8:18 pm

AlanOfTheBerg wrote:Is this the most current and recommended @include for WME-specific scripts? I'm going to update my OP to actually include the recommendation, instead of only saying "don't do this." (I fell to my own pet peeve of URs which complain about a wrong location but have no guidance as to the correct location... :roll: )

I'm not sure whether I'm in a position to recommend stuff, but it is the most current @include, yes.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1211
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 690 times
Been thanked: 1356 times

Next

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: KuniaKid, mudge42, Mythdraug