Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Feature: Add Firefox Support (#40)
Browse files Browse the repository at this point in the history
New Features:
- Now supports Firefox (Closes #37)
  • Loading branch information
pkmnct committed Jan 20, 2021
1 parent 7ab017a commit 9a1c1e0
Show file tree
Hide file tree
Showing 18 changed files with 204 additions and 206 deletions.
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
<img src="https://raw.githubusercontent.com/pkmnct/robinhood-mint-sync-chrome/master/public/images/icon512.png" alt="Mint and Robinhood Sync Icon" width="128" height="128">

# Robinhood Mint Sync for Chrome
# Robinhood Mint Sync

A Chrome Extension that allows you to automatically sync your Robinhood portfolio balance with your Mint account. It will add the balance as a _collectible_ in Mint.
A Browser Extension that allows you to automatically sync your Robinhood portfolio balance with your Mint account. It will add the balance as a _collectible_ in Mint.

[View the project site](https://pkmnct.github.io/robinhood-mint-sync-chrome/)

## Installation

#### General Use

The extension is offered through the [Chrome Web Store](https://chrome.google.com/webstore/detail/robinhood-mint-integratio/mogflmdandlpjobbddhopcggkjoggpdo):

[<img src="https://raw.githubusercontent.com/pkmnct/robinhood-mint-sync-chrome/master/images/chrome-web-store.png" alt="Available in the Chrome Web Store" width="248" height="75">](https://chrome.google.com/webstore/detail/robinhood-mint-integratio/mogflmdandlpjobbddhopcggkjoggpdo)

#### Developer Use
## How to use the Extension

The extension is very simple to use. Just visit your [Mint overview page](https://mint.intuit.com/overview.event) to automatically initiate a sync. If you have not performed a sync before, you will be directed to set up the item in Mint to track your Robinhood portfolio to.

## Note on Mint's native Robinhood support

Mint previously introduced native support for Robinhood shortly after this extension was released, however [Mint is reporting that Robinhood is blocking their app](https://help.mint.com/Featured-Questions/2090847861/Known-Issue-Robinhood-Error-102-105-155.htm). While the extension had previously been deprecated, it is now back under active development. This extension will add the Robinhood balance as _collectibles_ in Mint. If you had previously added your account natively, you should mark the account as inactive to prevent duplication of balances.

#### Developer Use (Chrome)

You can also run a local version of the extension for development.

Expand All @@ -24,11 +30,3 @@ You can also run a local version of the extension for development.
4. Open the Chrome Extensions Page (Chrome Menu > More Tools > Extensions).
5. Turn on the Developer Mode switch on the top-right of the page.
6. Choose the _Load unpacked_ button and navigate to the `dist/extension` folder of the repository.

## How to use the Extension

The extension is very simple to use. Just visit your [Mint overview page](https://mint.intuit.com/overview.event) to automatically initiate a sync. If you have not performed a sync before, you will be directed to set up the item in Mint to track your Robinhood portfolio to.

## Note on Mint's native Robinhood support

Mint previously introduced native support for Robinhood shortly after this extension was released, however [Mint is reporting that Robinhood is blocking their app](https://help.mint.com/Featured-Questions/2090847861/Known-Issue-Robinhood-Error-102-105-155.htm). While the extension had previously been deprecated, it is now back under active development. This extension will add the Robinhood balance as _collectibles_ in Mint. If you had previously added your account natively, you should mark the account as inactive to prevent duplication of balances.
19 changes: 16 additions & 3 deletions docs/changelog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Robinhood Mint Sync for Chrome - Changelog</title>
<title>Robinhood Mint Sync - Changelog</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="external/stellar/main.css" />
Expand All @@ -14,7 +14,7 @@
<!-- Header -->
<header id="header">
<h1>Changelog</h1>
<p>Robinhood Mint Sync for Chrome</p>
<p>Robinhood Mint Sync</p>
</header>

<!-- Nav -->
Expand All @@ -34,7 +34,7 @@ <h1>Changelog</h1>
<header class="major">
<h2>What's new in this release</h2>
</header>
<p>Accessibility improvements</p>
<p>Fixed some issues that could cause sync to fail. Add support for Firefox. Add a button to manually perform initial setup.</p>
</div>
</div>
</section>
Expand All @@ -44,6 +44,19 @@ <h2>What's new in this release</h2>
<header class="major">
<h2>Version History</h2>
</header>
<div class="version">
<h3>Version 3.4.0</h3>
<h4>Bug Fixes</h4>
<ul>
<li>Fixed an issue where the "Other" Robinhood balance may not set, causing the save to not occur./li></li>
<li>Fixed an issue where, if the Robinhood scrape failed, the Mint properties would be set to $0.</li>
</ul>
<h4>New Features</h4>
<ul>
<li>Support for Firefox added.</li>
<li>Settings page now has a button to manually trigger an initial Mint setup (and sync).</li>
</ul>
</div>
<div class="version">
<h3>Version 3.3.1</h3>
<h4>Bug Fixes</h4>
Expand Down
16 changes: 6 additions & 10 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Robinhood Mint Sync for Chrome</title>
<title>Robinhood Mint Sync</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="external/stellar/main.css" />
Expand All @@ -14,7 +14,7 @@
<!-- Header -->
<header id="header" class="alt">
<span class="logo"><img src="images/icon512.png" style="width: 128px" alt="" /></span>
<h1>Robinhood Mint Sync for Chrome</h1>
<h1>Robinhood Mint Sync</h1>
<p>Add your Robinhood portfolio value to Mint automatically.</p>
<ul class="actions special">
<li>
Expand Down Expand Up @@ -180,16 +180,12 @@ <h2>Reporting a Problem</h2>
<footer id="footer">
<h2>Version History</h2>
<section>
<h3>Version 3.3.1</h3>
<p>Accessibility improvements</p>
<h3>Version 3.4.0</h3>
<p>Fixed some issues that could cause sync to fail. Add support for Firefox. Add a button to manually perform initial setup.</p>
</section>
<section class="secondary">
<h3>Version 3.3.0</h3>
<p>
Fixes an issue where, if no properties had been set up on Mint, extension failed to create properties. Users with margin trading will now see the
equity value of their stocks rather than their total market value when syncing. Fixes an issue where buttons in the notifications were not showing
correctly.
</p>
<h3>Version 3.3.1</h3>
<p>Accessibility improvements</p>
</section>
<ul class="actions">
<li>
Expand Down
6 changes: 3 additions & 3 deletions docs/licenses.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Robinhood Mint Sync for Chrome - Licenses</title>
<title>Robinhood Mint Sync - Licenses</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="external/stellar/main.css" />
Expand All @@ -14,7 +14,7 @@
<!-- Header -->
<header id="header">
<h1>Licenses</h1>
<p>Robinhood Mint Sync for Chrome</p>
<p>Robinhood Mint Sync</p>
</header>

<!-- Nav -->
Expand All @@ -33,7 +33,7 @@ <h1>Licenses</h1>
<main id="main">
<section id="first" class="main">
<header class="major">
<h2>Robinhood Mint Sync for Chrome License</h2>
<h2>Robinhood Mint Sync License</h2>
</header>
<h3>MIT License</h3>
<p>Copyright &copy; 2021 George W. Walker</p>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "robinhood-mint-sync-chrome",
"version": "3.3.1",
"version": "3.4.0",
"repository": {
"type": "git",
"url": "git+https://github.com/pkmnct/robinhood-mint-sync-chrome.git"
Expand Down
6 changes: 3 additions & 3 deletions public/html/licenses.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Robinhood Mint Sync for Chrome - Licenses</title>
<title>Robinhood Mint Sync - Licenses</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="/js/external/stellar/main.css" />
<link rel="stylesheet" href="/css/main.css" />
Expand All @@ -13,7 +13,7 @@
<!-- Header -->
<header id="header">
<h1>Licenses</h1>
<p>Robinhood Mint Sync for Chrome</p>
<p>Robinhood Mint Sync</p>
</header>

<!-- Nav -->
Expand All @@ -32,7 +32,7 @@ <h1>Licenses</h1>
<main id="main">
<section id="extension" class="main">
<header class="major">
<h2>Robinhood Mint Sync for Chrome License</h2>
<h2>Robinhood Mint Sync License</h2>
</header>
<h3>MIT License</h3>
<p>Copyright &copy; 2018 George W. Walker</p>
Expand Down
8 changes: 4 additions & 4 deletions public/html/settings.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Robinhood Mint Sync for Chrome - Settings</title>
<title>Robinhood Mint Sync - Settings</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="/js/external/stellar/main.css" />
<link rel="stylesheet" href="/css/main.css" />
Expand All @@ -14,7 +14,7 @@
<!-- Header -->
<header id="header">
<h1>Settings</h1>
<p>Robinhood Mint Sync for Chrome</p>
<p>Robinhood Mint Sync</p>
</header>

<!-- Nav -->
Expand Down Expand Up @@ -54,8 +54,8 @@ <h2>Triangle Indicator Fix</h2>
<h2>Debug Mode</h2>
</header>
<p>
Enables logging and disables closing of Robinhood/Mint extension windows for debugging purposes. To see the logs, enable developer mode in Chrome
and inspect the background page of the extension.
Enables logging and disables closing of Robinhood/Mint extension windows for debugging purposes. To see the logs, inspect the background page of the
extension.
</p>
<input type="checkbox" id="setting-debugMode" name="setting-debugMode" />
<label for="setting-debugMode">Debug Mode</label>
Expand Down
16 changes: 6 additions & 10 deletions public/html/welcome.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Robinhood Mint Sync for Chrome - Welcome</title>
<title>Robinhood Mint Sync - Welcome</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="/js/external/stellar/main.css" />
<link rel="stylesheet" href="/css/main.css" />
Expand All @@ -14,7 +14,7 @@
<!-- Header -->
<header id="header" class="alt">
<span class="logo"><img src="/images/icon512.png" style="width: 128px" alt="" /></span>
<h1>Robinhood Mint Sync for Chrome</h1>
<h1>Robinhood Mint Sync</h1>
<p>Add your Robinhood portfolio value to Mint automatically.</p>
</header>

Expand Down Expand Up @@ -146,16 +146,12 @@ <h2>Reporting a Problem</h2>
<footer id="footer">
<h2>Version History</h2>
<section>
<h3>Version 3.3.1</h3>
<p>Accessibility improvements</p>
<h3>Version 3.4.0</h3>
<p>Fixed some issues that could cause sync to fail. Add support for Firefox. Add a button to manually perform initial setup.</p>
</section>
<section class="secondary">
<h3>Version 3.3.0</h3>
<p>
Fixes an issue where, if no properties had been set up on Mint, extension failed to create properties. Users with margin trading will now see the
equity value of their stocks rather than their total market value when syncing. Fixes an issue where buttons in the notifications were not showing
correctly.
</p>
<h3>Version 3.3.1</h3>
<p>Accessibility improvements</p>
</section>
<ul class="actions">
<li>
Expand Down
14 changes: 10 additions & 4 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"manifest_version": 2,
"name": "Robinhood Mint Sync for Chrome",
"name": "Robinhood Mint Sync",
"description": "Automatically add your Robinhood portfolio to Mint",
"version": "3.3.1",
"version": "3.4.0",
"author": "George Walker",
"browser_specific_settings": {
"gecko": {
"id": "[email protected]",
"strict_min_version": "42.0"
}
},
"icons": {
"16": "images/icon16.png",
"48": "images/icon48.png",
Expand All @@ -24,7 +30,7 @@
"128": "images/icon128.png",
"512": "images/icon512.png"
},
"default_title": "Robinhood Mint Sync for Chrome"
"default_title": "Robinhood Mint Sync"
},
"content_scripts": [
{
Expand Down Expand Up @@ -69,6 +75,6 @@
}
],
"options_ui": { "page": "html/settings.html", "open_in_tab": true },
"permissions": ["storage"],
"permissions": ["storage", "https://phoenix.robinhood.com/accounts/unified"],
"web_accessible_resources": ["images/*.png", "js/external/*"]
}
2 changes: 1 addition & 1 deletion src/background/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const eventHandlers = {
({ syncTime, propertiesSetup, needsOldPropertyRemoved, updated }) => {
if (updated) {
chrome.tabs.sendMessage(mintTab, {
status: "Robinhood Mint Sync for Chrome has updated.",
status: "Robinhood Mint Sync has updated.",
persistent: true,
link: urls.extension.changelog,
linkText: "View Changelog",
Expand Down
25 changes: 11 additions & 14 deletions src/content/mint/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ import { Debug } from "../../utilities/debug";

const debug = new Debug("content", "Mint - Main");

window.addEventListener("load", () => {
waitForElement({
selector: "#mintNavigation",
callback: () => {
debug.log("Detected Mint Overview Page");
chrome.runtime.sendMessage({ event: "mint-opened" });
if (window.location.href.indexOf("forceRobinhoodSync=true") !== -1) {
debug.log("Forcing sync");
new Notification("Syncing Mint with Robinhood.", true).show();
chrome.runtime.sendMessage({ event: "mint-force-sync" });
}
},
onError: (error) => debug.error("It appears Mint has not signed in", error),
});
waitForElement({
selector: "#mintNavigation",
callback: () => {
debug.log("Detected Mint Overview Page");
chrome.runtime.sendMessage({ event: "mint-opened" });
if (window.location.href.indexOf("forceRobinhoodSync=true") !== -1) {
debug.log("Forcing sync");
chrome.runtime.sendMessage({ event: "trigger-sync" });
}
},
onError: (error) => debug.error("It appears Mint has not signed in", error),
});

chrome.runtime.onMessage.addListener((request) => {
Expand Down
42 changes: 20 additions & 22 deletions src/content/mint/properties/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,24 @@ const setupProperties = () => {
});
};

window.addEventListener("load", () => {
debug.log("Waiting for .OtherPropertyView");
waitForElement({
selector: ".OtherPropertyView",
failureAttempts: 20,
callback: (result) => {
debug.log("Found Property View. Setting up properties.", result);
setupProperties();
},
onError: () => {
// If we don't find the OtherPropertyView, check if no properties are set up
debug.log("Did not find property view. Checking for zeroState");
waitForElement({
selector: ".zeroState",
callback: () => {
setupProperties();
},
onError: (error) => debug.error("Did not find zero state", error),
failureAttempts: 1, // We should fail right away if it doesn't exist. It's already waited many seconds for OtherPropertyView
});
},
});
debug.log("Waiting for .OtherPropertyView");
waitForElement({
selector: ".OtherPropertyView",
failureAttempts: 20,
callback: (result) => {
debug.log("Found Property View. Setting up properties.", result);
setupProperties();
},
onError: () => {
// If we don't find the OtherPropertyView, check if no properties are set up
debug.log("Did not find property view. Checking for zeroState");
waitForElement({
selector: ".zeroState",
callback: () => {
setupProperties();
},
onError: (error) => debug.error("Did not find zero state", error),
failureAttempts: 1, // We should fail right away if it doesn't exist. It's already waited many seconds for OtherPropertyView
});
},
});
Loading

0 comments on commit 9a1c1e0

Please sign in to comment.