Hacker Newsnew | past | comments | ask | show | jobs | submit | thrdbndndn's favoriteslogin

The browser does not know the path. Also, if the function (or one of its parents) is in a closure, there may not even be a path to the function from window.

If you're sure the function is reachable from window you can search for it recursively:

    (function () {
        function search(prefix, obj, fn, seen = null) {
            if (!seen) seen = new Set();

            // Prevent cycles.
            if (seen.has(obj)) return false;
            seen.add(obj);

            console.log('Looking in ' + prefix);

            for (let key of Object.keys(obj)) {
                let child = obj[key];

                if (child === null || child === undefined) { 
                } else if (child === fn) { 
                    console.log('Found it! ' + prefix + '.' + key); 
                    return prefix + '.' + key;
                } else if (typeof child === 'object') { 
                    // Search this child.
                    let res = search(prefix + '.' + key, child, fn, seen);
                    if (res) {
                        return res;
                    }
                }
            }

            return false;
        }

        // For example:
        let fn = function() { alert('hi'); }
        window.a = {};
        window.a.b = {};
        window.a.b.c = {};
        window.a.b.c.f = fn;
        return search('window', window, fn);
    })();

It is in tension with the revenue model that is explicitly about driving people offsite.

This is using my gameboy emulator, binjgb[0], on the website! (well one of my gameboy emulators, heh [1][2]) It's been used as the emulator for GB Studio for a little while now, but I don't know how often people embed it in their websites, so it's really cool to see.

[0] https://github.com/binji/binjgb [1] https://github.com/binji/pokegb [2] https://binji.github.io/raw-wasm/badgb/


Well, no-one else but you does.

The toothpaste is out of the tube - notifications are going to be scrutinized more in the future, from this point on.

I got the email. And about 20+ responses to that email.

Every person who replies to that issue triggers another 400k emails. Personally, my email client is crashing.

EpicGames, as a GitHub org is an outlier, it's basically an SSO for Unreal Engine. I forgot I was even a member of it.


Oddly, I'm the opposite. Working in devops and vscode, I find the visual aspect of color and logical formatting improves my work dramatically. Small tools like "bat" vs. "cat" on the terminal are great at quick data parsing for things like yaml, json, and the like. Staying old school for the sake of old school is a bit of a fallacy IMHO.

> I have a mailing list for people who use my code, when an update is out they can download the .php files, 'require' them and test them before deployment, but never will I do packages.

This offers no benefit in terms of security, over a package dependency locked at a specific version.

The end result is the same: the user ends up downloading the .php files, and testing them in deployment, but through composer instead of curl.

It doesn't contribute to security at all, it just makes it awkward for other people to use your code.

I would also assume that people are connecting your library to a package management system anyway, to overcome this unnecessary hurdle e.g. https://getcomposer.org/doc/05-repositories.md#loading-a-pac...


Cool article, but I'm not impressed by DropBox's upload speed on my Windows computer, at all.

I just tested rn with DropBox, GoogleDrive, and OneDrive, all with their native desktop apps. I simply put a 300MB file in the folder and let it sync.

    DB: 500 KiB/s
    GD: 3 MiB/s
    OD: 11 MiB/s (my max bandwidth with 100Mbps)

I don't know what causes the disparity here, but I have been annoyed by this for years, and it's the same across multiple computers I use at different locations.

Another funny thing is if you just use the webpage, both GD and DB can reach 100Mbps easily.

Edit: should mention Google's DriveFS can reach max speed too, but it's not available for my personal account (which uses the "Backup and sync for Google" app).


I think you are confused between My Book and My Cloud

* My Book: An external HDD that's attached to your computer through USB.

* My Cloud: A NAS that's connected to your network through Ethernet, support SMB, FTP, NFS.

There's also My Cloud Home, which is also a NAS, but you can only access your data through WD proprietary app, not SMB.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: