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

Commit

Permalink
2.0.0 (#10)
Browse files Browse the repository at this point in the history
* Remove analytics

* Fix Robinhood scraping

* Bump version, update changelog

* Update readme
  • Loading branch information
pkmnct committed Oct 21, 2020
1 parent c1f1b49 commit c98c0aa
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 115 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Important Note: Mint now supports adding Robinhood accounts natively.
The extension should continue to work, but will add the Robinhood balance as a _collectible_. If you [add Robinhood to Mint natively](https://help.mint.com/General/888961131/How-do-I-add-a-new-account-in-Mint.htm) the balance will show up under investments. Any changes made to Robinhood or Mint in the future could break this extension.
## Note on Mint's native Robinhood support
Support was added to Mint for Robinhood. Some users are reporting that the native support no longer works. This extension does continue to work, but it will add the Robinhood balance as a _collectible_. If you are able to successfully [add Robinhood to Mint natively](https://help.mint.com/General/888961131/How-do-I-add-a-new-account-in-Mint.htm) the balance will show up under investments. Any changes made to Robinhood or Mint in the future could break this extension.

<img src="https://raw.githubusercontent.com/pkmnct/robinhood-mint-sync-chrome/master/images/icon512.png" alt="Mint and Robinhood Sync Icon" width="128" height="128">

Expand Down
4 changes: 4 additions & 0 deletions html/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ <h2>Want to see the changelog on updates?</h2>
<header class="major">
<h2>Version History</h2>
</header>
<aside class="version">
<h4>Version 2.0.0</h4>
<p>Fixed an issue where the Robinhood portfolio balance scrape was not working due to updates to their site. Removed Google Analytics.</p>
</aside>
<aside class="version">
<h4>Version 1.3.0</h4>
<p>Added a fix for the triangle indicator in some areas of Mint. See <a href="https://github.com/pkmnct/robinhood-mint-sync-chrome/pull/7">pull request on GitHub</a> for more info. The changelog no longer shows on update by default. Analytics are no longer collected by default.</p>
Expand Down
9 changes: 0 additions & 9 deletions html/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ <h1>Settings</h1>
<nav id="nav">
<ul>
<li><a href="#welcome" class="active">Welcome Page</a></li>
<li><a href="#analytics">Analytics</a></li>
<li><a href="#triangleFix">Triangle Indicator Fix</a></li>
</ul>
</nav>
Expand All @@ -38,14 +37,6 @@ <h2>Changelog</h2>
<input type="checkbox" id="setting-changelogOnUpdate" name="setting-changelogOnUpdate">
<label for="setting-changelogOnUpdate">Display changelog on update</label>
</section>
<section id="analytics" class="main">
<header class="major">
<h2>Analytics</h2>
</header>
<p>Enable or disable sending analytic data. This data includes the time it takes for a sync to complete, when the extension is being used, and how long users interact with the extension's pages. You can toggle the tracking using this setting. You must restart your browser for the change to take effect.</p>
<input type="checkbox" id="setting-disableAnalytics" name="setting-disableAnalytics">
<label for="setting-disableAnalytics">Disable analytics</label>
</section>
<section id="triangleFix" class="main">
<header class="major">
<h2>Triangle Indicator Fix</h2>
Expand Down
10 changes: 4 additions & 6 deletions html/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ <h2>Reporting a Problem</h2>
<section>
<h2>Version History</h2>
<aside class="version">
<h4>Version 1.3.0</h4>
<p>Added a fix for the triangle indicator in some areas of Mint. See <a href="https://github.com/pkmnct/robinhood-mint-sync-chrome/pull/7">pull request on GitHub</a> for more info. The changelog no longer shows on update by default. Analytics are no longer collected by default.</p>
<h4>Version 2.0.0</h4>
<p>Fixed an issue where the Robinhood portfolio balance scrape was not working due to updates to their site. Removed Google Analytics.</p>
</aside>
<ul class="actions">
<li><a href="changelog.html" class="button">View Full Changelog</a></li>
Expand All @@ -105,8 +105,8 @@ <h4>Version 1.3.0</h4>
<section>
<h2>&nbsp;</h2>
<aside class="version">
<h4>Version 1.2.0</h4>
<p>This release is a bug fix for notification buttons not working.</p>
<h4>Version 1.3.0</h4>
<p>Added a fix for the triangle indicator in some areas of Mint. See <a href="https://github.com/pkmnct/robinhood-mint-sync-chrome/pull/7">pull request on GitHub</a> for more info. The changelog no longer shows on update by default. Analytics are no longer collected by default.</p>
</aside>
</section>
<p class="copyright"><a href="licenses.html">View extension and third-party licenses</a></p>
Expand All @@ -122,7 +122,5 @@ <h4>Version 1.2.0</h4>
<script src="../js/external/ajlkn/breakpoints.min.js"></script>
<script src="../js/external/stellar/util.js"></script>
<script src="../js/external/stellar/main.js"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-118042537-2"></script>
<script src="../js/analytics.js"></script>
</body>
</html>
40 changes: 0 additions & 40 deletions js/analytics.js

This file was deleted.

42 changes: 0 additions & 42 deletions js/background/event-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ chrome.runtime.onMessage.addListener(
if (typeof(result.mintLastSynced) === 'undefined') {
// First Run
console.log("First run detected");
chrome.storage.sync.get({"disableAnalytics": true}, function(result) {
if (result.disableAnalytics == true) {
console.log("Analytics are disabled.");
} else {
ga('send', 'event', 'First Run', 'Prompted Setup');
}
});
chrome.tabs.sendMessage(mintTab, {"status": "Robinhood account is not set up in Mint", "persistant": true, "link": "https://mint.intuit.com/addprovider.event?addRobinhood=true", "linkText": "Set up"});
} else {
mintLastSynced = new Date(result.mintLastSynced);
Expand All @@ -28,13 +21,6 @@ chrome.runtime.onMessage.addListener(
if (differenceHours >= 1) {
console.log("Syncing Mint with Robinhood.");
syncStartTime = new Date();
chrome.storage.sync.get({"disableAnalytics": true}, function(result) {
if (result.disableAnalytics == true) {
console.log("Analytics are disabled.");
} else {
ga('send', 'event', 'Sync', 'Started');
}
});

chrome.tabs.sendMessage(mintTab, {"status": "Syncing Mint with Robinhood.", "persistant": true});

Expand All @@ -49,13 +35,6 @@ chrome.runtime.onMessage.addListener(
});
} else if (request.triggerEvent == "portfolioAmount") {
console.log("Got Robinhood Portfolio Amount");
chrome.storage.sync.get({"disableAnalytics": true}, function(result) {
if (result.disableAnalytics == true) {
console.log("Analytics are disabled.");
} else {
ga('send', 'event', 'Sync', 'Got Portfolio Amount');
}
});

// Now we need to pass this amount to Mint to add
chrome.tabs.create({url: "https://mint.intuit.com/settings.event?filter=property&addRobinhood=true&portfolioAmount=" + request.portfolioAmount, active: false, openerTabId: mintTab});
Expand All @@ -67,38 +46,17 @@ chrome.runtime.onMessage.addListener(

var timeToComplete = syncStartTime - currentTime;

chrome.storage.sync.get({"disableAnalytics": true}, function(result) {
if (result.disableAnalytics == true) {
console.log("Analytics are disabled.");
} else {
ga('send', 'event', 'Sync', 'Complete', timeToComplete);
}
});
chrome.storage.sync.set({"mintLastSynced": currentTime.toString()});

chrome.tabs.sendMessage(mintTab, {"status": "Sync Complete! Reload to see the change.", "link": "/overview.event", "linkText": "Reload", "persistant": true});

} else if (request.triggerEvent == "addRobinhoodComplete") {
chrome.storage.sync.get({"disableAnalytics": true}, function(result) {
if (result.disableAnalytics == true) {
console.log("Analytics are disabled.");
} else {
ga('send', 'event', 'First Run', 'Complete');
}
});
console.log("Setup Complete.");
chrome.storage.sync.set({"mintLastSynced": oldTime.toString()});
} else if (request.triggerEvent == "forceSync") {
console.log("Syncing Mint with Robinhood.");
syncStartTime = new Date();

chrome.storage.sync.get({"disableAnalytics": true}, function(result) {
if (result.disableAnalytics == true) {
console.log("Analytics are disabled.");
} else {
ga('send', 'event', 'Sync', 'Started');
}
});
// First we need to get the value of the Robinhood portfolio
chrome.tabs.create({url: "https://robinhood.com/account?mintRobinhood=true", active: false, openerTabId: mintTab});
} else if (request.triggerEvent == "robinhood-login") {
Expand Down
7 changes: 4 additions & 3 deletions js/robinhood/robinhood.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
displayOverlay("Syncing Mint and Robinhood...", "This window will automatically close when the sync is complete");
$(document).ready(function() {
function sendPortfolioValue() {
if (jQuery(jQuery("h1")[1]).text().length && !(jQuery(jQuery("h1")[1]).text().startsWith("$0.00"))) {
var portfolioAmount = jQuery(jQuery("h1")[1]).text().split("9876543210-$,.")[0]
var portfolioAmountElement = document.querySelector(".main-container svg text").textContent;
if (portfolioAmountElement.includes("$")) {
var portfolioAmount = portfolioAmountElement.split("$")[1];

console.log("Sending portfolio amount: $" + portfolioAmount);

Expand All @@ -17,6 +18,6 @@ $(document).ready(function() {
chrome.runtime.sendMessage({"triggerEvent": "robinhood-login"});
window.close();
} else {
sendPortfolioValue();
waitForElement(".main-container svg text", sendPortfolioValue);
}
});
10 changes: 1 addition & 9 deletions js/settings.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
chrome.storage.sync.get({"changelogOnUpdate": false, "disableAnalytics": true, "fixTriangle": true}, function(result) {
chrome.storage.sync.get({"changelogOnUpdate": false, "fixTriangle": true}, function(result) {
console.log(result);
if (result.changelogOnUpdate) {
$("#setting-changelogOnUpdate").prop("checked", true);
}
if (result.disableAnalytics) {
$("#setting-disableAnalytics").prop("checked", true);
}
if (result.fixTriangle) {
$("#setting-fixTriangle").prop("checked", true);
}
$("#setting-changelogOnUpdate").change(function() {
chrome.storage.sync.set({"changelogOnUpdate": $("#setting-changelogOnUpdate").is(':checked')});
});
$("#setting-disableAnalytics").change(function() {
console.log("change");
console.log($("#setting-disableAnalytics").is(':checked'));
chrome.storage.sync.set({"disableAnalytics": $("#setting-disableAnalytics").is(':checked')});
});
$("#setting-fixTriangle").change(function() {
chrome.storage.sync.set({"fixTriangle": $("#setting-fixTriangle").is(':checked')});
});
Expand Down
7 changes: 3 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"name": "Robinhood Mint Sync for Chrome",
"description": "Automatically add your Robinhood portfolio to Mint",
"version": "1.3.0",
"version": "2.0.0",
"author": "George Walker",

"icons": {
Expand All @@ -14,7 +14,7 @@
},

"background": {
"scripts": ["js/analytics.js","js/background/event-listener.js","js/background/update-install-listener.js","js/background/browser-action.js"]
"scripts": ["js/background/event-listener.js","js/background/update-install-listener.js","js/background/browser-action.js"]
},

"browser_action": {
Expand Down Expand Up @@ -65,6 +65,5 @@
],
"web_accessible_resources": [
"images/*.png"
],
"content_security_policy": "script-src 'self' https://www.google-analytics.com https://www.googletagmanager.com; object-src 'self'"
]
}

0 comments on commit c98c0aa

Please sign in to comment.