1.0.7 • Published 3 years ago

yahoo-js v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Yahoo.js - Javascript API for Yahoo

Yahoo.js is a typesafe api to get data from Yahoo. The only way to use is to add it into your google extension. It is lightweight and easy to use.

Installation

npm install yahoo-js

Add Into your Content Script

import $ from "jquery";
// @ts-ignore
import yahooJs, { api } from "yahoo-js";
yahooJs($);

Import JQuery and Yahoo.js. Pass jquery into yahoo.js, this will give it access to get the needed data.

Events

Email Item is a JQuery HTML Element

YAHOO_JS.on("clicked_email", (emailItem) => {
  console.log(emailItem);
});

YAHOO_JS.on("view_email", (emailItem) => {
  console.log(emailItem);
});

YAHOO_JS.on("compose_view", (emailItem) => {
  console.log(emailItem);
});

YAHOO_JS.on("compose_cancel", (emailItem) => {
  console.log(emailItem);
});

API

The methods inside of getEmailObj can also be imported like this

import yahooJs, {
  from,
  to,
  cc,
  bcc,
  subject,
  body,
  attachments,
} from "yahoo-js";
export const api = {
  /* Returns an object with the active compose email data */
  getEmailObj: () => {
    return {
      from: from(),
      to: to(),
      cc: cc(),
      bcc: bcc(),
      subject: subject(),
      body: body(),
      attachments: attachments(),
    };
  },
};

Contributing

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago