Giter VIP home page Giter VIP logo

email-charmer's Introduction

email-charmer

Chrome extension that charm your email with more sophisticated words.

email-charmer's People

Contributors

heron2014 avatar

Watchers

James Cloos avatar

email-charmer's Issues

Communication between content-script and background.js

Previous solution :
emailCharmer (content_script) is responsible for:

  • detect bodyMessage once the page is fully loaded
  • on Change collect the data from bodyMessage
  • data should be an array of words
  • on click on word send word to background
  • create a API request and get synonym
  • send synonym back

These above steps don't work for me.
I had trouble to detect the bodyMessage, it wasn't reliable.

The code window.addEventListener('DOMConetentLoaded', ...) - seems to not be triggered at all
I use setTimeout to detect the bodyMessage, which worked but the rest steps seemed to be overcomplicated for the job.

New solution:

  • once extension icon is clicked , trigger script.js
  • script.js detect bodyMessage with no problems
  • words on click are send to background
  • background sends back dummy text for now

replace on click handler into something else

Currently to see synonyms suggestions user needs to click on the word.

Problems with that approach:

  • any click in the email area causes the opening alert box or throws an error depending on the position of the word.

Error on selecting first and last word

Bug when clicking on FIRST and LAST word: throws an errror:

Uncaught DOMException: Failed to execute 'setEnd' on 'Range': The offset 28 is larger than or equal to the node's length (27)

TODO

Currently I am sending back not quite a very good match to selected word. Check out the response object to get more relevant suggestion.

  • explore other suggestions from response object

Also API can't match words which are surrounded by special characters like: . , ? !

  • strip off the word from any special characters, lowerCase it as well before request to API

Also another issue is with selecting words by clicking on FIRST and LAST throws an errror:

script.js:13 Uncaught DOMException: Failed to execute 'setEnd' on 'Range': The offset 28 is larger than or equal to the node's length (27).

  • investigate and fix it

The new suggested word convert into HTML element and append it to bodyMessage.

  • check out if the above solution works
  • custom alert (for now as it is simple and quick solution)
  • ideally tooltip would be great!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.