Browser extension to allow users to submit posts front end

Can anyone think of a good starting point of how I could create a simple browser extension to allow submitting of posts to my wordpress website.

At the moment, the user can login and via the front end submit posts to their profile.

What they are submitting is actually their favourite websites. So.. I want to try and create a browser extension that enables this whilst visiting other websites, like a super slick bookmarking tool.

Very vague question I know, and I am sure will be a bit tricky to achieve but I was just wondering if anyone had any ideas of at least a starting point for me to go on!

Thanks guys,

Joel

Topic browser-compatibility front-end users Wordpress

Category Web


Leverage the REST API for extension/WordPress communication.

EDIT

As discussed in the comments, creating custom AJAX handlers is probably a more straightforward and "more simple" approach.

In order to implement your project using the REST API, you would likely have to implement a custom post type as well as a custom REST endpoint controller class. Using a simple AJAX approach, however, you only need implement a AJAX controller.

As an alternative to implementing a heavier browser extension, you might also consider implementing a bookarklet instead - that is, a chunk of JavaScript code which is executed through a browser's address bar, and thus can be saved in virtually any web-browser as a "bookmark". This is how the "Press This" feature shipped with WordPress functions.

In either scenario, it's possible that you'll need to configure the endpoint(s) which communicates with the extenstion/bookmarklet to allow HTTP requests originating from virtually anywhere. An HTTP request to a server originating from another domain than the server itself is commonly called a "Cross-Origin-Request", which is managed through web-server and application rules regarded as "Cross-Origin Resource Sharing" or "CORS"

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.