Apps Script vs Chrome Extension: Writing an alternative spellchecker to Google Docs - google-chrome-extension

Say, I want to develop an alternative spellcheck module to google docs.
This means that I have to get corrections from my backend, and color the misspelled text's background, and do a small popup bubble when user hovers over it, where I'd display the correction. (please mind that spellcheck is not the actual goal of my project, but it does address my problems in a more simplified way)
What are my options? Any ideas how to do this?
Few possible solutions I came up with:
Chrome extension vs Apps script
Chrome extension
pros: user has to grant permissions once, can freely traverse and append anything to dom via content script
cons: is a "hacky" way, if google changes classnames or js source, it would stop working, and also, reverse engineering google docs's editor engine is impossible
Apps script
pros: supported by google: if it works, I dont need to be afraid of docs updates
cons: it seems to me that I can't just fiddle with the dom (because of Caja compiler), has very limited support (if any) for custom highlighting or hover functionality.
As I see it, neither of these are perfect solutions for this project. What do you think? Any suggestions are very welcomed.

I know this is an old question, but I have recently gotten into the same problem, and believe I have a solution. So for future Googler's I will post my answer here.
My solution was to create a Chrome Extension and understand how the Google Docs DOM's are structures to interact with it.
You can find my code to work with the Google Doc DOM's here

In Apps Script you can't "fiddle" with the DOM and you won't be able to implement hover functionality. Also, a lame Highlighting would involve changing the current document itself (which would go to revision history, undo queue, etc)
Therefore, your only altertive is the Chrome Extension. But I agree with you on the cons. It is a super hard task that could break at any minute without notice.

Related

PProPanel JSX - Basic guide to get started?

