KRL: How to fire on all domains - krl

I have been working on a personal project for a few months. A large majority of my frustration stems from the fact that I am building my own extension from scratch. I am only half way done with the project, and I am nervous that getting the code to port to IE and Chrome won't be as easy as I hoped it would be.
I had initially wanted to use Kynetx for this project, however I was told that it wasn't possible to get your app to fire on all domains. In chatting with Mike Grace, he told me that it IS possible. Can someone explain how?

In the dispatch block you can set a domain of
.*
Which in a full ruleset looks like this
ruleset a60x554 {
meta {
name "all-domains-dispatch-test"
description <<
all-domains-dispatch-test
>>
author "Mike Grace"
logging on
}
dispatch {
domain ".*"
}
rule muahahaha {
select when pageview ".*"
{
notify(": )","All your domain belong to us!") with sticky = true;
}
}
}
I know this works with the Firefox and Chrome extensions but I have never tested it with an IE extension.
Action shots!

Related

google actions: reprompts not showing

I am trying to get the system to prompt if the user is silent or not entered any response. This is using actions sdk.
As per the documentation (https://developers.google.com/actions/assistant/reprompts), I set the conversation object in the json as:
"inDialogIntents": [
{
"name": "actions.intent.NO_INPUT"
}
]
Then, in the functions code I have the following:
app.intent('no_input', conv => {
conv.ask('Hello');
});
Yet there has been no response even after waiting for a few minutes. I even tried
app.intent(actions.intent.NO_INPUT, conv => {
conv.ask('Hello');
});
but the code has not been called. Can someone share what needs to be done to get this working? Thanks.
Here's a more detailed version of my comment:
First of all, smartphones DO NOT have no-input support, as they close the mic automatically when the user doesn't say anything and they also make it visually clear. So if you're testing on a smartphone, that's the reason you're not seeing your reprompts.
As for testing of the no-input prompts, it can be rather hard to test on a Google Home. Maybe you don't have access to one or you don't want to wait awkwardly staring at your device. For these reasons we have "No Input" button in the Simulator:
You can use this button to simulate a No Input prompt. If that still doesn't solve your problem, then you can assume there's something wrong with your code.

Ionic: Disqus embed loads locally, but not in production (or on an emulator)

I've built a simple Android app, as a companion piece to a publication website, with the Ionic framework, and (after much head-banging), I managed to get the Disqus threads on the app to sync with those on the site. After trying a few different methods, I ended up going with this directive from Michael Bromley to implement the Disqus widget in the app, which is hiding behind a "Comments" button at the bottom of each article on the app's UI.
Running with Ionic Serve, everything works brilliantly. Outside of the local server: not so much. I don't get an error message from Disqus – it simply doesn't load the iframe at all. I'm refraining from posting code, because I'm wondering if this is simply a CORS issue, or maybe something simple that I'm overlooking.
One thing that might be of importance: I don't have the Crosswalk plugin installed on the app – I'm not sure if my thinking is correct, here, but could it be possible that Disqus is compatible with Chrome, which is why it runs fine when I'm testing it on my browser, but isn't compatible with Android's default browser? I'm not extremely well-read on Crosswalk, but I believe it tells the app to use a specific browser – if so, could installing it fix the problem? I'd go ahead and install it, and see if it helps, but I'd like to avoid tampering too much with an otherwise-working app if the issue is something completely unrelated to the plugins.
One weird caveat: The Disqus comments loaded on one article just fine when I tested the app on Genymotion. I deleted that article, and created a new Test article on my site (thus firing up a new Disqus thread), and that failed to render on Genymotion. It seems very... random, I guess, that it would work once. It would seem that it would either work all the time, or never work.
EDIT: While running on Genymotion, no errors appear in the console when debugging the app with WebView. The fact that I'm not getting a "Refused to load" error makes me think that Disqus is getting called and, for whatever reason, is refusing to answer the phone at all.
I can spend hours trying to figure something out, and then... well, as soon as I post a question, I end up figuring out the answer five minutes later.
I dug looked into the code for the directive I was using (which I highly recommend for anybody looking to easily implement Disqus into any AngularJS project), and I noticed that was calling for embed.js with the following string:
....
if (!$window.DISQUS) {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + scope.config.disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
} else {
....
Amending dsq.src = '//' + scope.config.disqus_shortname + '.disqus.com/embed.js';to add a protocol, making it dsq.src = 'http://' + scope.config.disqus_shortname + '.disqus.com/embed.js';fixed the issue on Genymotion. I'll ship the updated APK to the Play Store, and comment on this answer to confirm whether or not it holds up there, as well.

GWT activities and places. External link always start default place

I have lost all the morning searching for this problem on internet and nobody seems to face this problem.
My GWT application navigate very well. But as a logic requirement on my application it generates an email with a link to my application. The link is something like this:
http://server#place:token
Well, it navigate always to the same DefaultPlace i declare on initialization.
I have write a lot of logs in the client side. And it ignores completely the request. Even if i type this url in the browser, it loads default place.
My application navigates very well between places internally but now i realize that it happens not only with one particular place, but any place.
Could some one help me to realize what would be the problem. I could write the code if any want to see.
This is my PlacehistoryMapper:
#WithTokenizers({DefaultPlace.Tokenizer.class,
AuthenticationPlace.Tokenizer.class,
ProcessSnCallbackPlace.Tokenizer.class,
GatherUserInfoPlace.Tokenizer.class,
LoadProfilePlace.Tokenizer.class,
RegisterPlace.Tokenizer.class})
public interface AppPlacesHistoryMapper extends PlaceHistoryMapper
}
This is my ActivityMapper in getActivity override:
#Override
public Activity getActivity(Place place) {
Provider provider = getProvider(place);
if (provider == null) {
browserUtils.log("Error: " + place.getClass().getCanonicalName() + " Place is not mapped.");
return null;
}
return (Activity) provider.get();
}
And all activities all injected by GIN and works fine. But always when debug the default place is the only i see in those line. However if i change the place by goTo it works fine.
Thanks in advance.
Cheers
Albert.

