Intercept like button on Facebook web app

I’m currently building a chrome extension and I’m trying to get it to be able to stop a like on Facebook from going through even after the like button has been clicked. In my content.js, I currently have the code:

document.querySelectorAll('a[data-testid="fb-ufi-likelink"]').forEach(function(element) {
    element.addEventListener('click', function() {
        var r = confirm("You clicked like");
            if (r == true) {
                alert("you clicked OK");
            } else {
                alert("you clicked Cancel")
            }           
    })
});

As of now, when the like button is clicked, a confirm box pops up but the like does not go through until “OK” or “Cancel” is clicked. The goal is to have the like go through when “OK” is clicked, and the like to not go through when “Cancel” is clicked on the confirm box. Is this implementation feasible? If so, how would I go about doing this?

Re-enable the console in Dev tools on facebook

On facebook if you try to use the Console via Dev-tools it blocks you from entering anything.

This was well laid out here: How does Facebook disable the browser’s integrated Developer Tools?

Everywhere says this is not really a security feature for facebook but for their users. So that a general user doesn’t get tricked and paste in malicious code given to them by “hackers” to gain access to their account.

I manage groups on facebook. And i want to execute javascript every once and a while to remove specific things or organize lists in specific ways… But i can not do this on facebook…

What is the solution? How do I execute commands in the console and disable their script blocking the use of the console? (I am not great with JavaScript but still would like to execute my basic commands)

Thanks for any help

How can Web App disable CSS or Javascript browser add-on or extension?

I am looking for how to disable css or javascript code injection of the browsers’ plugins in our web app.

As an example, when we use Facebook’s messenger app at www.messenger.com, the site disables most of the browser’s plugins or extensions. How can I implement such control in our web app?

Thanks in advance. Regards.

How Facebook Messenger Web App disable CSS or Javascript browser add-on or extension?

I am looking for how to disable css or javascript code injection of the browsers’ plugins in our web app.

As an example, when we use Facebook’s messenger app at www.messenger.com, the site disables most of the browser’s plugins or extensions. How can I implement such control in our web app?

Thanks in advance. Regards.

Limit of the number of HTTP requests that can be sent to Facebook without being banned or getting captcha

I am building a Chrome Extension that needs to send around 10 HTTP GET requests on behalf of the user, to different web pages on Facebook. This is supposed to happen around once a week (so basically, 10 requests a week).

So my question is, is there a known limit to the number of times that I can send HTTP GET requests (using XMLHttpRequest in JavaScript) to Facebook?
Does it raise ‘red flags’ at Facebook when they receive a number of requests all at the same time, by the same user?

Using a Chrome extension to replace characters spanning more than one line in a Facebook status update

I have created a Google Chrome extension to allow users to select text in a component. This works great for most sites. However, Facebook handles its status updates differently. It seems that even though you are filling in what seems to be a single text box, it is actually using a div > div > span > span construct for every single line in this text box. I have no idea why they chose to do this but it makes replacing multiple lines of text much more complex.

Is there a way to select multiple lines (or even contiguous portions of multiple lines) of text in a Facebook status update and replace the data?

The relevant portion of my code looks like this:

function replace_text(language){
    let selection = window.getSelection();
    string = selection.toString();

    /* This section contains code that uses string.replace to replace characters in the string. */

    document.execCommand("insertText", false, string);

}

Based on the way my code works now, if I replace text on a single line I have no problems. But, if I replace text that spans multiple lines I end up with a blank unusable input box. Undoubtedly it is because it is removing portions of the html code. How can I fix my code so that the replacement process works properly not only for other sites but also for Facebook?

Using a Chrome extension to insert characters into sites such as Facebook

I have created a chrome extension to allow users to right-click in a textbox, and insert special characters. This works on many sites such as StackOverflow, but does not work on sites such as Facebook. This is because Facebook is not using a standard text box form control. Instead for each line in a text message, it seems to be using a div > div > span > span construct. Is there a way to create a Chrome extension to target page components such as this?

An portion of my Chrome extension code looks like this:

main.js:

chrome.contextMenus.create({
  title: "u038F",
  contexts:["editable"],
  onclick: function(info, tab){
      chrome.tabs.sendMessage(tab.id, {action: "insertCharacter", character: 'u038F'});
  }
});

content.js

chrome.extension.onMessage.addListener(function(request, sender, sendResponse){
    var objField = document.activeElement;

    if (request.action == "insertCharacter"){
        insertAtCursor(objField, request.character);
    }
});

function insertAtCursor(sField, sValue){
    if (sField.selectionStart || sField.selectionStart == '0'){
        var nStart = sField.selectionStart;
        var nEnd = sField.selectionEnd;

        sField.value = sField.value.substring(0, nStart) + sValue + sField.value.substring(nEnd, sField.value.length);
        sField.selectionStart = nStart + sValue.length;
        sField.selectionEnd = nStart + sValue.length;
    }
    else {
        sField.value += sValue;
    }
}

Is there a more general purpose way I can do this to handle various situations on different sites? If not, is there a way to specifically target Facebook as most of the time myself (and likely others) are going to be using my extension on Facebook. (Of course having it work for email sites such as GMail would be a benefit as well).

Login with Facebook in Extension popup

I’ve implemented my extension in that I want to implement login with Facebook

Login with Facebook 

It is open browser windows but I want to open a dialog box so Is there any way ?

Please help me

Login with facebook in chrome extension

I want to implement Login with Facebook functionality in my extension.
for that I’ve go through all Facebook document but not find proper solution

Please help me if anyone have implement

how to change content_scripts in js for chorme extension?

i am making an chorme extension from which we can change the color of facebook. here is the problem i dont know how to change css from js.
Here is what i have done and its working
manifest.json

{
   "browser_action": {
      "default_icon": "icon.png",
      "default_popup": "popup.html",
      "default_title": "Black Facebook"
   },
  "content_scripts": [ {
      "css": [ "facebook-bw.css" ],
      "matches": [ "https://www.facebook.com/*" ]
   } ],
   "description": "Black Theme has been activated",
   "manifest_version": 2,
   "name": "Black Facebook",
   "version": "0.1.0"
}

problem is when i install extension it changes color of fb right away. i want it to change when i press the button. i have already put popup.html and onclick. is there any way i can write this code

"content_scripts": [ {
      "css": [ "facebook-bw.css" ],
      "matches": [ "https://www.facebook.com/*" ]
   } ],

in js?