You are here

Adobe Flash's Local Shared Object

15 posts / 0 new
Last post
infocop411
Offline
Last seen: 14 years 11 months ago
Joined: 2007-07-26 21:24
Adobe Flash's Local Shared Object

I made this script about a month ago, I had to tweak it to also run on vista more recently, for compatibility. I have had no problems from it.

I figure it may help with the firefox launcher or at least to come up with some ideas. it is a batch script not NSIS code.

it does not care about the current directory, it does need to be on the same USB drive though.

It backs up the host computer to a folder on the flash drive, "\PortableApps\FirefoxPortable\Data\Flash Cookies\Host Cookies"
then it deletes the host's directory, "%APPDATA%\Macromedia\Flash Player"
& copies your cookies, "\PortableApps\FirefoxPortable\Data\Flash Cookies\My Cookies"
then runs firefox portable
(firefoxportable.ini needs to be set to keep firefoxportable.exe open)
copys "%APPDATA%\Macromedia\Flash Player" to "\PortableApps\FirefoxPortable\Data\Flash Cookies\My Cookies" & restores the host cookies. deleting your cookies from the computer in the process

infocop411
Offline
Last seen: 14 years 11 months ago
Joined: 2007-07-26 21:24
the code

cd\

mkdir "\PortableApps\FirefoxPortable\Data\Flash Cookies\Host Cookies"

mkdir "\PortableApps\FirefoxPortable\Data\Flash Cookies\My Cookies"

xcopy /Y "%APPDATA%\Macromedia\Flash Player" "\PortableApps\FirefoxPortable\Data\Flash Cookies\Host Cookies"

rmdir /s /q "%APPDATA%\Macromedia\Flash Player"

mkdir "%APPDATA%\Macromedia\Flash Player"

xcopy /Y "\PortableApps\FirefoxPortable\Data\Flash Cookies\My Cookies" "%APPDATA%\Macromedia\Flash Player"

"\PortableApps\FirefoxPortable\FirefoxPortable.exe"
xcopy /Y "%APPDATA%\Macromedia\Flash Player" "\PortableApps\FirefoxPortable\Data\Flash Cookies\My Cookies"

rmdir /s /q "%APPDATA%\Macromedia\Flash Player"

mkdir "%APPDATA%\Macromedia\Flash Player"

xcopy /Y "\PortableApps\FirefoxPortable\Data\Flash Cookies\Host Cookies" "%APPDATA%\Macromedia\Flash Player"

rmdir /s /q "\PortableApps\FirefoxPortable\Data\Flash Cookies\Host Cookies"

Ph4n70m
Ph4n70m's picture
Offline
Last seen: 1 year 9 months ago
Joined: 2007-01-12 19:22
.

Good! I think it should be included in FirefoxPortable.exe launcher :]

Ph4n70m
Ph4n70m's picture
Offline
Last seen: 1 year 9 months ago
Joined: 2007-01-12 19:22
.

use xcopy /s to copy folders...
i have edited your code to make it more clean Smile

@echo off
set FlashCookiesDir=%~d0\PortableApps\FirefoxPortable\Data\FlashCookies
set HostCookiesBackup=%FlashCookiesDir%\HostCookies
set MyCookies=%FlashCookiesDir%\MyCookies
set FPAppData=%APPDATA%\Macromedia\Flash Player
set FFPDir=%~d0\PortableApps\FirefoxPortable
if not exist "%FlashCookiesDir%" md "%FlashCookiesDir%"
if not exist "%HostCookiesBackup%" md "%HostCookiesBackup%"
if not exist "%MyCookies%" md "%MyCookies%"
echo Backuping host flash cookies...
echo.
xcopy /S /Y "%FPAppData%" "%HostCookiesBackup%">nul
rd /S /Q "%FPAppData%"
md "%FPAppData%"
echo Copying your flash cookies to host folder...
echo.
xcopy /S /Y "%MyCookies%" "%FPAppData%">nul
echo Starting FirefoxPortable
echo DON'T close this window or host flash cookies WON'T be restored!
echo.
pushd "%FFPDir%"
start /wait FirefoxPortable.exe
popd
echo Copying your flash cookies back to data folder...
echo.
xcopy /S /Y "%FPAppData%" "%MyCookies%">nul
rd /S /Q "%FPAppData%"
md "%FPAppData%"
echo Restoring host cookies...
echo.
xcopy /S /Y "%HostCookiesBackup%" "%FPAppData%">nul
rd /S /Q "%HostCookiesBackup%"
echo Done!
echo This window will close automatically.
ping 127.0.0.1>nul

Jimbo
Offline
Last seen: 4 years 2 months ago
Joined: 2007-12-17 05:43
Danger Will Robinson!!!!!!