I know you can extend Adobe Premiere Pro with some simple JavaScript. The problem with that link (which I got to through the official Adobe website), is that all of sample code links are outdated (they point to the wrong location of the file, to lines that aren't correct anymore).
The second paragraph instructs you to install a bunch of things, none of which seem like things you "install", and they mention ExtendScript, which I don't understand whether is already installed with my Premiere or not (it's not available on Creative Cloud, and also the links I found on Adobe's website for it are, again, dead). I keep searching online and finding dead links to tutorials that no longer exist. Really, dead links everywhere.
I'm an experienced developer with good JS background, I just want know what I need, some simple examples of basic usage to get me started and maybe working links to some cheat-sheet I can use when I'm looking for available functions.
Extendscript is the name of the old API for automating Premiere and other Adobe apps. It's built-in and can basically do anything that you can do with the GUI, and it's javascript-based.
There is an IDE for Extendscript, the Extendscript Toolkit (ESTK) which has a debugger and allows you to inspect data etc. It's perplexingly hard to find on the Adobe website; I found it by a duckduckgo search here, I installed it through the creative cloud desktop manager, though I'm not sure how you do that with the current version.
As far as documentation goes, you're right, it's dead link city. There is a Javascript Tools Guide included with the Extendscript Toolkit, on windows it's in C:\Program Files (x86)\Adobe\Adobe ExtendScript Toolkit CC\SDK\. That covers creating UI elements, but doesn't explain Premiere's object model. AFAIK there is no official documentation for this, you have to use the ESTK data browser to look for yourself.
The CEP extensions are a new development and allow for easier integration with the host. I think you already have all the documentation there is for it. I'd advise that you pester Adobe to make it easier for developers like yourself to create tools for their users.
Here is for anyone else who gets here from a Google search: You can also go to this link to download the ESTK: https://helpx.adobe.com/download-install/kb/creative-cloud-apps-download.html

2 people working on 1 HTML file simultaneously

My freind and I want to setup a collaborative project where we both work on a HTML file (and do PHP) at the same time (bit like Google Docs share feature). I want to be able to work with him to teach him certain things in PHP and HTML while I also code at the same time. Any suggestions? I have a VPS I thought we could use for it so nothings really going to get in our way. Maybe something like GIT or something?
Sounds like what you need is a real-time collaborative text editor. Here's an extensive list from wikipedia.
I use Google Docs personally but Microsoft has added this type of functionality into Office and there are a slew of desktop and online tools on that link. I had looked into Etherpad before but i don't remember enough to suggest one or the other. All of the links are on the wikipedia article so I won't repeat here.

Browser Extension the "Injected way" a cross-browser extension that include a JS from a distant server

I've found this nice article about the "injected Way", but the author never finished it :
http://hightechstartups.blogspot.ch/2012/05/different-way-of-developing-browser.html
I would like a bare bone cross browser extension, without any 3rd party extensions or framework (to be as light as possible and not dependant on a 3rd party) that would load Jquery and a JS from a distant server and the ability to load it before or after the page is fully loaded.
I've read a lot of topics about the subject, but since IE10, Chrome 26 and FF20 are out with their new cross-link limitations, i was wondering if somebody had ressources, source code or tutorial about the following requirements :
I need :
Cross browser extension supporting (IE 8+ or 9+ worse case, Chrome
26+, FF20+, Safari)
Ability to inject a single JS hosted on another server. Inserts a script tag that references a javascript file in the head of the HTML
page and then be executed
Not be dependant on a third party extension (greasmonkey) or framework (Kango, Crossrider)
Ability to load before or after the page is fully loaded
This method allows me to customise the browser extension depending on the user's location and it also avoid having updates as the JS is updated on each page refresh.
I'm aware of the downsides, but i would like to achieve this.
I'm aware of cross browser framework like Kango or crossrider, but both don't fit me needs.
The closest example i could find is this How can I run a <script> tag that I just inserted dynamically from a BHO
but it only covers IE and as i got very little Csharp experience, i would like to see a full example to understand it properly and learn from example.
I would LOVE to have a few examples, even if it's not cross-browser (IE being the worst part for me).
Thanks a lot for your support !
Update1:
About Kango and Crossrider, Kango is 2000$ if you want to use IE and for Crossrider you're required to be distributed and monetized by them.
I've managed to code for IE and Chrome, but i was looking for an "elegant" way and figured it was the best place to ask given the level of knowledge of people on this site.
For the installer i currently use NSIS, but i'll test Wix too.
Finally i guess the only way for me would be to learn C++ and .net to get it to work with IE, but if anyone could provide more source code it would be great to test speed and compatibility and discuss here what's the best solution.
Why do Kango or Crossrider not fit your needs? Both frameworks allow you to manipulate the page's DOM (which is what you want):
Kango: Adding content script
Crossrider: documentation, example code
If you want to code your own solution, take a look at the relevant documentation:
Content scripts (Chrome)
The Page mod Jetpack API (Firefox)
Injected scrips (Safari)
Injected scripts (Opera)
Internet Explorer does not natively support extensions. It took me about 80 hours to create a stable and reliable IE extension which supports cross-site AJAX, a (preference) storage method and injection of scripts as early as possible in any frames based on its URL. I developed and tested the extension with Visual Express 2010 on Windows XP and Windows 7, for IE 8-10 (the extension might work on IE6/7, but I decided to not support these ancient and rarely used browsers).
First, I wrote an extension in C# based on LiveReloadIEExtension (a sample IE extension, which in turn is based on this Stack Overflow answer - see also this blog post). It was functional, but it required .NET 4, lacked support of frames, and it's relatively slow.
So, I decided to write an IE extension from scratch in C++. A good starting point is available at http://www.wischik.com/lu/programmer/bho.html: Sample code for C++ BHO, which changes the document's background based on key/mouse events. I've also learned a lot by looking at other code samples on CodeProject, topics on the MSDN forums, questions and answers on Stack Overflow, lots of other blogs, and the MSDN documentation:
DWebBrowserEvents2 interface lists several events which you use to find an appropriate injection point.
Scripting Object Interfaces (MSHTML) lists even more interfaces. You'll be mainly interested in the iHTMLDocument, iHTMLDocument2, ... interfaces.
After creating the IE extension, you want to deploy it of course. I used Wix toolset to create a MSI.

Getting started with Gmail Plugin development

I would like to get into Plugin development using the Gmail API and as such I would like to ask those who already have experience in it a few questions.
What language / languages should I be familiar with? I'm not familiar with Python, PHP, or JavaScript. Will I need to pick up on these?
What level of control do I have on what my plugin can do? Can I for example change the interface or add shortcuts or RSS feeds as a sidebar?
I know a lot of the examples mentioned already exist but I would like to try my own hand at it.
Peter posted a solid list of the official Gmail APIs.
On the other hand, most of the major plugins that you may have heard about are browser plugins that just modify the page source directly, even though there's no official API for it. There used to be a GreaseMonkey API that was a good starting point, but that wasn't supported and no longer works. Best place to start is with a copy of Chrome, creating a content-injection plugin that works on the Gmail page.
Happy to provide some further details if you can clarify what you're going for since I went through this myself a few months back.

How to build an shipable, "local", branded mini-browser

Since I don't really have a good idea for word to search with myself I’d like to ask you:
Is there some project, technology, w/e that enables you to build a 'browser' with a very slim ui. Just some CI and a customised "starting page".
I'm thinking of something like the Webkit engine (and interface) Valve/Steam uses for it's clients store page.
In what direction should I search for something like that ? How would one start implement something like that ?
Answers to questions:
We need this to provide something like a "Kiosk" application (for touchscreens) and shippable to our Customers. Running a browser in "full screen" is a temporary solution.
As of Platforms: Windows is absolutely sufficient for now, but Mac/Linux wouldn't hurt.
Prism looks nice so far but lacks the "shippable" part, e.g. I see no way of packaging it.
Take a look at Mozilla Prism. It's a "UI-Less" version of the Mozilla/Gecko rendering engine aimed at deploying web apps on the Desktop. It's also multi-platform. It might be fairly close to what you need, with comparably little work.
WebKit has bindings for many languages, is cross-platform, and is full-featured as a HTML engine. A bit of work capturing signals and calling functions will make it into any kind of web browser you like.
You could use Adobe Air, follow this tutorial and include your website within an iframe. That would allow you to build an executable you can ship to your customer.
Various graphics toolkit libraries contain some components which can display a limited amount of HTML. I've seen this in qt (a C++ GUI library) and in Java Swing, and have indeed built a tiny "browser" in Java within a couple of hours. Java Swing lets you attach a link listener so links can be made clickable and thereby jump to different URLs. Thus, my application could be made to work as a very limited browser.
This approach lets you display text, images and links; in the case of Java, there's even fairly good support for CSS styling. However, there's no simple way to make buttons and form fields work, and of course no support for manipulating the DOM or anything else done in JavaScript.

Resources