yahoo-js
v1.0.7
Published
Wrapper for Yahoo
Downloads
10
Readme
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(),
};
},
};