This definitely shouldn't go into the launcher, since it doesn't only affect Flash-as-part-of-FirefoxPortable.

While FFP is open with this script, it will affect ALL flash that runs on the PC. Including that in other browsers, or apps that use flash internally, etc.

While this may not be a problem often, it is certainly not how people would assume a portable app worked, and certainly not what many would want to be forced to happen.

John T. Haller
John T. Haller's picture
Online
Last seen: 46 min 7 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Issues

I've considered it before, but there are issues. The LSOs are used across all browsers on the system (FFP, local Firefox, Flock, IE, Opera, Safari, Chrome, etc). So if you swap in and out you alter the behavior of all other browsers while you are using Firefox Portable, which is not really desired behavior. And if a user is using FFP and, say, Chrome Portable or Opera Portable or Flock Portable when we begin supporting them, how is it handled then?

Sometimes, the impossible can become possible, if you're awesome!

NathanJ79
NathanJ79's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2007-07-31 15:07
...

Opt-in, set through a setting (change a false to a true) in a .INI, and the ability to do so mentioned in the release notes. The ability to do this is both useful and dangerous for reasons mentioned and should be treated as such, until Portable Firefox gains the ability to 'sign' this stuff so its flash cookies can be separated. At least I think that's the ideal solution.

infocop411
Offline
Last seen: 14 years 11 months ago
Joined: 2007-07-26 21:24
one idea

have only one location for all programs, use a separate launcher activated by each *portable.ini file & when the last program closes the launcher does the cleanup. the remaining problem is locally created lso & at the moment I can only think of IE & ff, ff won't normally run if the other one is running.
maybe there is a way to hook into each the launcher & see which program is making the lmo & only meddle with those made by a portable app.

(this is kinda out of my knowledge, but a guess none the less.)

infocop411
Offline
Last seen: 14 years 11 months ago
Joined: 2007-07-26 21:24
Thanks for the comments on this.

I did overlook the other browsers using the lso's, (may have ignored it even, due to not using IE when using my flash drive & lso's being set right back on proper exit.)
I did not think about desktop apps using it.

I avoided non default variables because of at least two reasons, the first being that one may not set & still delete the host's lso & two being I wanted people to see every detail going on, to understand what is going on.

I already knew there could be some reasons not to use this,
but I have not seen any problems over the past month, besides changing a command due to a change between vista & xp. Pandora saves all it's data in lso including the actual login so I will keep using this method until either a better method happens or this solution breaks, in my schools IT classroom the only mishap could be one of three commands breaks, the fix is to delete a lmo's created by someones Portable Firefox.

If there is a better way, I'd be willing to try in a heartbeat

infocop411
Offline
Last seen: 14 years 11 months ago
Joined: 2007-07-26 21:24
I guess there will be no true "Magic Solution"

I guess there will be no true "Magic Solution" unless Adobe Flash gets GPL'ed due to the number of websites using it now start boycotting it.

Bruce Pascoe
Offline
Last seen: 12 years 2 months ago
Joined: 2006-01-15 16:14
Not going to happen

I don't see Flash ever becoming GPL. I don't know if there's any royalties on the .swf format, though... if not, someone could always make a GPL'd replacement plugin, sort of like QuickTime Alternative.

LOGAN-Portable
LOGAN-Portable's picture
Offline
Last seen: 11 years 2 months ago
Developer
Joined: 2007-09-11 12:24
I myself have pondered about

I myself have pondered about this issue. As mentioned these SharedObjects are also shared along every browser. So any reliable solution would have to keep tabs on all possible browsers using this. Just copying some content from the host to your thumb drive is also undesirable. First it would be slow and it could have other unpredicted problems (ie. running out of space on thumb drive by host data.)

While there might be some sophisticated solution like checking timestamps and sites against the SharedObjects folder I doubt it would be solid enough to prevent anything from going wrong.

PS. the SWF format is royalty free and there are even free and OpenSource versions of swf compilers available from Adobe.

jkemp
Offline
Last seen: 12 years 8 months ago
Joined: 2007-11-26 16:50
about:config setting "extensions.objection.flashAppDir"

Does Firefox "about:config" value in "extensions.objection.flashAppDir" allow changing Adobe Flash's Local Shared Object directory to the USB drive?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
No

I just took a look at the source code for the Objection extension; the flashAppDir thing is just for it to know where to delete them from. Flash will still use the local location.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

jkemp
Offline
Last seen: 12 years 8 months ago
Joined: 2007-11-26 16:50
about:config setting "extensions.objection.flashAppDir"

Thanks for the reply. So I guess there is no easy way to move these files. Appreciate it.

James

Log in or register to post comments