• Stars
    star
    108
  • Rank 321,259 (Top 7 %)
  • Language
    JavaScript
  • Created over 13 years ago
  • Updated about 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Javascript/Website Performance Enhancement
jiagra: Javascript/Website Performance Enhancement

by Samy Kamkar, [email protected]
06/15/2011, http://samy.pl/jiagra

jiagra is a stand-alone javascript API for automatic website
performance enhancement.

Currently features:
  - tracking timers/intervals to see if they've been fired or not
      window.checkTimeout(timeoutID)
      // returns 'active', 'fired', 'firedActive', 'cleared' or 'firedCleared'
      // active has never fired (interval or timeout)
      // cleared has never fired and been cleared (interval or timeout)
      // fired is a timeout that has fired
      // firedActive is an interval that has fired and still active
      // firedCleared is an interval that has fired and cleared

  - get a list (array) of timers that are either active, cleared or fired
      window.activeTimeouts()  // active or firedActive
      window.clearedTimeouts() // cleared or firedCleared
      window.firedTimeouts()   // fired, firedActive or firedCleared

  - clearInterval/clearTimeout now returns 'true' if cleared,
      'false' if already cleared/fired, or undefined if no such timer
      Note that a timeout that is already 'fired' won't adjust to 'cleared'

  - document.currentScript polyfill + improvements over browser implementations
      Returns the script object which document.currentScript is getting called from.
      Unlike Opera/FF's built-in implementation, it will even work in callbacks and event handlers.
      It will also work on browsers which don't have a native implementation such as IE/Chrome/FF3.

  - prerendering/prefetching polyfill (pre-caching) for all browsers
    even if your browser doesn't support either.

  - John Resig's "degrading script tags", http://ejohn.org/blog/degrading-script-tags/
    which now applies to ALL script tags on a page!
      // can be globally enabled/disabled, and individually enabled/disabled
      <script src="path/to/script.js">
          code() // this gets executed after script.js loads
      </script>
      <script src="path/to/script.js" data-degrade="true">
          code() // this will run even if degradeEnabled is turned off
      </script>
      <script src="path/to/script.js" data-degrade="false">
          code() // this will NOT run
      </script>


Currently, it contains a pseudo-polyfill for pre-rendering/pre-fetching,
improved document.currentScript polyfill for determining the script
tag that's being executed, advanced timeout/interval functions and
degrading script tags,

Timeout/interval functions: these functions allow advanced
setting, monitoring, clearing and checking of timeouts/intervals,
even if executed from other scripts you don't control.

Pre-rendering/pre-fetching: This allows the page to load/cache
files you expect the user to be accessing, such as the next link.
Using actual browser prerendering is only supported in a handful
of bleeding-edge browsers, however this polyfill should work in
any browser! This allows pages to be pre-cached by the browser and
ready to load as soon as the user clicks, specifically determined
by the website maintainer (or smarty-pants code that figures out
which pages are accessed most).


INSTALLATION:

Simply add the script to your page like so:
<script src="jiagra.js"></script>

Then add pre-render/pre-fetch links to any URLs you want ready ASAP:
<link rel="prerender" href="http://example.org/index.html">
or
<link rel="prefetch"  href="/images/big.jpeg">

That's it!


Read more about Chrome Prerendering:
http://code.google.com/chrome/whitepapers/prerender.html

Read more about Firefox Prefetching:
https://developer.mozilla.org/en/Link_prefetching_FAQ

More Repositories

1

poisontap

Exploits locked/password protected computers over USB, drops persistent WebSocket-based backdoor, exposes internal router, and siphons cookies using Raspberry Pi Zero & Node.js.
JavaScript
6,195
star
2

evercookie

Produces persistent, respawning "super" cookies in a browser, abusing over a dozen techniques. Its goal is to identify users after they've removed standard cookies and other privacy data such as Flash cookies (LSOs), HTML5 storage, SilverLight storage, and others.
JavaScript
4,320
star
3

magspoof

A portable device that can spoof/emulate any magnetic stripe, credit card or hotel card "wirelessly", even on standard magstripe (non-NFC/RFID) readers. It can disable Chip&PIN and predict AMEX card numbers with 100% accuracy.
C
3,888
star
4

pwnat

The only tool/technique to punch holes through firewalls/NATs where multiple clients & server can be behind separate NATs without any 3rd party involvement. Pwnat is a newly developed technique, exploiting a property of NAT translation tables, with no 3rd party, port forwarding, DMZ, DNS, router admin requirements, STUN/TURN/UPnP/ICE, or spoofing.
C
2,846
star
5