window.CavalryLogger error in Facebook App running in Facebook Page Tab

I have applications which are displayed as tabs in Facebook pages which have been working fine. They suddenly started displaying this output in the tab:
/1336720089,176820405/
if (window.CavalryLogger) { CavalryLogger.start_js(["EgxV3"]); }
__d("UFIUpdate",
Any ideas what is going on???
Here is a link to one of them: http://www.facebook.com/TweakShoes/app_132692060112327
A temporary solution is to add https:// to facebook itself. This doesn't solve the problem, but it'll allow you to see your page on a per client basis.
The best fix in the longer term until facebook fixes this issue is to go to your account settings > Security > Enable secure browsing. This will enforce HTTPS wherever it can and should resolve the issue for a lot of pages you're trying to access.
Good Luck!
After encountering this issue yesterday, I tracked it down to an apparent conflict with the JS log wrapper included as part of HTML5 Boilerplate's script.js file. In particular, the "make it safe to use console.log always" snippet. After commenting it out, the FB lib error went away and my app displayed properly.
I didn't dig into what the conflict was, but here is the snippet. If you use something similar on your page, then it may be worth investigating.
/* make it safe to use console.log always */
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
{console.log();return window.console;}catch(err){return window.console={};}})());
It's probably not a coincidence that FB's own logger bugs out with this.
Facebook has opened a bug for this issue and recently triaged it to medium priority - no word on when it will be addressed.

Implementing multiple views via GWT-platform?

I'm implementing a web application which will support different views according to different browsers. For example, In mobile browsers, it will show a smaller view to users with less UI elements. But we'd like to use same presenters.
I have a solution on hand - adding browser type detecting logic in ClientModule, e.g:
if (browser == "iphone") {
bindPresenter(HomePresenter.class, HomePresenter.MyView.class, HomeView.class, HomePresenter.MyProxy.class);
} else if (browser == "ipad") {
bindPresenter(HomePresenter.class, HomePresenter.MyView.class, IPadHomeView.class, HomePresenter.MyProxy.class);
} else {
bindPresenter(HomePresenter.class, HomePresenter.MyView.class, IPhoneHomeView.class, HomePresenter.MyProxy.class);
}
I'm wondering if it is possible to use some ways like deferred binding in GWT-platform. (but I'd like to follow GWT-plarform's structure rather than adding deferred binding code in xxx.gwt.xml).
So my questions are:
1) Are there any other ways to implement the feature mentioned above?
2) Which way is the best, and why?
Thanks in advance!
Best regards,
Jiakuan W
There is an example in the gwt samples folder that does something like you are wanting. I use a version of the sample code in my project -except using Gin to handle the clientfactory functionality. The sample is called mobilewebapp. It involves using a formfactor method in your .gwt.xml to determine which system you are on - in this case it breaks it down into desktop, mobile, and tablet. Then later in your gwt.xml it trades out client factories based on the form factor - I trade out gin models instead. Here is a link to the source for mobilwebapp
GWT does not allow you to set custom user agent types. You're limited to their set of gecko, gecko1_7, safari, IE6, IE7, IE8, and opera.
That being said, you can access the user agent directly and set your logic to switch accordingly with Window.Navigator.getUserAgent(), or via a property provider.
See this similar question on how to do mobile browser detection in GWT for MVP.
Check the gwtp google group, its a good source, and someone posted a pdf about his efforts regarding the sake problem in there.
Anyway, if I recall correctly, he holds multiple gin modules for each client with the presenters and views, runs custom js code on loading and than installs the correct module on the the ginClinet class.