Giter Site home page Giter Site logo

Comments (10)

tunisiano187 avatar tunisiano187 commented on July 4, 2024

2022.08.15.01 shloud solve the problem

from wme-send-to-slack.

MatthieuF44 avatar MatthieuF44 commented on July 4, 2024

Hi,

I already test the line "@connect discord.com" but it doesn't work.

Kind regards.

from wme-send-to-slack.

ordonezgs avatar ordonezgs commented on July 4, 2024

Related to CSP Policy.

The current Waze CSP Policy can contact SpreadSheets, but not Discord, Slack, Telegram and so On...

We Will have to add a @connect per service missing or not complying with CSP Policy.

//Trying to make Beta vs. Prod. Compatibility - HTTP
if (location.host == "beta.waze.com"){
await makeHTTPRequest('GET', cons_connect_one + sheetName + cons_connect_two)
.then( function(response) {
$.each( response.values, function( key, val ) {
if (!(Array.isArray(val) && val.length)) {
translationsInfo.push("Not Translated")
} else {
translationsInfo.push(val)
}
});
statusSheetsCallback = true;
log("Tampermonkey HTTP succeeded");
} )
.catch(function(response){
log( "Tampermonkey HTTP failed!" );
console.log(response)
});
}else{
await $.get(cons_connect_one + i18n + cons_connect_two)
.then( function(data) {
$.each( data.values, function( key, val ) {
if (!(Array.isArray(val) && val.length)) {
translationsInfo.push("Not Translated")
} else {
translationsInfo.push(val)
}
});
statusSheetsCallback = true;
log("$.get succeeded");
} )
.catch( function() {
log( "$.get failed!" );
} );
}

from wme-send-to-slack.

ordonezgs avatar ordonezgs commented on July 4, 2024

Actually, reviewing it, the previous shared code it's OK.

We just have to replace the AJAX with await MakeHTTPRequest() and with this parameters. So we also will need to adjust the MakeHTTPRequest() to be able to make a POST request:

$.ajax({
data: 'payload=' + JSON.stringify({
"text": TextToSend,
"username": ScriptName + " " + GM_info.script.version,
"mrkdwn": true,
"channel": serverDB[localStorage.getItem('WMESTSServer')][key]["chanel_" + chanel],
"icon_emoji": actionicon
}),
processData: false,
type: 'POST',
url: serverDB[localStorage.getItem('WMESTSServer')][key][chanel],
error: function(x, y, z)
{
log('Slack error : ' + x + ' ' + y + ' ' + z);
}
});

and this
$.ajax({
data: 'payload=' + JSON.stringify({
"attachments": [{
"text": TextToSend.replace(discrordreplacefrom, function(matched) {
return discrordreplaceto[matched]
})
}],
"username": ScriptName + " " + GM_info.script.version,
"mrkdwn": true,
"channel": serverDB[localStorage.getItem('WMESTSServer')][key]["chanel_" + chanel],
"icon_emoji": actionicon
}),
processData: false,
type: 'POST',
url: serverDB[localStorage.getItem('WMESTSServer')][key][chanel],
error: function(x, y, z)
{
log('Discord error : ' + x + ' ' + y + ' ' + z);
}
});

even
$.ajax({
url: serverDB[localStorage.getItem('WMESTSServer')][key]['url'],
data: datas,
type : "POST",
dataType: "xml",
error: function(x, y, z)
{
log(x + ' ' + y + ' ' + z);
}
});

and finally
$.ajax({
data: dataTelegram,
type: 'POST',
url: serverDB['DEVns_en'][key]['editing'],
error: function(x, y, z)
{
log('Telegram error : ' + x + ' ' + y + ' ' + z);
}
});

This requires further dev, and implementation. Sorry, this will take time.

from wme-send-to-slack.

ordonezgs avatar ordonezgs commented on July 4, 2024

Required @connect will be:

@connect slack.com
@connect discordapp.com
@connect discord.com
@connect telegram.org
@connect google.com

This will be for Google Forms, Slack, Discord and Telegram

from wme-send-to-slack.

ordonezgs avatar ordonezgs commented on July 4, 2024

I have sent a request to Staff to modify their current CSP Policy to add:

discordapp.com
discord.com
api.telegram.org
hooks.slack.com

Let's wait for them before having to use the await MakeHTTPRequest() function.

from wme-send-to-slack.

ordonezgs avatar ordonezgs commented on July 4, 2024

This issue is in Prod, lets wait for Staff until making the required changes.

from wme-send-to-slack.

ordonezgs avatar ordonezgs commented on July 4, 2024

Staff Response:

We are happy to let you know that ith the WME beta release of v 2.126, we've released other whitelisted domains that you asked for.
Please note these are currently available in beta and will reach production once v2.126 reaches production.

from wme-send-to-slack.

stale avatar stale commented on July 4, 2024

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

from wme-send-to-slack.

stale avatar stale commented on July 4, 2024

This issue has been automatically closed because it has not had any comments for a while, feel free to reopen it if needed

from wme-send-to-slack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.