Created
May 23, 2018 03:20
-
-
Save calraith/5ea698d022dfe77d3927e75af7cdea75 to your computer and use it in GitHub Desktop.
This is meant to be a PowerShell alternative to https://gist.github.com/derjanb/9f6c10168e63c3dc3cf0 for Windows users unable to compile the leveldb Python module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy your Tampermonkey storage.js into the same directory as this script. | |
# It'll extract the user scripts from storage.js and write them as .user.js files | |
# in the current working directory. | |
add-type -as System.Web.Extensions | |
$JSON = new-object Web.Script.Serialization.JavaScriptSerializer | |
$obj = $JSON.DeserializeObject((gc storage.js)) | |
foreach ($key in $obj.keys) { | |
foreach ($val in $obj[$key].value) { | |
if ($val -match "\r?\n//\s+@name\s+(.+)\r?\n") { | |
$val | out-file ("{0}.user.js" -f $matches[1]) | |
} | |
} | |
} |
@calraith Where is this so-called Tampermonkey storage.js file located? The one I found at %appdata%\Opera Software\Opera Stable\Extensions\dhdgffkkebhmkfjojejmpbldmpobfkfo\4.7.54_0\storage.js
is just 13 KB of JavaScript, not JSON. So I get the same error as @BangDroid and @Remonell.
@calraith Where is this so-called Tampermonkey storage.js file located? The one I found at
%appdata%\Opera Software\Opera Stable\Extensions\dhdgffkkebhmkfjojejmpbldmpobfkfo\4.7.54_0\storage.js
is just 13 KB of JavaScript, not JSON. So I get the same error as @BangDroid and @Remonell.
I guess this script did nothing. The actual scripts should be in User Data\Default\Local Extension Settings
and stored in db not some random storage.js.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TY so much!
I wish there was an upvote in github to let more users know about this!