Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ability to remove a JSON prefix if sent #22

Closed
wants to merge 3 commits into from

Conversation

arkarkark
Copy link

this is a fix for issue21 I filed a couple of days ago.

#21

function stripJsonPrefix(text) {
// Some implementations return a JSON_PREFIX to help avoid
// allowing your JSON replies to be turned into JSONP replies.
var JSON_PREFIXES = [")]}', ", ")]}',\n"];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other prefixes commonly used, like "for(;;);" and "while(1);" (this one by Google).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's great! that's why I made it an array for people to add more to. I hadn't heard of the ones you posted.
The ones I included were from AngularJS's notes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a box on the options for the extensions to enter custom prefixes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this pull request were accepted so I don't need to run my own version of JSONview... :-/

until that happens or anyone takes any interest in this pull request I'm not likely to dedicate any extra effort to it.

@AncientSwordRage
Copy link

In the mean time, could you explain/point to how to integrate this with a local version?

@arkarkark
Copy link
Author

@AncientSwordRage it seems to be taking forever for the chrome store to approve publishing my patched version of this extension. So you can do it locally.

check out my version into a directory on your machine:

git clone [email protected]:arkarkark/JSONView-for-Chrome.git

in chrome open tools->extensions turn on developer mode (top right) and then click the load unpacked extension choose the JSONView-for-Chrome directory

and you should be good to go.

make sure to turn off the installed version you already have.

@AncientSwordRage
Copy link

@arkarkark I'm getting Could not load manifest. when I try that, do I need to make what I cloned?

@arkarkark
Copy link
Author

then try the WebContent directory (which has a manifest.json file in it)

On Thu, Feb 26, 2015 at 2:03 AM, AncientSwordRage [email protected]
wrote:

@arkarkark https://github.com/arkarkark I'm getting Could not load
manifest. when I try that, do I need to make what I cloned?


Reply to this email directly or view it on GitHub
#22 (comment)
.

@AncientSwordRage
Copy link

@arkarkark yeah that works! 👍

@gildas-lormeau
Copy link
Owner

Thank you, I added an option called "Regular expression for removing JSON prefix". It will be available in the version 0.1.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants