0

I'm looking for some way to create a very simple chrome extension in Python. I don't want, in fact, do anything inside the browser menu, like context menu for extensions.

For example: extension which inserts a length of word right after this word.

<p>Word</p>

to

<p>Word 4</p>  

I've read this topic here but the questions are either old or assuming more complicated extension.

Is there a simple way to create such extension?

Milano
  • 18,048
  • 37
  • 153
  • 353
  • 1
    I've suggested to close this as duplicate, you're best bet is probably this: https://github.com/cztomczak/cefpython Otherwise chrome extensions use javascript and html. – Jonathan Jan 13 '16 at 22:40
  • I've read the question. The question above is way more specific I think. – Milano Jan 13 '16 at 22:41
  • 2
    im not sure its a dupe ... but certainly the last part of your comment is the answer (chrome extensions use javascript and html.) – Joran Beasley Jan 13 '16 at 22:42
  • @Jonathan As I just commented in the dupe, those are bindings for CEF, which is for making apps that embed Chromium. CEF is not compatible with Chrome extensions, and definitely can't be used to develop them. – Jeremy Jan 13 '16 at 22:46
  • There is probably no simple way to do this. If you end up finding a solution, it will almost certainly require calling JavaScript APIs through a Python bridge, which will still require some amount of JavaScript knowledge, add a lot of complexity, and be very likely to have a negative performance impact unless you structure your extension very carefully. It's possible that someone could have created a framework for this kind of thing, but I'm not aware of them and there's not much reason to do so (at least for logic interacting with the web page). – Jeremy Jan 13 '16 at 22:48
  • Yeah, I echo @JeremyBanks, there was a blog post about it here: https://pythonspot.com/create-a-chrome-plugin-with-python/ – Jonathan Jan 13 '16 at 22:50
  • I will slap a duplicate on this. Reasoning: writing a chrome extension using python code is only possible by: 1) trans-compiling into JS, 2) invoking an external python program. Both are mentioned in that question, sort of. It's not a good idea anyway because of this huge extra complexity. – Xan Jan 14 '16 at 13:57

0 Answers0