Page 1 of 1

External javascript file (+wifi site survey)

Posted: Fri Mar 15, 2013 11:23 pm
by BashfulBladder
So I'm working on another plugin
survey.png
survey.png (62.08 KiB) Viewed 4772 times
and I've come across an issue I can't seem to get past.

I want vendor lookup from MAC address. I have a small 5 line sample which provides the lookup for the last row. The full array winds up being a hefty 775kb array scraped from http://standards.ieee.org/develop/regauth/oui/oui.txt Since it can't go on the router, I though pull it in locally. Safari, Chrome & Firefox prevent that.

Can a Gargoyle webpage pull a javascript file from an external website & have a browser load it successfully?

Re: External javascript file (+wifi site survey)

Posted: Sat Mar 16, 2013 10:55 pm
by mtr
Wow, you're on fire with plugins! :D

Maybe you can check, before downloading oui.txt, if there is an external storage such a hard drive, thumbdrive, etc plugged and then save the oui.txt file there.
I think It's an option to save space on router filesystem and also keep a single copy of file.

My 2 cents.

Re: External javascript file (+wifi site survey)

Posted: Sun Mar 17, 2013 10:29 am
by BashfulBladder
FireVortex wrote:Wow, you're on fire with plugins! :D
yeah, I have needs. A "tech savvry neighbor" with all kinds of airs. And an inability to set passwords.

---------------------
I had been looking up things like JSONP & CORS....

The solution was already there - haserl can echo those variables from /tmp as the page loads for direct injection. Thanks Eric.

Code: Select all

<script>
<!--
<?
	cat /tmp/OUIs.js
?>
//-->
</script>
survey2.png
survey2.png (86.32 KiB) Viewed 4716 times
Vendor lookup in the 1st column bottom line in each row! Yes, its the little things in life...

Its not going to be transparent though. It will require the end user to either copy something to /tmp or maybe I can create a package that will install to /tmp.
-------------------------
In OpenWrt, /tmp is mapped to a tmpfs (temporary filesystem) that behaves like a ramdisk. Anything there doesn't survive a restart - it never gets onto the flash chip. I say this like I have no problem using RAM because I have 64MB of RAM on my router & the most strain I put on it is serving some webpages up.

Not every router is in the same boat, and it's not a perfect solution - but it is the one for me. I will also look into storing/installing onto a USB partition.