very much a newbie from a developer perespective but will do my best to explain.
Essentially my small startup offers a solution whereby you can embed some simple HTML/JS snippet onto a page and then style by inheriting/customising with your own brand css etc. That snippet calls our service to display 3rd party infortmation but the the advantage is it's embedded in the customers site.
In most cases we demo it to potential clients by pasting it into an existing page on their site using proxyman's map local tool to override. However with the rise in react based sites this approach isn't working as the code is handled in the app so it simply just overrides when we refresh the page.
I'm wondering if there is a workaround or a tool out there that would stop the react experience from overriding the snippet we are dropping in via proxyman?
Any help appreciated!
I've looked into a couple chrome extensions that supress react but that hasn't worked and there's no docs on proxyman that address it
Related
I set up Google Analytics tracking in meteor using the okgrow:analytics package. It works and I get the real time view of pages and events correctly. I want to run an A/B test to compare one of the features of my app. However, I ran into a few problems, mostly stemming from the fact that Meteor creates a SPA:
Google Analytics asks me to insert a script to track the experiment right after the opening head tag on the page I am trying to test. I can do that, but either I will have to put it on the head which is used among all the pages or inject dynamically which causes an error.
It seems that the Google Analytics script is not changing the page correctly. This is probably related to the fact that I can't insert the script into the head correctly, but I was thinking it might also be because it is a single page app and it seems like the script expects a more traditional website.
Also please note that I am using Flow Router.
I have searched without any luck. Does anyone know how to set this up correctly? Any suggestions or ideas would also be welcome.
Its been a few years since I have worked on Chrome apps. I started messing around with making some simple examples to learn the new process. The problem is that I have found that using an <a> tag to change the html page that is loaded to another html page inside the packaged app will not work. I'm looking for different methods of changing the screen with retrieving user input (button click, link click. and so on). I have looked online and have found very little documentation about making chrome apps most examples show how to make a simple "Hello World" and how to publish it. Not many extensive tutorials beyond that. Just to clarify this app would be a real chrome app not a link to some site. all files would be packaged with the chrome application.
Chrome Apps are meant to be "single page apps", and cannot navigate links by design. <a> links should open in a regular browser window instead.
If you want to do "url routing" within your application to change views, you can just roll your own solution, but should probably use a framework to help you out instead.
Here are some examples:
Polymer
Angular
Ember
Meteor
Backbone
The list is extensive. There are likely many other stack overflow answers that compare each framework.
The DOM (Document Object Model) which represents the contents of a Chrome App window is initiated from an HTML file, but from that point on you can't change it by referencing any other file, which is what you're expecting navigation to do. (<a> elements that navigate to an external browser via a "target=_blank" attribute are perfectly OK.)
However, you are free to change the DOM from your JavaScript at runtime. If you like, set an event handler on the <a> element and change the DOM as you wish. If you want to change the DOM via HTML (not from a file), you might find the JavaScript method insertAdjacentHTML useful. Actually, you can get the HTML from a file, but you have to read that file yourself with the Chrome App file I/O API.
Advice in another answer to use a framework is, in my opinion, overkill. If you think of a Windows app, a Mac app, or any other kind of GUI-based app, you would never assume that you could just change the UI over to something completely different by referencing an HTML file. Think of a Chrome App as being similar to those technologies in that sense, and you'll be on the right track.
I am trying to make a Google Chrome extension using content script.
My goal is to have a display at the top of the page (which is already working on my own pages) that can interact with the page.
I need things which are very complicated to put together in an extension, due to security policies :
Using require.js on the extension (that works for now, using this Github repo)
Using a templating engine to describe my display : I need to add a lot of content to the page and I don't think writing HTML in javascript would be a good workflow.
For my current version I use jade with my server, but this is not possible with an extension. I think I need to use something like Angular.js or Backbone.js, but I can't make them work on the content script.
I need a lot of communication between my extension and the page : For example I need to detect almost constantly mouse moves
I need communication with my server using socket.io
Every bit of functionality of my extension have been developed and tried in a standalone web page, but now I need to integrate it in a real extension and I am really stuck
So due to these requirements, I am wondering what would be the right approach for building this : putting it all in an iFrame (would the server-side communication work? And how to communicate with the page ?), or a way to make a templating engine work nicely in there, or a solution I didn't think of?
Try this:
Develop the HUD part as a standalone page that the content script will include in an iframe. You should be able to use Angular.js etc. with this, but you will need local copies of as much as possible and you'll need appropriate entries in the manifest.json to get it working in the extension. See/create other questions for the details.
Have your content script inject the code to monitor mouse-moves, etc. into the target page. Have this code digest and summarize the data, so it's not spamming the system. Maybe message the summaries to the HUD page and/or content script five or six times a second.
After that, it should just be a matter of getting the pieces working, one at a time. Break it down to specific problems and ask a question on one specific problem at a time (If you can't find the answers in previous questions).
I'm pretty sure what you appear to want is do-able, but the details are too broad for a single Stack Overflow question.
i have a sitation where i want to access HTML DOM object from within my application to update certain parts of web page through javascript commands at run time.
It is a local webpage opened in FireFox which would be accessed by my application, so that the final output is always shown at the webpage which is updated by appliation.
It would be great if you could give me some idea about how this can be accomplished.
I have similar requirement like the webmonkey extension of firefox but need to do it outside of browser from my application.
You can try QtWebKit from the Qt framework, it provides an OO set of classes to interact with webpages from basic actions to very complicated and advanced stuff. I believe you may find your answer there, a link is provided below...
Good Luck
see Here
From last 2 weeks I am searching for an answer but not getting a bit of success.
My scenario is, I am using Eclipse for developing Android apps. I want to display route directions (Driving, Walking, Bicycling) between two dynamically entered addresses on Google Maps... I want to make use of Google Maps JavaScript API V3 Services, because of all its awesome functionalities...
http://code.google.com/apis/maps/documentation/javascript/services.html#Directions
I was suggested by some developers on Stack Overflow and they gave this link http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why But this site has code that uses some JavaScripts in the code, if this site is having the correct stuff, where am I supposed to write JavaScript in my eclipse android app because AFAIK code written in eclipse uses only Java framework.. If that site is not a good bet give me some other links that demonstrates with examples...
I am not sure I follow you. On the link provided earlier on SO, I see the Java code:
http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why
That actually uses Android SDK support for Google Maps. If you still want to use the Javascript, you will have to go through WebView. I would otherwise recomment the way it is followed here:
http://code.google.com/intl/en/android/add-ons/google-apis/maps-overview.html
This page was linked to the previous link mentioned above and it uses Java not Javascript.
You do not need to worry about javascript. The MAP_URL (http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/simple-android-map.html) in WebMapActivity has this javascript in the page. So Either you can write your own html page with that javascript (hosted on your server) or you can simply load the MAP_URL into your webview without worrying about javascript.