After the review of my Edge extension I got the approval to submit it into the store. However the submission failed with this error.
File specified by 'background.page' does not exist:
Extension\PopupApplication\app\index.html?background=1
Validation failed for extension manifest: Extension\manifest.json
The relevant part in the manifest.json looks like:
"background": {
"page": "PopupApplication/app/index.html?background=1",
"persistent": true
}
It seems like the validation does not allow query parameters in the background.page property. But my logic requires the parameter. Is there any workaround for this or do I have to change my app logic?
The Edge extension works fine locally. Also it works for Chrome and Firefox. I have used the Microsoft edge Extension Toolkit to port the Chrome extension.
Edit: The simplified folder structure looks like the following
+ Assets
+ Extension
|----+ PopupApplication
|----+ app
|--------+ index.html
|----+ manifest.json
The fix was to change our code to successful submit the edge extension. The submission does not allow query parameters in the background.page property. This was confirmed by the Microsoft support.
Related
I an trying to figure out how to add webRequest extension to Microsoft Edge. Can someone provide some assistance? I have gone though a number of documents, but when I go to Microsoft online store I don't see it there.
Test code:
<html>
<script>
browser.webRequest.onBeforeRequest.addListener(
logURL,
{ urls: ["<all_urls>"] }
);
function logURL(requestDetails) {
console.log("Loading: " + requestDetails.url);
};
</script>
</html>
In the doc of webRequest in MDN, we can see that:
To use the webRequest API for a given host, an extension must have the "webRequest" API permissions and the host permission for that host.
Where can we add the permissions? The answer is the manifest.json file. It is the necessary part of an extension. You could see the Anatomy of an extension to learn the compositions of an extension.
Besides, browser.webRequest isn't in the list of content scripts APIs, so we can only use it in background scripts.
In a conclusion, we can't just use the browser.webRequest in a script of a html file. If we want to test the event browser.webRequest.onBeforeRequest, we need to have a manifest.json file, put permisssions in it:
"permissions": [
"*://learn.microsoft.com/*",
"webRequest"
]
Then put the scripts you gave in the background scripts. Then you could try to debug the extension in Edge, there will be no error. Here is an article about creating a Microsoft Edge extension, you could refer to it if you need.
I'm using the Firefox Add-on SDK to develop a Firefox add-on.
I have followed the Getting Started tutorial.
Firefox version : 41.0.2
My Process is :
jpm run --> OK the add-on works fine
jpm xpi --> OK : Create #myAddon.xpi (JPM [info] Successfully created .xpi at ...)
Use of #myAddon.xpi --> NOK
When I tried to install the add-on in my Firefox ( Add-on -> install from file -> #myAddon.xpi ), I have a message "Install successfully". Looks good. BUT, the add-on doesn't work. Nothing happens.
So, why is the test with jpm run OK, but does not work after installing the .xpi file???
I can share the code with you, but how can this situation happen? If it works in test, I expect that it works in "release".
I get no error or warning.
High Level :
Index.js:
pageMod.PageMod({
include: "*",
contentScriptFile: [data.url("jquery-1.11.3.min.js"), data.url("./Compute.js")],
onAttach: function (worker) {
var currentUrl = tabs.activeTab.url;
param = currentUrl;
Request({
url: param,
onComplete: function (response) {
var parsed = JSON.parse(response.text);
worker.port.emit('got-request', parsed);
}
}).get();
}
data/Compute.js
self.port.on('got-request', function (data) {
console.log(data);
});
Edit (moved from comments):
I find something interesting.... Depending on the level of privacy in FireFox the addon will work or not. ( Options->Privacy->History "Remember history " or "Never remember history") - Remember history " --> addOn OK - "Never remember history" --> addOn NOK Any idea why
As you have determined, if you desire your Firefox Add-on SDK add-on to work in Private Browsing mode you need to have add the key private-browsing with a value of true in your package.json file.
If you are using no other permissions, you could add a line to your package.json file that looks like:
"permissions": {"private-browsing": true}
The Firefox documentation on writing SDK add-ons for private browsing mode specifically states that the require("sdk/private-browsing").isPrivate() method will return true when any of the following is the case (emphasis mine):
a private window, or
a tab belonging to a private window, or
a worker that's associated with a document hosted in a private window
any window, tab, or worker if the browser has been configured to never remember history (Options->Privacy->History)
If you do not have "private-browsing": true, then, as the documentation states, the following will be the case (emphasis mine):
the windows module will not list any private browser windows, generate any events for private browser windows, or let the add-on open any private browser windows
the tabs module will not list any tabs that belong to private browser windows, and the add-on won't receive any events for such tabs
any ui components will not be displayed in private browser windows
any menus or menu items created using the context-menu will not be shown in context menus that belong to private browser windows
the page-mod module will not attach content scripts to documents belonging to private browser windows
any panel objects will not be shown if the active window is a private browser window
the selection module will not include any selections made in private browser windows
The net effect will be that your add-on will appear to not work when the profile you are using is configured to never remember history without having the "private-browsing": true permission in your package.json.
If you do put that permission in your package.json file, you must use the private-browsing module, require("sdk/private-browsing").isPrivate(object), to check for being in a private window or tab. If you are in such a window or tab you need to not store any information about such environment.
I'm attempting to use a JSON object living in a data.json file to be the dataset for a quick prototype I'm working on. This lives in a my_project/www/data/ directory. I have an Angular service that goes and grabs the data within this file using $http, does some stuff to it, and then it's used throughout my app.
I'm using Cordova and Ionic. When using ionic serve on my computer, everything looks perfect in the browser. However, when using ionic view (http://view.ionic.io/) and opening the app on my iPad, I see a:
{"data":null,"status":0,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"../data/items.json","headers":{"Accept":"application/json,test/plain,*/*}},"statusText":""}
for a response. I would think that if it were a relative URL issue, that it would also not work in the browser, but that is not the case.
Here's what I'm doing:
config.xml has this line:
<access origin="*" subdomains="true"/>
My service that preforms the simple request is doing:
return $http.get("../data/data.json").then(function (response) {
return response.data;
});
And finally, in my controller, I ask for the service to preform the request:
myService.goGetData().then(onComplete, onError);
In my browser, onComplete() is invoked and on the iPad, onError() is invoked.
Any guidance?
On your local developer machine you're actually running a webserver when you run ionic serve. So a path like ../../data.json will work because it is totally valid in the context of the webserver that has complete filesystem access.
If, however, you try to do the same thing on your device, you're probably going to run into an issue because the device has security policies in place that don't allow ajax to traverse up outside of the root. It is not a dynamic webserver so it can't load files up the tree. Instead you'd use something like the cordova file plugin to grab the file contents from the filesystem. If you prefer, you can use ngCordova to make interacting with the plugin a bit less painful.
I am 99% sure this is what is happening but you can test my theory by pointing your $http call to some dummy .json data hosted on a publicly available server to see if it works. Here is some dummy json data.
Just gonna leave this here because I had the same problem as the original question author. Simply removing any starting slashes from the json file path in the $http.get function solved this problem for me, now loading the json data works both in the browser emulator and on my android device. The root of the $http call url seems to always be the index.html folder no matter where your controller or service is located. So use a path relative from that folder and it should work. like $http.get("data/data.json")
So this is an example json file. save it as data.json
[
{
"Name" : "Sabba",
"City" : "London",
"Country" : "UK"
},
{
"Name" : "Tom",
"City" : "NY",
"Country" : "USA"
}
]
And this this is what a example controller looks like
var app = angular.module('myApp', ['ionic']);
app.controller('ExhibitionTabCtrl', ['$scope', '$http', function($scope,$http) {
$http.get("your/path/from/index/data.json")
.success(function (response)
{
$scope.names = response;
});
}]);
Then in your template make sure you are you are referencing your controller.
<ion-content class="padding" ng-controller="ExhibitionTabCtrl">
You should then be able to use the a expression to get the data
{{ names }}
Hope this helps :)
I was also looking for this and found this question, since there is no real answer to the problem I kept my search on the Internet and found this answer at the Ionic Forum from ozexpert:
var url = "";
if(ionic.Platform.isAndroid()){
url = "/android_asset/www/";
}
I've used it to load a 3D model and its textures.
update: ionic 2 beta (version date 10 Aug 2016)
You must add prefix to local url like this: prefix + 'your/local/resource'.
prefix by platform:
ios = '../www/'
android = '../www/'
browser = ''
we can create an urlResolver provider to do this job.
notice: only change url in *.ts code to access local resource, don's do this with remote url or in html code.
Have fun and good luck with beta version.
An Starter Ioner
It is possible to access local resources using $http.get.
If the json file is located in www/js/data.json. You can access using
js/data.json
Do not use ../js/data.json. Using that only works in the local browser. Use js/data.json will work on both local browser and iOS device for Cordova.
I'm converting URL syntax from 3.4 to 4.2 syntax (CMIS 1.0)
I'm trying to upload a new version of a document to the PWC via a PUT for a document.
Previous 3.X syntax to upload to the PWC was as follows:
/alfresco/service/cmis/pwc/i/{id}?checkinComment={checkinComment?}&major={major?}&checkin={checkin?}
In 4.2 I am using this URL:
/alfresco/api/-default-/public/cmis/versions/1.0/atom/content?id=2e9c6773-4b02-41e0-b8e5-ce04a48c44f6?checkinComment=hgfhfgh&checkin=true&major=true
Here 2e9c6773-4b02-41e0-b8e5-ce04a48c44f6 == ID of the PWC.
I'm getting the error:
The remote server returned an error: (404) Not Found.
What's wrong with this?
When I step through cmislib's checkIn unit test against a preview build of 4.2 Enterprise using the new service URLs, I see that the PUT that does the checkin is hitting this URL:
u'http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/entry?id=71be4c86-1dcb-49a8-8373-d1c5ea4405b7%3Bpwc'
So try changing "content" to "entry" and also double-check that you have the ID of the PWC. Note that mine actually has "pwc" on the end whereas yours does not.
I get this exception for a seemingly valid URL:
document = componentLoader.loadComponentFromURL(templateURL, "_blank", FrameSearchFlag.CREATE, new PropertyValue[0]);
Called with templateURL being:
file:///var/lib/tomcat6/webapps/convert/WEB-INF/template.odp
BTW: the same code runs well on windows. (Of course diff URL is generated).
Edit: For URLs like:
private:factory/simpress
I get the same error.
You get this error message when the corresponding application (Calc, Writer etc.) is not installed in your system.
I originally tried to install the (Debian) metapackage openoffice.org-headless which did not contain any of the individual programs, only the core infrastructure.