WebExtensions and DecSoft App Builder



John Clarke
Can I create Plugins for web browsers using App Builder ? If so how can I do this ?

David Esperalta

Hello John,

Yes; please, take a look at the "WebExtension" sample.



John Clarke
Hi David, I looked at the WebExtension Sample. I built it and installed it on Chrome. The Version of Chrome that I am using is : Version 75.0.3770.100 (Official Build) (64-bit) When I clicked on the Icon for the Extension the menu appeared. However, when I clicked the buttons to set the background colour the background colour of the page that I am on did not change.

David Esperalta

Hello John,

I need to investigate a bit more when possible, since the sample works as expected in all the browsers that I try, not only in Chrome. What I see now, is that, for some reason I can't understand, we can't use jQuery to change the browser's pages color (like the sample want to do).

I am not sure if it's a question of permissions or what, since I discover that removing the jQuery lines and place a couple of "alerts" in their place, the sample working as expected, that is, the WebExtension receive the messages that we send, and even we can receive a message from the WebExtension context.

Even more, if we try something like this: "document.body.style.fontSize = '150%';", we can see it working as expected, so, it's quite rare why jQuery is not allowed... or working as expected... and I want to take a look at this when possible, John.



John Clarke
Hi David, I presume that you replaced the : $('body').css('background-color', 'red'); and $('body').css('background-color', 'blue'); in the WebExtContent method with two alerts like this : AlertBox "Can you see me ?" "success" Is that correct ? Otherwise could you tell me the code changes that you made ? Best Wishes John

David Esperalta

Hello John,

I must recognize that don't take a look into this issue... because I am very, very busy here (and I hope that you can see in what I am busy in a few months...), but, apparently, the point is to avoid the jQuery usage. That is the point: we can change the background color, but, not using jQuery. Why? I really don't know... and it's interesting to know why don't work, of course... even more, because that sample works with jQuery in the past... :-(



John Clarke

Hi David,

Thanks for your reply. I can't wait to see what you are working on. I know its going to be amazing.

As for my issue I think we can consider it resolved. I thought I would post my solution up here for others to see.

Best Wishes

John

In the WebExtContent method replace the code with the following and it works:


David Esperalta

Hello John,

Thanks for your kindly words: I really hope (and I bet it too!) that you will enjoy in which I am working on... :-) About the issue... certainly it's an issue... but must be studied, because, I can assert that jQuery can work perfectly inside a WebExtensions before, so, the question is why, apparently, now it's causing the issue... maybe a jQuery change, maybe a browsers vendors change (because I try this in various browsers, before and now)... this must be studied when possible, at least to know what happen...

P.S. Please, John, use some HTML tags in your posts, for example, "p" tag (for paragrahps), "code" tag (for code, console outputs, etc.).



David Esperalta

Hello John,

Just for your information: the next AB release Web Extension sample app works as expected, and, the jQuery library is also available to be used. Stay tuned, I want to publish this new release as quickly as possible. :-)



Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.