Error: Expected an object as the target scope - firefox

2 days ago, my web-extensions program have no problem.
But today, same program make below error.
=====
Error: Expected an object as the target scope
Schemas.jsm:2641:15
let obj = Cu.createObjectIn(context.cloneScope);
=====
enviroment:
Firefox Developer Edition
60.0b2(64bit)
=====
This is java script for popup.
The point that the error is occur is below:
chrome.extension;
chrome; < no error
chrome.extension; < error

It is changed not to be able to access chrome.extension
on a window.unload event in a popup.
Now, I've resolved this error.
// error
window.unload = function() {
var ex = chrome.extension; //error : Expected an object as the target scope
}
// fixed
function access_extention() {
var ex = chrome.extension;
}
window.onblur = access_extention;
window.onbeforeunload = access_extention;

Related

Issue deleting Google Shared Contact

I've been able to successfully add a contact via the API but I can't delete contacts that I've created.
https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/shared-contacts
function deletecontact()
{
SharedContactsApp.setOAuth2AccessToken(getSharedContactsService().getAccessToken ());
var contacts = SharedContactsApp.getContactById('5c8b05ab8c9f68c6');
SharedContactsApp.deleteContact('5c8b05ab8c9f68c6');
}
I get the following error message:
TypeError: Cannot call method "getElements" of undefined. (line 200, file "Code", project "SharedContactsApp")
How to remove this error?
Additionally...
I've tried to set a Job Title using the code below but get the following error:
ReferenceError:"profile" is not defined. (line 142, file "Code")
function changeJobTitle2()
{
SharedContactsApp.setOAuth2AccessToken(getSharedContactsService().getAccessToken ());
var contact = SharedContactsApp.getContactById('82f05968956d66f');
profile.setJobTitle('Google Apps Expert');
}
I figured it out.
function hailmary()
{
SharedContactsApp.setOAuth2AccessToken(getSharedContactsService().getAccessToken());
var contact = SharedContactsApp.getContactById('82f05968956d66f');
SharedContactsApp.deleteContact(contact)
}

Problems with ajax_function i get an error

Hello stackowerflow people, ive got problem, im trying to use one of your community scripts, and i cant find out problem. I get error about this ajax_function, how can i solve it, or fix it please help, here is the script:
<script>
function editColumn(dbc)
{
var params = 'option=edit&dbc=' + dbc ;
var Divdbc = 'edit_' + dbc;
ajax_function('ajax_edit.php', params, Divdbc);
}
function saveColumn(dbc)
{
var value = document.getElementById('date_'+dbc).value;
var params = 'option=save&value=' + value + '&Id' + dbc ;
var Divdbc = 'edit_' + dbc;
ajax_function('ajax_edit.php', params, Divdbc);
}
</script>
And here is the error which i get:
ReferenceError: ajax_function is not defined
How can i possible create that ajax function to work with my script?
it means that the ajax_function() is not declared or not found
find this keyword in any of your files "function ajax_function()"
or
check if it needs to import the script that contains function ajax_function()
example:
<script src="thefile.js"></script>

Exchange EWS SearchMailboxes invalid child element error

I have a strange error. When i try to do a SearchMailboxes, I get this error:
Unhandled Exception: Microsoft.Exchange.WebServices.Data.ServiceResponseException: The request "://schemas.microsoft.com/exchange/services/2006/types" has invalid child element 'ExtendedAttributes'
The problem is that i get this error in some pc's. With fiddler I could see that my pc sends a request without the node ExtendedAttributes and it works.
This is the ExtendedAttributes node that produces the error.
The code:
List<MailboxSearchScope> scopeList = new List<MailboxSearchScope>();
foreach (SearchableMailbox mb in searchableMailboxes)
{
MailboxSearchScope scope = new MailboxSearchScope(mb.ReferenceId, MailboxSearchLocation.All);
scopeList.Add(scope);
}
MailboxQuery query = new MailboxQuery(searchQuery, scopeList.ToArray());
MailboxQuery[] mbQueryList = new MailboxQuery[] { query };
SearchMailboxesParameters p = new SearchMailboxesParameters
{
SearchQueries = mbQueryList,
ResultType = SearchResultType.PreviewOnly
};
ServiceResponseCollection<SearchMailboxesResponse> res = _service.SearchMailboxes(p);
ExtendedAttributes is a new element that was introduced in Exchange 2013 SP1 and is intended for internal use only.
http://msdn.microsoft.com/en-us/library/office/dn627392(v=exchg.150).aspx
I don't see in your code where you are trying to use this element so I would suggest that you specify ExchangeVersion.Exchange2013 when you are instantiating your ExchangeService object.

Facebook sdk for Unity: error

As facebook just released it's new sdk for Unity. I m trying to use FB.API method and getting a lot of troubles with it. Like this is code I have written in UnityScript in my Unity project.
function LoginCallback() {
Debug.Log("User id is"+ FB.UserId);
FB.API("/me?fields=id,first_name,friends.limit(100).fields(first_name,id)", Facebook.HttpMethod.GET, LogCallback, null);
FBUtil.Log(FB.UserId); // Use this to sync progress, etc.
}
function LogCallback(response:String) {
// Debug.Log(response);
var profile = FBUtil.DeserializeJSONProfile(response);
var friends = FBUtil.DeserializeJSONFriends(response);
}
I am getting this error in Unity Log
BCE0005: Unknown identifier: 'FBUtil'.
And if I comment out the FBUtil part and just try to print the json string by writing this
function LoginCallback() {
Debug.Log("User id is"+ FB.UserId);
FB.API("/me?fields=id,first_name,friends.limit(100).fields(first_name,id)", Facebook.HttpMethod.GET, LogCallback, null);
}
function LogCallback(response:String) {
Debug.Log(response);
}
I am able to get Fb.UserId but I am not getting the response with the following details like first_name, friends. The error in DDMS Log is this
"09-04 21:35:04.534: E/Unity(23893): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54)
"
Someone help me out.

ReferenceError: "BarSeriesImpl" is not defined

My report works fine in BIRT- it shows some Bar chart graphic.
But when I import in some system (IBM maximo) I am getting this error instead of displaying the bar chart:
ReferenceError: "BarSeriesImpl" is not defined. at line 8 of chart script:''
I used this script to show me some values on Bar chart.
importPackage( Packages.java.util );
importPackage( Packages.org.eclipse.birt.chart.model.type.impl );
function afterDataSetFilled(series, dataSet, icsc)
{
if( series.getClass() == BarSeriesImpl ){
var inv =
parseInt(icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("IN"));
var outv =
parseInt(icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("OUT"));
var canv =
parseInt(icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("CANCELED"));
var narray1 = new ArrayList( );
narray1.add(inv);
narray1.add(outv);
narray1.add(canv);
dataSet.setValues(narray1);
}else{
var catArray = new ArrayList();
catArray.add("IN");
catArray.add("OUT");
catArray.add("CANCELED");
dataSet.setValues(catArray);
}
}
How to solve this? Does I have to import somehow this class in my system or ..?
Thank you
I know I'm resurrecting an old question but this just caught my eye because it was similar to another post I answered this week. I think you might be missing org.eclipse.birt.chart.model.type.impl.BarSeriesImp in the systems that you are getting this error message. I think if you add the BIRT runtime jars to the lib path then it should resolve that error.

Resources