web2py in Chrome extension

50 views
Skip to first unread message

Alexei Vinidiktov

unread,
Mar 3, 2020, 12:31:44 AM3/3/20
to web2py-users
Hello,

I'm planning on creating a Chrome extension that will allow the user to clip web pages or parts of them and save the clips in a web2py app.

Is it possible to create such an extension?

Will it be able to communicate with the web2py app?

I would preferably use json-rpc for communication, but a RESTFUL api would also be fine. 

Which one would work?

How would authentication be handled?

Thanks!


--
Alexei

Dave S

unread,
Mar 3, 2020, 4:57:52 PM3/3/20
to web2py-users


On Monday, March 2, 2020 at 9:31:44 PM UTC-8, Alexei Vinidiktov wrote:
Hello,

I'm planning on creating a Chrome extension that will allow the user to clip web pages or parts of them and save the clips in a web2py app.

Is it possible to create such an extension?

Will it be able to communicate with the web2py app?


I don't know much about writing extensions, but communicating with the web2py app just involves issuing a request over https, and certainly javascript can do that (e.g., fetch() and such).

 
I would preferably use json-rpc for communication, but a RESTFUL api would also be fine. 

Which one would work?


Web2py has hooks for both json-rpc and a RESTFUL interface.
See Chapter 10, especially
 <URL:http://web2py.com/books/default/chapter/29/10/services#JSONRPC>
<URL:http://web2py.com/books/default/chapter/29/10/services#Restful-Web-Services>

How would authentication be handled?

Chapter 9 is the big picture on access and authorization
<URL:http://web2py.com/books/default/chapter/29/09/access-control>

but Chapter 10 has service-specific notes, starting under the REST section:
<URL:http://web2py.com/books/default/chapter/29/10/services#Access-Control
and more generally in
<URL:http://web2py.com/books/default/chapter/29/10/services#Services-and-Authentication>


Note that these answers change somewhat when using py4web instead of web2py,
although the DAL is the same.
 

Thanks!



Good luck!

/dps
 
Reply all
Reply to author
Forward
0 new messages