View USAGE.md

register

sfApi = sfExtAPI()

// register

sfApi.register(250, 250)
View sf-register-viewability-beacon.js
/**
* register viewability beacon
*
* @param {number} adWidth - ad width
* @param {number} adHeight - ad height
* @param {string} vimpUrl - beacon url to be sent when ad is shown
* @param {object} options
* @param {number} [options.percent = 50] - in view percent
* @param {number} [options.duration = 1000] - in view duration
* @throws {Error} throws error if `SafeFrame` is not supported
View cloudSettings
{"lastUpload":"2017-12-27T02:59:51.226Z","extensionVersion":"v2.8.7"}
View response.json
{
"type": "ads",
"code": 0,
"placements": [
{
"definition": {
"placement_id": "310278599393096_320154578405498",
"type": "native",
"refresh": "0",
"refresh_threshold": "-1",
View iframe_contents.html
<script>
window.addEventListener('message', function(event) {
console.log('iframe: Got postmessage in origin ' + location.origin + ' from origin: ' + event.origin + '(' + event.data + ')');
});
window.addEventListener('dispatchToIframe', function() {
console.log('iframe: Got dispatchEvent() in origin ' + location.origin + '(from index.html)');
});
setTimeout(function() {
window.dispatchEvent(new CustomEvent('dispatchFromIframe'));
View load-script.js
function loadScript (src, cb) {
var userAgent = navigator.userAgent.toLowerCase()
var isIE = (userAgent.indexOf('msie') !== -1) ? parseInt(userAgent.split('msie')[1], 10) : false
var doc = document
var tag = 'script'
var el = doc.createElement(tag)
el.done = false
el.async = true
el.charset = 'utf-8'
View assertions-compareScreenshot.js
// assertions/compareScreenshot.js
var resemble = require('resemble'),
fs = require('fs');
exports.assertion = function(filename, expected) {
var screenshotPath = 'test/screenshots/',
baselinePath = screenshotPath + 'baseline/' + filename,
resultPath = screenshotPath + 'results/' + filename,
diffPath = screenshotPath + 'diffs/' + filename;
View jquery.postmessage.js
/*!
* jQuery postMessage - v1.0 - 8/26/2011
*
* Copyright (c) 2011 "zachleat" Zach Leatherman
* Copyright (c) 2009 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://jquery.org/license
*/
/* Forked from http://benalman.com/projects/jquery-postmessage-plugin/
View querySelector.polyfill.js
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
View keybase.md

Keybase proof

I hereby claim:

  • I am kyungw00k on github.
  • I am kyungw00k (https://keybase.io/kyungw00k) on keybase.
  • I have a public key whose fingerprint is 321D 20A2 E832 8F37 CF07 2018 199E 8C68 1ACC 7483

To claim this, I am signing this object: