TL;DR: let's render in 100ms or less, and also put the counter in the corner when in debugging mode.
- Open FF
- Install the universal search addon if you haven't already
- Enable the Browser Toolbox
- Open the browser toolbox
- Switch the debugger to the iframe context using this funky little menu button:
- Do this in the console:
window.app.searchUrl = 'https://your.server.com/?q=';
- The query term will be escaped and appended to the
searchUrl
Idea: basic principles front end development
The stuff that is evergreen: basic facts and techniques
The web moves fast. Decouple the fads from the basic principles that don't change.
This could be a short book that teaches you how to think.
- Event loop: implicit multi threading
- DOM as tree structure
What do we need?
- Scrape a page
- store the result in a relational DB
- also store the result in a full text index
- expose search API
- on search hit, return the full record & any score
How do we do this quickly / easily?
here's the content, newlines inserted by me.
- there is a lot of crap left in here, lot of html tags
- the entities are escaped, so anything here should be safe to display
"<div id="readability-page-1" class="page">
<article itemtype="http://schema.org/Article" itemscope="" data-article="3983182" id="article-3983182" class="clearfix full-article time_article metered ">
<header class="article-header">
<section class="tags ">
<a href="http://time.com/" class="brand-tag brand-time-tag">TIME</a>
I had this idea a couple years ago, but I think I've found a way to simplify the whole thing.
Email as web pages:
Fundamentally, email is just a message written by one person, intended for another.
Use RSS to see if a friend sent you a message (auth'd RSS access).
# development use only | |
Daemon 0 | |
LogFacility - | |
ListenHTTPS | |
Address 0.0.0.0 | |
Port 3443 | |
Cert "tmp/certificates/ssl.pem" | |
xHTTP 1 | |
AddHeader "X_FORWARDED_PROTO: https" |
I'm working on an addon which includes an iframe served over https. https is needed for WebChannel (chrome to content) communication to work. It's also going to be needed to find and avoid mixed-content warnings as we pull various bits of remote content into that frame.
Setting this all up is medium-unpleasant, as ops tasks go. I want to remember how I did it, so here are some quick notes:
Assuming you're using the built-in Apache2 install on OSX Yosemite, follow these guides:
- http://brianflove.com/2014/12/01/self-signed-ssl-certificate-on-mac-yosemite/
- http://brianflove.com/2014/12/02/enable-https-in-apache-on-mac-yosemite/
- I also used this nice compact example to firm up my SSL VirtualHost: http://stackoverflow.com/questions/19844235/virtual-host-with-ssl-support-on-os-x-mavericks
You can't just click to accept self-signed certs in iframes in FF; the idea is to prevent clickjacking. (See https://bugzil.la/792479 for more.) To work around this, make yourself a certificate authority in your Firefox a
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | |
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
// TODO: it would be nice to check size of places DB before starting (precondition?) | |
// TODO: do we need to listen for shutdown events to avoid corrupting the DB? | |
// or does PlacesUtils handle that for us? | |
const {classes: Cc, interfaces: Ci, utils: Cu} = Components; |
Just some snippets for now. I'll clean this up into an article later (maybe).