TipOff

Made by jdoresky

Found in Conversational Service

Provide users with passwords hints they used to create a password for the log in for a specific sight.

0
#app.rb
DB = Sequel.sqlite # memory database, requires sqlite3

DB.create_table :items do
  primary_key :id
  String :name
  Float :price
end

#this is the database that needs to populated
items = DB[:items] # Create a dataset

# Populate the table
items.insert(:name => 'URL')
items.insert(:name => 'sign in requirements')

# Print out the number of records
puts "Item count: #{items.count}"

# Print out the database
puts "{items.list(:name)}"
  end

  return message

end
Click to Expand
0
#manifest.json
{
  "manifest_version": 2,

  "name": "TipOff",
  "description": "Password recall widget",
  "version": "1.0",

  "browser_action": {
   "default_icon": "TipOffIcon.png",
   "default_popup": "popup.html"
  },
  "permissions": [
   "activeTab", "http://*.herokuapp.com/", "https://*.herokuapp.com/"
   ]
}
Click to Expand
0
#gemfile
source 'https://rubygems.org'

gem 'sinatra'
gem 'sinatra-contrib'
gem 'dotenv'
gem 'password_strength'
Click to Expand
0
document.addEventListener('DOMContentLoaded', function() {

#popup.js
  var submitPageButton = document.getElementById('submitUrl');
  submitPageButton.addEventListener('click', function() {

    chrome.tabs.getSelected(null, function(tab) {
      d = document;
      var xhr = new XMLHttpRequest();
      xhr.open("GET", "https://tipoffapp.herokuapp.com/submit?url=" + tab.url, true);
      xhr.onreadystatechange = function(){
        if( xhr.readyState == 4 ){
          document.getElementById("passwordHelp").innerHTML = "Website logged";
          document.getElementById("addUrlIfUnRegistered").style.display = 'block';
        }
      }
      xhr.send();

    });
  }, false);
Click to Expand
0
#popup.html
<kuk!doctype html>
<html style="min-width:400px">
  <head>
    <title>TipOff</title>
    <script src="popup.js"></script>
  </head>
  <body>
    <h1>TipOff</h1>
    <button id="checkPage">Request Password Help</button>
    <div id="passwordHelp">
    </div>
    <div id="addUrlIfUnRegistered" style="display:none">
      <input type="text" name="unregisteredUrl">
      <button id="submitUrl">Go</button>
    </div>
  </body>
</html>
Click to Expand
0
#rakefile
require './app'
require 'sinatra/activerecord/rake'
Click to Expand
0
 blank
sqlite3.dll

1690.500 KB · Download / View

x
Share this Project

Courses

49714 Programming for Online Prototypes

· 15 members

A hands on introduction to building online products and services through code


About

Provide users with passwords hints they used to create a password for the log in for a specific sight.

Created

October 18th, 2017