LOGIN
Harsha Alva
92
Community Expert
Mechanical Engineer + Software Developer
 · MangaluruIndia
Share
Report
Get Link
STATUS

Facebook Service Worker

Very complex piece of code.

__DEV__ = 0;
self.__swData = {};
self.__swData["SiteData"] = {
    "revision": 3148273,
    "log_errors": false,
    "fbRevHeader": "x-fb-rev",
    "fbDynRevHeader": "x-fb-dyn-rev",
    "disableSWHeader": "x-service-worker-disable",
    "current_user": 100000080979912,
    "expire_time": 1499994000000
};
self.__swData["ConsolidatedHeader"] = {
    "key_names": {
        "SW_SVN": "r",
        "SW_BACKGROUND_WORK": "b",
        "SW_PARTIAL_CACHE": "p",
        "SW_SR_PINNING": "k",
        "CLIENT_CHROME_DYNAMIC_METADATA": "m",
        "SW_SR_PINNING_DYN": "d",
        "SW_ROUTES": "o"
    },
    "header_name": "x-service-worker-consolidated-request"
};
self.__swData["CacheResponseTypes"] = {
    "response_types": {
        "FULL": 1,
        "CACHE": 2,
        "DYNAMIC": 3,
        "EF_ONLY": 4,
        "NO_CACHE": 5
    },
    "response_header": "x-service-worker-response-type"
};
self.__swData["SWRoutes"] = {
    "routeVersions": "h2",
    "routes": {
        "HomePage": {
            "name": "HomePage",
            "regex": "^(\\\/|\\\/home.php)?$",
            "version": 2,
            "cache_path": "home.php",
            "whitelisted_params": []
        }
    },
    "globalLists": {
        "blacklist": ["quickling", "ajaxpipe"],
        "whitelist": ["ref", "__mref", "sw_fnr_id", "artillery_sample", "spin_reset"]
    },
    "bypassParams": ["hash", "sig", "_fb_curl_hash", "_fb_batch_sig", "_nc_hash"]
};
self.__swData["GenericNotificationData"] = {
    "enabled": true,
    "appid": 612424062191227,
    "title": "Facebook",
    "message": "You have new notifications.",
    "pic": "https:\/\/static.xx.fbcdn.net\/rsrc.php\/v3\/yD\/r\/ebqgd193qnV.png",
    "uri": "\/notifications",
    "dir": "ltr",
    "use_notif_id_as_tag": true
};
self.__swData["PreloadData"] = {
    "enabled": true
};
importScripts("https:\/\/static.xx.fbcdn.net\/rsrc.php\/v3\/yV\/r\/ICJyN6v8Pl1.js");
Javascript
Contributions
Harsha Alva

For tracking down the FB Service Worker script!

2 likes 
Like
Award Contribution
Robert Lancer
53
Community Expert
Chief Technology Officer at Collaborizm (Project Leader)
 · New YorkU.S.
Share
Report
Get Link

Wow, that’s significantly longer than the Collaborizm Service Worker script.

Like
1 like 
Award Contribution
Robert Lancer
53
Community Expert
Chief Technology Officer at Collaborizm (Project Leader)
 · New YorkU.S.
Share
Report
Get Link

Edited the post to be shorter

Like
1 like 
Award Contribution
Areous Ahmadtj
43
Community Expert
student
 · JosNigeria
Share
Report
Get Link

cool work

Like
0 like 
Award Contribution
Leave a reply...
DISCOVER
CHAT
HIRE
ACTIVITY
FEED
New Post
Help
Start Project
Online Users
Share Link
Write something before you submit it!
Photo updated
Request Sent!
Updated
Copied to Clipboard