slipstream

NAT Slipstreaming allows an attacker to remotely access any TCP/UDP services bound to a victim machine, bypassing the victim’s NAT/firewall, just by anyone on the victim's network visiting a website
Perl
1,887
star
6

skyjack

A drone engineered to autonomously seek out, hack, and wirelessly take full control over any other Parrot or 3DR drones within wireless or flying distance, creating an army of zombie drones under your control.
JavaScript
1,636
star
7

usbdriveby

USBdriveby exploits the trust of USB devices by emulating an HID keyboard and mouse, installing a cross-platform firewall-evading backdoor, and rerouting DNS within seconds of plugging it in.
Arduino
1,230
star
8

keysweeper

KeySweeper is a stealthy Arduino-based device, camouflaged as a functioning USB wall charger, that wirelessly and passively sniffs, decrypts, logs and reports back (over GSM) all keystrokes from any Microsoft wireless keyboard in the vicinity.
Eagle
1,084
star
9

opensesame

OpenSesame attacks wireless garages and can open most fixed-code garages and gates in seconds using a Mattel toy
C
833
star
10

samytools

Simple tools to make reverse engineering and console cowboying easier, primarily by data translation and manipulation + file handle piping. Mostly *nix tools with an emphasis on macOS.
Perl
555
star
11

webscan

Browser-based network scanner & local-IP detection
JavaScript
418
star
12

proxygambit

Anonymize and fracture network traffic/Internet access over a point-to-point wireless link or through TCP->GSM->wifi tunnel (advanced resurrection of ProxyHam)
Arduino
352
star
13

combobreaker

Motorized, portable, 3D printed, Arduino-based combination lock cracker
C++
231
star
14

dingdong

Digital Ding Dong Ditch -- RTL-SDR + Arduino + GSM/SMS/FONA + RF + GQRX to hack a wireless doorbell from a text message
C++
229
star
15

quickjack

Quickjack is a point-and-click tool for intuitively producing advanced clickjacking and frame slicing attacks.
JavaScript
227
star
16

frisky

Instruments to assist in binary application reversing and augmentation, geared towards walled gardens like iOS and macOS
C++
198
star
17

glitchsink

Voltage glitcher to bypass instructions/bootloader protections *without* target modification
C++
115
star
18

easel-driver

Easel driver for Linux, Mac, Windows, ARM, Raspberry Pi, Intel, FTDI, CH340, CH341, CP210x, FTDI clones, local, and remote access to GRBL-based CNC controllers
Shell
93
star
19

myo-osc

OSC bridge for the Thalmic Myo gesture control armband (cross-platform)
C++
80
star
20

BPL

The Blind Public License is a restrictive license that does not allow any person to read, view, interpret, emulate, debug, disassemble, reverse engineer, or execute ("Observing") any included code, schematics or engineering diagrams (the "Technology").
56
star
21

samyk

54
star
22

sqlpp

feature-rich, multi-database interfacing, multi-connection, colorful console-based SQL client
Perl
53
star
23

bgrid

wireless balloon LED network w/ATtiny24 + nRF24L01+ (PCB + firmware + TouchDesigner)
C++
46
star
24

buspirate

Bus Pirate (cross-platform, cleaned up for OS X)
C
42
star
25

crak

Crash Royale Attack Kit
JavaScript
39
star
26

openrTMS

Open rTMS (Transcranial Magnetic Stimulation)
C++
26
star
27

amazonshelper

TamperMonkey script (browser extension) for Amazon to add price by volume for materials and to hide useless UI elements
JavaScript
24
star
28

lcventilator

Low cost ventilator based on Dr. Jeffrey Ebin's design
C++
21
star
29

specs

Public specifications for easy accessibility
19
star
30

pinning

#PINNING is a browser extension (currently TamperMonkey script) to improve Pinterest's desktop browsing UX
JavaScript
15
star
31

glitchisnk

Voltage glitcher to bypass instructions/bootloader protections without target modification
14
star
32

microscopy

files for (ΞΌ)scope projects
11
star
33

motoaudio

Inspecting the Moto Audio application running on Motorola Android devices
9
star
34

testimg

chrome blocks downloading images from my github :(
9
star
35

openraman

Low cost, high performance open source Raman spectrometer
C++
6
star
36

mains-logs

log files for mains project
2
star
37

mains

monitoring mains line voltage
Perl
1
star