reading/writing preferences - firefox-addon

I have read most all of the documentation and questions related to preferences I could find but I have an error that is always coming up no matter what method I try and I do not understand it.
js file loaded in browser overlay xul
var prefs = Components.classes["#mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefService).
getBranch("extensions.{my-guid-id}.");
var value = prefs.getBoolPref("firstrun");
defaults/preferences/prefs.js:
pref("extensions.{my-guid-id}.firstrun", true);
The error message in the error console says uncaught exception: "compenent returned failure code 0x8000ffff" on line 27 which is right at getBoolPref() call.

Your code looks correct.
Are you sure that you did not put the word true in quotes or accidentally already set it as a non boolean preferences?
I would suggest going into about:config and verifying that your firstrun preference is showing up as a Boolean.
That's the most common cause of the problem you are seeing.

Related

SwiftUI Firebase Auth Error "Paths must not contain // in them"

In my SwiftUI app I suddenly started getting this error once my user logs in (I use Firebase Phone Auth)". It happens right as soon as I do this:
let db = Firestore.firestore()
db.collection("user").document(user.UID)
.getDocument { document, err in
This is the error, the app crashes totally:
Invalid path (com.googleusercontent.apps.178114301509-gvnp7pp9tm6jq9s4rridgoae9glog8nj://firebaseauth/link?deep_link_id=https%3A%2F%2Fgigas-4f2dd.firebaseapp.com%2F__%2Fauth%2Fcallback%3FauthType%3DverifyApp%26recaptchaToken%3DTOKEN%26eventId%3Dmwkcoldfan). Paths must not contain // in them."
I tried reverting back my project with Github but I cannot find whatever happened that started all this. I don't even know what Path is the debugger talking about. I have seen people in other cases saying that maybe it is the id being empty so a / and another / collapse into a // making it causing such an error but it is not my case since I am sure the id is not empty.

Sentry error - IndexSizeError: The index is not in the allowed range

I am getting this error from Sentry repetitively in ios - safari 14.0 in react project.
There is no code trace and no other information than this but it repeats in almost every URL.
I have already searched for the options everywhere. I have tried debugging but I can't replicate it, and so I can't resolve it.
Does anyone know what does this error means? Or how can I add debug information in Sentry?
I have been looking for the solution for a while and couldn't get it. I know it's a bit lack of information to provide but that's why I am asking this. if someone can tell me how to deal with sentry errors if you don't know why it is repeating so often, it will be really helpful.
A similar issue still exists.
Faced this in Safari when Draft.js is updating the editor state.
The error which I see: IndexSizeError: The index is not in the allowed range.
For me, playing around with Paragraph Directioncontext menus items after right-clicking on the Editor selection reproduced the error.
My Solution/hack:
Add it to any JS file executing before the Editor file.
const nativeSelectionExtend = Selection.prototype.extend;
Selection.prototype.extend = function (...args) {
try {
return nativeSelectionExtend.apply(this, args);
} catch (error) {
console.log('Selection error.', error);
}
};
It works properly for me. Maybe will be useful for somebody as well.
Thanks to https://github.com/shpakkdv

How to save breakpoints in Centura 6 Team Developer SQL/Windows

How can I save breakpoints in Gupta 6? When i refresh libraries after inserting some code into another .apt, my breakpoints in main program are lost. Is there any trick how to prevent from it?
Breakpoints will be saved if you save the file as TYPE binary ( i.e. save as file type = 'Normal' ) , not if saved as Text ( i.e. file type = 'TEXT' or 'INDENTED TEXT' ). This is regardless of what file extension you have . p.s. only save as binary if you're in debug mode. Otherwise difficult to fix if code becomes corrupt. If saved as Text - much easier to fix.

Swift 4 app crashes when open file from icloud

I have a problem that my app crashes when it is opening a file from iCloud. If I open this file from my app with a Document Picker, everything is fine. But if I try to open from outside my app, for example from iCloud or safari download it crashes. If I open it from local storage "my iphone" it is also working. It is interesting because it was good one week ago :)
So in AppDelegate, I've implemented the following method:
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {}
According to the logs the crash occurs because the file does not exist.
file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Desktop/twic1121.pgn
This is the result if I print the URL from the parameter. I think this means that the file is there.
But if i do this: print(fm.fileExists(atPath: url.path)) then this is false.
So it is obvious that after let dataFromFile = fm.contents(atPath: url.path)
this is nil.
I have no idea what could be the problem here. So the real question here is why this is nil?
It appears that the error can be many things, all not related to the class you are applying the code (AppDelegate) nor the methods you are calling.
My guess is that the URL you are calling is not correctly built (not pointing to the correct object you are trying to point to). For many reasons.
See if one of this reasons fix your issue:
(1) The end of the URL you are calling had the suffix "pgn". If you are looking to load a picture, maybe the suffix is wrong. In that case it could have been some known and supported format like "png", "jpeg" or "jpg".
(2) The "%20"symbol at the middle of your code also lifts a flag. Does not seem to be a correct URL object of swift. Maybe the URL you are using is not represented in the correct way.
(3) com~apple~CloudDocs also lifts a flag, since it would unlikely have a "~" symbol in a URL passed. This also strongly suggests that maybe the URL you are using is not represented in the correct way.
I think your URL is not pointing to where you are trying to point to, resulting in the "does exist" method return false and the loading resulting in nil.
If all of this does not fix your issue, post more details of the code. Specially what method you are calling to build/create this URL object you are using, that points to: file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Desktop/twic1121.pgn

iOS UITest error when try to select picker element

I'm trying to select an element of picker, the picker has Accessibility = picker_station, why can I do ? is something wrong ? or I need to use other code.
let app = XCUIApplication()
app.pickers["picker_station"].pickerWheels.element.adjust(toPickerWheelValue: "Aberdeen")
xcode error is:
Testing Failure - Internal error: unable to find current value '1 of 152' in possible values
Thanks
You are using it correctly, but the adjust(toPickerWheelValue:) method is buggy, as discussed here: https://forums.developer.apple.com/thread/16104
I agree with Oletha this seems to remain an unfixed bug in the framework.
We could fix the issue at least temporarily by calling
pickerWheel.swipeDown()
before calling
pickerWheel.adjust(toPickerWheelValue: "Value")
Otherwise we received the same crash.
After you displayed picker wheel on screen, you can update the value by:
app.pickerWheels.element.adjustToPickerWheelValue("Updated row value")

Resources