您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Display the error messages received from Waze in the web console
当前为
- // ==UserScript==
- // @name WME Error Details
- // @author Tom 'Glodenox' Puttemans
- // @namespace http://www.tomputtemans.com/
- // @description Display the error messages received from Waze in the web console
- // @include /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?editor.*$/
- // @version 0.1.1
- // @grant none
- // ==/UserScript==
- (function() {
- // Replace the send method with a function that adds a listener to the load event
- // This way we can monitor the results
- XMLHttpRequest.prototype.reallySend = XMLHttpRequest.prototype.send;
- XMLHttpRequest.prototype.send = function(body) {
- this.addEventListener('load', function() {
- if (this.status != 200) {
- try {
- var response = JSON.parse(this.response);
- log(response);
- response.errorList.forEach(function(error) {
- log('Error code ' + error.code + ': ' + error.details);
- });
- } catch (e) {
- log(this.response);
- }
- }
- });
- this.reallySend(body);
- };
- function log(message) {
- if (typeof message === 'string') {
- console.log('%c' + GM_info.script.name + ' (v' + GM_info.script.version + '): %c' + message, 'color:black', 'color:#d97e00');
- } else {
- console.log('%c' + GM_info.script.name + ' (v' + GM_info.script.version + ')', 'color:black', message);
- }
- }
- })();