How to fix pointer event issue in Chrome 55+ without upgrade to newer version - google-chrome

We are using UI5 library version 1.36.12 in our Web app but due to chrome update some controls like IconTabBar, MulticomboBox are not working properly due to pointer events not disabled by default in the latest versions of Chrome.
One solution to this problem is to upgrade to version 1.38.14 but we are running in a tight schedule and we have to make many changes if we update the library.
One solution I tried is adding the fix in sap.ui.core.js file in current library jar files. But it is still not working. Should I have to rebuild sap.ui.core.js file and if yes how should I do that?
Please don't suggest to manually deactivate functionality in chrome through chrome://flags/#enable-pointer-events as client is not approving for that. Please suggest me a way to solve this issue without upgrading the library.

In the current UI5 version you can load your own Device object beforehand and UI5 will use it. I assume that this works in your version as well.
UPDATE: My proposal to reset the value later cannot work as it is used in the bootstrap mechanism. Therefore I removed this. Then the last resort is to use the approach mentioned by codeworrior on GitHub:
Before you bootstrap UI5 add a script tag and do the following:
if (/chrome/i.test(navigator.userAgent)) {
delete window.PointerEvent;
}
In this case pointer support is set to false.

Related

Error: The submission can only contain one appx or one appxbundle

I have already published an app with the Version 1.1.0.0.
When I'm trying to update the app with a new .appx file after creating the AppPackage I'm getting this kind of an error.
It's a Universal app where i've published the first versions of the Windows Store & Windows Phone. Now i'm trying to update the Win Phone app where i'm facing the issue. I can't even see the replace button near the Delete option.
Whenever i try to upload the new appx or the bundle file, it's not letting me to submit.
Any help would be appreciated.
Looks like a Firefox problem - use IE and this seems to work (at least has for mine!)
Try IE, Firefox doesn't show 'replace' option. Add new option is not for update. If you use replace then you will be able to update.

NPAPI mozilla plugin loading issue

I have successfully compiled and created npapi dll in MS based on mozilla npruntime project. Reference from: https://developer.mozilla.org/en-US/docs/Compiling_The_npruntime_Sample_Plugin_in_Visual_Studio.
Starting mozilla and open about:plugins shows the plugin. But when I open "test.html" the plugin does'nt come up.
I have tested the dll by making a separate test app, where i can access the entry point functions through
NP_INIT l_pInit= (NP_INIT)GetProcAddress(hModule, "NP_Initialize");
and i am able to step into my plugin dll function.
But with mozilla it doesn't work. Please suggest.
You can debug directly the mozilla process. Just attach to the process. However, modern browsers uses separate process for loading the third party plugins, so you will have to attach to that process. Than you can set breakpoints to loading routine (NP_GetEntryPoints, NP_Initialize) and see what is happening in there.
Also, if you have trouble with attaching to the process, you can simply show debug dialogs from your code and narrow the problem area.
UPDATE 1:
It seems like the browser does nto know that it should use the plugin. Did you specify the MIME type of hwat your plugin is for? If so, run the following script in an HTML page:
<embed type="application/x-my-extension" id="pluginId">
<script>
var plugin = document.getElementById("pluginId");
var result = plugin.myPluginMethod(); // call a method in your plugin
console.log("my plugin returned: " + result);
</script>
x-my-extensionreplace with your extension which you used in NP_GetMimeDescription. You shoudl check in about:plugins if the browser registered your plugin correctly for correct MIME type.
Sounds like there is most likely something wrong in your plugin initialization; you might try using FireBreath to create a npapi plugin, as it will be a lot less work and work on IE as well. If you don't like that idea, you could look at other npapi plugins (including FireBreath) to make sure you're doing things correctly. Add logging (of whichever type you like) to the main entrypoints and see which point it fails at.
Another trick is to go to about:config and find the plugins ipc settings and disable them; then you can attach to the main firefox process and it should hit your breakpoints if they are being called.
See the FireBreath Debugging Plugins page for other ideas.
Thanks guyz. Finally i am able to load and access the functionality of my plugin in the browser. Following are the findings:-
1. Even though my plugin's MIME type in resource file was 'application/mozilla-npruntime-scriptable-plugin'. But i need to access it from javascript embed element through 'application/x-npruntime-scriptable-plugin'. After this step the debugger started breaking on my plugin's break points.
2. The check of size of NPPluginFuncs and NPNetscapeFuncs was failing, may be because of different version of NPAPI implemented in my firefox.
At the end i got startup and thank you all for your support.

How to disable Google Chrome source compression "?body=1"?

I'm trying to debug some JavaScript for a Rails project and its incredibly frustrating to go line by line when the source code is compressed in the Sources developer tab.
I know this compression is done by Chrome through the body variable. What I want to know is if there is any way to stop Chrome from compressing files in source view, i.e:
\application.js?body=1 --> \application.js
Thank you for your time.
Compression is being done by Rails. Disable it in your configuration:
# config/production.rb (or whatever environment you're in)
config.assets.compress = false
You might want to investigate a new feature in Chrome called Source Maps.
Source Maps allows Chrome to map the compressed source code it receives to the uncompressed original, which in turn means that you can debug the code, even though it's been compressed.
This feature should help you get around this kind of problem without having to change the compression settings on your server.
You can read more about it here: http://blog.mascaraengine.com/news/2012/4/16/sourcemap-support-in-chrome-greatly-improves-debugging.html
I believe this feature is still in test and not yet in the final release version of Chrome. I'm sure it will arrive in due course, but for the time being you may need to install the "Canary" version of Chrome, ie the pre-release version that includes all the forthcoming features that they're still working on.

NPAPI load third-party DLL

I am developing an NPAPI Firefox plugin and I have a question.
I need to load a third-party DLL (such as D:\mydll.dll), but on some computers mydll.dll is not in the system path or in c:\windows\system32 and I get loading errors.
Here is the code:
SetCurrentDirectory ("d:\");
m_hModule = LoadLibrary ("mydll.dll");
LoadLibrary returns 126. I checked with DEPENDS.EXE to view the dependent modules and everything looks fine. I do not know what the problem is.
Another problem is that I want the plug-in to work in Safari (my safari is version 5.17). I copy it into Safari's Plugins directory and it tells me it cannot find the plug-in. I want to know how to solve this.
Thank you, and please excuse my poor English.
Setting the current directory will not always work when in a plugin because you don't own the process. The command that you want is SetDllDirectory.
SetDllDirectory("D:\");
m_hModule = LoadLibrary("mydll.dll");
Of course, I don't recommend that you ever assume a DLL is in the root of the drive =] What I would do is put the DLL you need in the same directory as the plugin DLL and then you can get the path of the DLL using GetModuleFilename.
For installing, rather than putting the plugin in the plugins/ directory in the firefox (or safari) directory you should install it through the windows registry. This will make it visible for firefox, chrome, and safari.
You may want to consider using FireBreath instead of implementing the NPAPI interfaces yourself; it takes care of most of the tricky parts and leaves you free to focus on the important parts of your plugin.

Older build version detection

I'm working on a social game (actionscript) whenever I upload a build seems like for some users the new build isn't downloaded instead the older version (cached) is served to them. How can I detect the user is on an older version and perhaps throw a popup at them?
I think it is more about your web server configuration. Cache related headers to be more precise. But we at some point decided to solve this issue by publishing application####.swf upon each deployment, where #### is a build number. And updated the HTML wrapper accordingly.
A little trick you can use is to append some FlashVars to the end of the embed code, e.g.
<embed src="file.swf?version=1.01" .. />
All you need to do is update the value of version each time you update the SWF.